Skip to content

brainhops.io.common

Format-specific machinery shared by the image and transformation readers.

Each subpackage holds what the image readers (brainhops.io.images) and the transformation readers (brainhops.io.transformations) of one file format have in common -- its parser, header, and geometry conventions:

  • afni: AFNI .HEAD/.BRIK datasets;
  • analyze: Analyze 7.5 .hdr/.img pairs (needs nibabel);
  • bdv: BigDataViewer and BigStitcher datasets, an XML file and an HDF5 file (the images need h5py);
  • freesurfer: the volume geometry shared by every FreeSurfer format;
  • hdf5: formats stored in HDF5 files (needs h5py);
  • mgh: FreeSurfer MGH/MGZ volumes (needs nibabel);
  • minc: MINC1 and MINC2 volumes (needs nibabel, and h5py for MINC2);
  • mrtrix: MRtrix .mif/.mih images;
  • nifti: NIfTI-1 and NIfTI-2 files (needs nibabel);
  • nrrd: NRRD .nrrd/.nhdr files;
  • zarr: Zarr stores (needs abczarr and one of its drivers).

None of them is imported here: a format whose optional dependencies are missing must not break brainhops.io, so each one is imported by the readers that need it, and only when those dependencies are installed.