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

Show SpatialSeries when the second axis of the data is 1 #206

Open
weiglszonja opened this issue May 2, 2022 · 1 comment
Open

Show SpatialSeries when the second axis of the data is 1 #206

weiglszonja opened this issue May 2, 2022 · 1 comment

Comments

@weiglszonja
Copy link

Rendering SpatialSeries data with nwbwidgets is not possible when spatial_series.data.shape[1] == 1.
I noticed this issue when when trying to visualise SpatialSeries data for a dandi dataset : "animal_direction" which is a SpatialSeries with a shape of (90050, 1) (see below steps to reproduce).

We discussed with @CodyCBakerPhD that this should be handled on the widgets side, as this data was created with pynwb without complains. Currently, this case gets handled as:

https://github.com/NeurodataWithoutBorders/nwb-jupyter-widgets/blob/c891978d74a2e52a3ccbf65949f5b8192858e1dc/nwbwidgets/behavior.py#L93-L94

If you agree this should be handled on the widgets side as well, I'll try to create a PR for this as well.

Steps to reproduce with the real data:

from pynwb import NWBHDF5IO
from nwbinspector.tools import get_s3_urls_and_dandi_paths
from nwbwidgets import nwb2widget

s3_path = list(get_s3_urls_and_dandi_paths(dandiset_id="000230", n_jobs=-1))[0]

io = NWBHDF5IO(
    path=s3_path,
    mode="r",
    load_namespaces=True,
    driver="ros3")

nwbfile = io.read()

print(nwbfile.processing["animal_behaviour"].data_interfaces["animal_direction"].data[:].shape)

nwb2widget(nwbfile)
@CodyCBakerPhD
Copy link
Collaborator

My main point is just that the data access through the actual NWBFile is 'fine' - has no issues and is clear what dims represent. Error stems from how the widgets code expects the output shape to be, which I think ought to be able to handle this case.

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