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

Viewing a local running instance of neurosift using the jupyterhub proxy. #194

Open
ovalerio opened this issue Jul 19, 2024 · 6 comments
Open

Comments

@ovalerio
Copy link

Hello Jeremy,

Thank you for developing neurosift. I think is a great software, to get to learn & debug NWB files.

I hope you can help me getting it to run locally. Let me explain what I am doing. I got an NWB that I am able to read inside a jupyter notebook:
image

The file is in the staging jupyterhub from dandi.

I have installed neurosift using pip to be the latest version and run it from a jupyterhub terminal window passing the path of the nwb file. It looks as follows:

image

Then, I opened a second tab in the browser and enter the port and path that I got from neurosift:

https://hub-staging.dandiarchive.org/user/ovalerio/proxy/58981/tmp/view_nwb_sSXSRYZn

and it is showing empty:
image

In the terminal where I run neurosift there is no error messages:

(suite2p) jovyan@jupyter-ovalerio:~$ neurosift view-nwb results_orig/suite2p/ophys.nwb 
npm version: 10.8.1
node version: v22.4.1

up to date, audited 65 packages in 2s

12 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Opening https://flatironinstitute.github.io/neurosift/?p=/nwb&url=http://localhost:58981/files/ophys.nwb

> [email protected] start
> node src/index.js /tmp/view_nwb_sSXSRYZn

Serving files in /tmp/view_nwb_sSXSRYZn
Serving files in /tmp/view_nwb_sSXSRYZn on port 58981.

For the record, I am using Firefox in Ubuntu:
image

Best,
Omar

@ovalerio
Copy link
Author

I also tried using the neurosift.app URL suggested on the command line and gave me a CORS.
image

@magland
Copy link
Collaborator

magland commented Jul 19, 2024

Hi @ovalerio . The issue is that the server is listening on that port on the dandihub instance, not on your local machine. So it's not going to work if you open a new tab on your browser.

I can see the appeal of using neurosift to view an .nwb file that is local to dandihub. But I can't think of a way to do it right now.

@magland
Copy link
Collaborator

magland commented Jul 19, 2024

@ovalerio

I thought of how you can do this!

In your jupyter notebook (on dandihub), run the following cell

from IPython.display import IFrame
ns_url = 'https://neurosift.app?p=/nwb&url=...'
display(IFrame(ns_url, width='100%', height=800))

where you'd fill in the appropriate url. Adjust the height as appropriate.

@ovalerio
Copy link
Author

@magland Thanks!

I will try this once dandihub is back online and come back here to share the result.

@ovalerio
Copy link
Author

@magland

Hello again, I tried your suggestion and it is working as far as I can see. 👍

The neurosift window was showing for a brief second (it was showing also the left navigation panels) and then I got an error message: "Problem loading file. Unable to load root group."

I'm not sure if the problem is due to my NWB file. I'm not getting that error when opening the file using the pynwb.NWBHDFIO module.

image

@magland
Copy link
Collaborator

magland commented Jul 29, 2024

First, make sure you have the latest neurosift python package

pip install --upgrade neurosift

If that doesn't work, is that file something you could share? Maybe email to me or put it in a downloadable location?

Alternatively, could you downloaded it to your local machine and try to view it without jupyter?

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

2 participants