- neurodata_type_def: ImagingSpace
neurodata_type_inc: LabMetaData # Would prefer basic NWBContainer
doc: Metadata about the region of physical space that imaging data was recorded from.
datasets:
- name: origin_coordinates
dtype: float64
dims:
- - x, y, z
shape:
- - 3
doc: Physical location in stereotactic coordinates for the first element of the grid.
See reference_frame to determine what the coordinates are relative to (e.g., bregma).
quantity: '?'
attributes:
- name: unit
dtype: text
default_value: micrometers
doc: Measurement units for origin coordinates. The default value is 'micrometers'.
- neurodata_type_def: PlanarImagingSpace
neurodata_type_inc: ImagingSpace
doc: Metadata about the 2-dimensional slice of physical space that imaging data was recorded from.
datasets:
- name: grid_spacing
dtype: float64
dims:
- - x, y
shape:
- - 2
doc: Amount of space between pixels in the specified unit.
Specify 'z' only when imaging volume is a regular grid; otherwise only specify 'x' and 'y'.
See origin_coordinates to determine where the grid begins.
quantity: '?'
attributes:
- name: unit
dtype: text
default_value: micrometers
doc: Measurement units for grid spacing. The default value is 'micrometers'.
After doing some digging, I found that because ImagingSpec.origin_coordinates has an attribute unit and PlanarImagingSpace.grid_spacing also has an attribute unit, that when determining whether PlanarImagingSpace.grid_spacing.unit is inherited or not, HDMF says yes it is inherited because when ImagingSpec.origin_coordinates is inherited and it has an attribute with the same name, unit. That is not correct.
I have a fix.
Steps to Reproduce
Install ndx-microscopy linked above. Uncomment `unit` attribute spec on the `PlanarImagingSpace` spec. Instantiate a `PlanarImagingSpace` with `grid_spacing__unit="unit"`
What happened?
From https://github.com/catalystneuro/ndx-microscopy/pull/11#discussion_r1622645107
The relevant spec:
After doing some digging, I found that because
ImagingSpec.origin_coordinates
has an attributeunit
andPlanarImagingSpace.grid_spacing
also has an attributeunit
, that when determining whetherPlanarImagingSpace.grid_spacing.unit
is inherited or not, HDMF says yes it is inherited because whenImagingSpec.origin_coordinates
is inherited and it has an attribute with the same name,unit
. That is not correct.I have a fix.
Steps to Reproduce
Traceback
No response
Operating System
macOS
Python Executable
Conda
Python Version
3.12
Package Versions
No response