Open
Description
Nifti1Header.get_xyzt_units
is entirely based on the bitfield as it is implemented in nifti1.h. Attempting to generalize it to Minc (#1098) requires reducing the available information, specifically raising a ValueError
if the spatial axes have different units.
I think it makes sense to keep this interface which will be mostly useful, but we could start by generalizing, e.g.,
class HasUnits:
def get_units(self)
...
And keep the old behavior:
def get_xyzt_units(self):
all_units = self.get_units()
spatial_units = ...
temporal_units = ...
if len(set(spatial_units)) > 1:
raise ValueError
if len(set(temporal_units)) > 1:
raise ValueError
return spatial_units[0], temporal_units[0]
OTOH, maybe with get_units()
, get_xyzt_units()
is redundant and can be deprecated.
Thoughts?
Metadata
Metadata
Assignees
Labels
No labels