⚡ Quick Operations (nii)

Fast, everyday NIfTI edits — the kind you would otherwise open a Python REPL for — available both as a Python API and as the nii shell command (installed as a pyproject.toml entry point, alongside niqc).

Where niqc answers “is this dataset trustworthy?”, nii changes volumes: it is the shell front-end for the geometric and conversion helpers.

Operations

Operation Python nii command
Rotate by 90° steps rotate_volume / _dataset nii rotate
Mirror along an axis flip_volume / _dataset nii flip
Crop to an explicit box crop_volume nii crop
Crop to the foreground box crop_to_content / _dataset nii crop-content
Linearly rescale intensities rescale_intensity / _dataset nii rescale
DICOM series → NIfTI dicom_to_nifti nii from-dicom
NIfTI → DICOM series nifti_to_dicom nii to-dicom
Render a montage PNG create_slice_montage nii preview

Geometry is preserved

Every geometric operation updates the affine in step with the data, so a flip or rotation never silently corrupts left/right or orientation metadata — a marker voxel keeps its world coordinate before and after. See the CLI reference for the shell interface.


Table of contents


This site uses Just the Docs, a documentation theme for Jekyll.