Half-voxel shift with Nifti files
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 389
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 3
Description
Hi
I think that neuroglancer incorrectly induces a half voxel shift when loading nifti files.
The nifti format specifies that "The (x,y,z) coordinates refer to the CENTER of a voxel".
Neuroglancer assumes that they refer to the corner of a voxel and does not insert the appropriate half voxel shift to compensate for it.
(In contrast, it does insert a half voxel shift for OME-Zarrs: https://github.com/google/neuroglancer/blob/master/src/datasource/zarr/ome.ts#L244).
As a side note, it also differs from the spec in that it always uses the qform rather than selecting the most appropriate affine based on intent codes.
And finally, it's not in-spec, but most viewers assume that the spatial unit is "mm" when it is set to "unknown", whereas it seems that neuroglancer falls back to "meter" (?)
Thanks you for the great work with neuroglancer!
Yael
Contributor guide
Assessment
This issue has not been assessed yet.