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

Replace manifold #63

Closed
ageorgou opened this issue Aug 14, 2020 · 1 comment
Closed

Replace manifold #63

ageorgou opened this issue Aug 14, 2020 · 1 comment
Labels
NWB Use of the NWB format or its interfaces

Comments

@ageorgou
Copy link
Contributor

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:

num_pixels = int(self.labview_header['GLOBAL PARAMETERS']['frame size'])
plane_width_in_microns = self.labview_header['GLOBAL PARAMETERS']['field of view']
template_manifold = np.zeros((num_pixels, num_pixels, 3))
x = np.linspace(0, plane_width_in_microns, num_pixels)
y = np.linspace(0, plane_width_in_microns, num_pixels)
xv, yv = np.meshgrid(x, y)
template_manifold[:, :, 0] = xv
template_manifold[:, :, 1] = yv
self.zplanes = {}
for plane in zplane_data.itertuples():
manifold = template_manifold.copy()
manifold[:, :, 2] = plane.z

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 ageorgou added the NWB Use of the NWB format or its interfaces label Aug 14, 2020
@ageorgou
Copy link
Contributor Author

Done in #65.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NWB Use of the NWB format or its interfaces
Projects
None yet
Development

No branches or pull requests

1 participant