sccn / NEMAR-pipeline

5 stars 1 forks source link

NWB file browsing #82

Open arnodelorme opened 2 weeks ago

arnodelorme commented 2 weeks ago

Yaroslav's message

just in case, here is my setup in apache to allow access to my files accessed by some 3rd party services... I don't think it is needed for neurosift but I could be wrong

 <IfModule mod_headers.c>
   # <FilesMatch "\.(nii|nii.gz)$">
   <FilesMatch "\.*$">
     # To offload rendering etc to bioimagesuiteweb
     SetEnvIf Origin "http(s)?://(www\.)?([datalad.org](http://datalad.org/)|[bioimagesuiteweb.github.io](http://bioimagesuiteweb.github.io/)|[bisweb.yale.edu](http://bisweb.yale.edu/)|[neuroglancer-demo.appspot.com](http://neuroglancer-demo.appspot.com/))$" AccessControlAllowOrigin=$0
     Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
     Header merge Vary Origin
   </FilesMatch>
 </IfModule>
arnodelorme commented 2 weeks ago

Example

https://neurosift.app/?p=/nwb&url=https://api.dandiarchive.org/api/assets/f0278ddd-f001-463f-b2ba-cf78ca9316f4/download/&dandisetId=000947&dandisetVersion=draft&tab=neurodata-item:/acquisition/ElectricalSeries|ElectricalSeries&tab-time=0.022059545939383057,0.23014721551441283,undefined](https://neurosift.app/?p=/nwb&url=https://api.dandiarchive.org/api/assets/f0278ddd-f001-463f-b2ba-cf78ca9316f4/download/&dandisetId=000947&dandisetVersion=draft&tab=neurodata-item:/acquisition/ElectricalSeries%7CElectricalSeries&tab-time=0.022059545939383057,0.23014721551441283,undefined)

arnodelorme commented 2 weeks ago

@cdesyoun example files are in example in the following folder

nemar/arno/nwb_example_files
cdesyoun commented 2 weeks ago

@arnodelorme , actually, we have public file access permissions via the download url. You can access the following NWB files that you provided.

When I tested the following link you suggested and replaced the existing URL with nemar-dev's URL, I encountered a 'Loading' page.

https://neurosift.app/?p=/nwb&url=%22https://nemar-dev.ucsd.edu/dataexplorer/download?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/sub-005_ieeg.nwb%22&dandisetId=000947&dandisetVersion=draft&tab=neurodata-item:/acquisition/ElectricalSeries|ElectricalSeries&tab-time=0.022059545939383057,0.23014721551441283,undefined](https://neurosift.app/?p=/nwb&url=%22https://nemar-dev.ucsd.edu/dataexplorer/download?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/sub-005_ieeg.nwb%22&dandisetId=000947&dandisetVersion=draft&tab=neurodata-item:/acquisition/ElectricalSeries|ElectricalSeries&tab-time=0.022059545939383057,0.23014721551441283,undefined)

It seems we need to change the parameters of this URL that apply to this dataset."

Thanks, Choonhan Youn

arnodelorme commented 2 weeks ago

Yes, @cdesyoun . Thank you for trying. I think the permission you need to set are more than download. It is access by a 3rd party site. These are usually blocked. This is what the code I shared does.

cdesyoun commented 2 weeks ago

Arno, in our case, we don't need the provided configuration snippet since NEMAR files are publicly accessible to any third parties via the NEMAR download link. This configuration snippet is intended to set cross-origin resource sharing (CORS) headers for specific third-party services accessing files on the server. It ensures that resources can be requested from another domain, which is necessary for web applications to function correctly when fetching resources from different origins. The snippet sets an environment variable, 'AccessControlAllowOrigin', to the value of the Origin header if it matches one of the specified domains. However, the neurosift domain is not included, which means only the specified domains can access the resources. We should ask the neurosift team how to access NEMAR files in their interface and provide the NEMAR data access URLs.

arnodelorme commented 2 weeks ago

OK, would you mind to email Ben Dichter @.> and @. @.***> telling them that the link loads forever.

On Jul 10, 2024, at 21:16, Choonhan Youn @.***> wrote:

Arno, in our case, we don't need the provided configuration snippet since NEMAR files are publicly accessible to any third parties. This configuration snippet is intended to set cross-origin resource sharing (CORS) headers for specific third-party services accessing files on the server. It ensures that resources can be requested from another domain, which is necessary for web applications to function correctly when fetching resources from different origins. The snippet sets an environment variable, 'AccessControlAllowOrigin', to the value of the Origin header if it matches one of the specified domains. However, the neurosift domain is not included, which means only the specified domains can access the resources. We should ask the neurosift team how to access NEMAR files in their interface and provide the NEMAR data access URLs. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

cdesyoun commented 2 weeks ago

On Neurosift's GitHub page, I found this issue link: https://github.com/flatironinstitute/neurosift/issues/129. I left a comment regarding the use of third-party data in the Neurosift interface.