Open MikeSchutzman opened 4 months ago
Thanks Michael, I am adding a small description here.
Nifti is the standard format for MRI data in neuroimaging research. It is a simple binary format made of a short binary header followed by the raster data stored in Fortran order (that is, "x" is the fastest dimension). Importantly, it stores a spatial transform that allows the data to be displayed in a well defined coordinte space where:
The binary file is generally further gzipped for lossless compression. As a single file format, nifti is not adapted to very large volumes, nor does it allow efficient random access to its voxels.
On the other hand, Zarr, and it microscopy-specific child OME-Zarr split very large arrays across many small chunks that are individually compressed. OME-Zarr further support storing the same volume at multiple dimensions, thereby enabling fast multi-resolution visualization. However, the current specification does not support spatial coordinate transforms, appart from canonical scales and translations.
We've proposed Nifti-Zarr as a lightwait addition to OME-Zarr that stores the binary nifti header within an OME-Zarr directory, thereby supporting the same kind of spatial transforms widely embraced by the neuroimaging community.
Neuroglancer is a web-based viewer for large remote files that supports both OME-Zarr and nifti files. This project aims to add support for the Nifti-Zarr format. This new reader will reuse routines from the Nifti and Zarr readers already present in neuroglancer and apply the correct nifti transform to the zarr array.
I have uploaded two nifti-zarr files to dandi. They can be accessed and loaded into neuroglancer with these URLs:
sub-I58_dwi_space-dwi_desc-rms_dwi.nii.zarr
sub-I58_dwi_space-dwi_desc-preproc_dwi.nii.zarr
You can see in the second link that:
The second visualization is currently achieved by modifying the layer's transform in the neuroglancer state, but we would like to achieve this natively by loading the file with a niftizarr://
protocol.
@MikeSchutzman
See specs here https://github.com/lincbrain/linc-docs/pull/6/commits/dd3411c15643df2662a26dee752a394dfc282872?short_path=4006ba0#diff-4006ba03245d22f869fb9a211dd809ff3a8c0a627e3a66e2c0791478371fe4cc