SilverLabUCL / PySilverLabNWB

Python tools for working with Silver Lab data in the NWB2 format
MIT License
1 stars 0 forks source link

Replace manifold #63

Closed ageorgou closed 4 years ago

ageorgou commented 4 years ago

Imaging planes in NWB used to have a manifold dataset to store the specific locations of the pixels on that plane. We populated based on the the plane's z coordinate, as well as the dimensions of and number of pixels in the imaging frame: https://github.com/SilverLabUCL/PySilverLabNWB/blob/89a0c7af07bb5b301e2b2dc218522eb3f38f2654/src/silverlabnwb/nwb_file.py#L856-L867

Since [NWB Schema 2.2.0#(https://nwb-schema.readthedocs.io/en/latest/format_release_notes.html#january-6-2020), the manifold has been deprecated, and imaging planes are now described in terms of an origins coordinate and a grid spacing parameter (see background in NeurodataWithoutBorders/pynwb#576).This description is more compact, but only allows regular grids.

Even though the manifold description is still technically allowed (albeit with deprecation warnings), it is already problematic: since pynwb 1.3.1, the manifold can no longer be compressed, which will result in much bigger file sizes. This is therefore blocking us from updating to newere pynwb versions.

Replacing it is straightofrward for the current examples, but with some considerations:

  1. Is the z coordinate recorded in the new origin coords? (possibly, but should double-check; if not, we should store it somewhere unless we rely on the naming of the planes)
  2. Will we need non-regular grids (e.g. for dendritic scans)? If we do, we can perhaps define an extension of ImagingPlane which has an explicit manifold. The origin coordinates and grid spacing are optional, so we could leave them empty in that case.
ageorgou commented 4 years ago

Done in #65.