Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I view a remote NWB file hosted somewhere else than Dandi? #129

Closed
ehennestad opened this issue Feb 23, 2024 · 14 comments
Closed

How can I view a remote NWB file hosted somewhere else than Dandi? #129

ehennestad opened this issue Feb 23, 2024 · 14 comments

Comments

@ehennestad
Copy link

Visualize remote NWB files hosted on non-DANDI web servers or cloud storage.

I did not immediately understand how to do this

@ehennestad
Copy link
Author

Also, are there any requirements to where the file is stored, i.e does it need to be in an s3 bucket and available through the s3 protocol, or can it be on any cloud storage with api access?

@magland
Copy link
Collaborator

magland commented Feb 23, 2024

Hi @ehennestad

Right now the requirements are:

  • The file needs to be accessible via URL
  • The file server needs to support the range header for http requests

Do you have a URL for the NWB file?

Then you just do:

https://flatironinstitute.github.io/neurosift/?p=/nwb&url=https://api.dandiarchive.org/api/assets/37f5e3ce-e1b7-48a7-a47d-6745875eacaa/download/

replacing the url query parameter.

@ehennestad
Copy link
Author

Awesome! Thanks

@cdesyoun
Copy link

Hi,
I am working on the NEMAR project, which manages EEG/MEG/iEEG datasets (https://nemsr.org/).

For testing NWB files, I created sample files on NEMAR storage. These files can be accessed via the download URL, for example, "https://nemar-dev.ucsd.edu/dataexplorer/download?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/download".

When I test this link, https://neurosift.app/?p=/nwb&url="https://nemar-dev.ucsd.edu/dataexplorer/download?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/download", it results in a forever loading page.

What do I need to know to use the Neurosift interface correctly?

@ehennestad
Copy link
Author

When I test this link, https://neurosift.app/?p=/nwb&url="https://nemar-dev.ucsd.edu/dataexplorer/download?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/download", it results in a forever loading page.

Is that link for a single file? The URL should point to one file

@magland
Copy link
Collaborator

magland commented Jul 11, 2024

Hi @cdesyoun

I fixed the query parsing for neurosift so that solves one issue.

BTW, your trailing quotation mark was not included in the hyperlink, but now it should work either way.

The other issue is that the server (https://nemar-dev.ucsd.edu) does not have CORS enabled for the https://neurosift.app domain. Is it possible to have the admins modify the CORS configuration? That should solve the problem. If so, they should enable HEAD and GET requests for https://neurosift.app and also (for development) http://localhost:4200. It also needs to support Range requests because neurosift requests specific byte ranges.

If it is not possible to modify the CORS configuration in this way, you'll need to set up a proxy server, which involves some effort and which will incur addition expense in terms of bandwidth.

@cdesyoun
Copy link

When I test this link, https://neurosift.app/?p=/nwb&url="https://nemar-dev.ucsd.edu/dataexplorer/download?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/download", it results in a forever loading page.

Is that link for a single file? The URL should point to one file

Yes, it is a single file.

@cdesyoun
Copy link

Hi @cdesyoun

I fixed the query parsing for neurosift so that solves one issue.

BTW, your trailing quotation mark was not included in the hyperlink, but now it should work either way.

The other issue is that the server (https://nemar-dev.ucsd.edu) does not have CORS enabled for the https://neurosift.app domain. Is it possible to have the admins modify the CORS configuration? That should solve the problem. If so, they should enable HEAD and GET requests for https://neurosift.app and also (for development) http://localhost:4200. It also needs to support Range requests because neurosift requests specific byte ranges.

If it is not possible to modify the CORS configuration in this way, you'll need to set up a proxy server, which involves some effort and which will incur addition expense in terms of bandwidth.

Thank you for the quick update, @magland. I will give it a try.

@magland
Copy link
Collaborator

magland commented Jul 11, 2024

Sounds good @cdesyoun . Let me know how that goes. I think it would be great to be able to point neurosift to your database.

@magland
Copy link
Collaborator

magland commented Jul 21, 2024

@cdesyoun did you get this working? I got an email notification but I don't see the comment here. The link in the notification was working for me....

@cdesyoun
Copy link

@magland Yes, it is working. I resolved the CORS issue on the nemar-dev site.

@cdesyoun
Copy link

cdesyoun commented Aug 2, 2024

@magland , When accessing the following URL:

https://neurosift.app/?p=/nwb&url="https://nemar-dev.ucsd.edu/dataexplorer/downloadfile?filepath=/expanse/projects/nemar/openneuro/nwb_example_files/sub-01_ses-20140828T132700_ecephys+image.nwb",

I encountered the error messages below:

Error loading file: Problem loading file. Unable to load root group. This could be due to a CORS configuration issue.

I guess that the file name, "sub-01_ses-20140828T132700_ecephys+image.nwb", is not allowed due to the presence of a plus sign (+).

@magland
Copy link
Collaborator

magland commented Aug 2, 2024

@cdesyoun
Copy link

cdesyoun commented Aug 2, 2024

Thanks for finding the bug, @magland. I noticed that this type of file name is not allowed on the NEMAR site. I will resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants