Default orientation affine matrix, with origin=(0,0,0) and spacing=(1,1,1):
- 48 possible orientations for 3d image
Key features, pros & cons:
- The engine behind ITK-SNAP
- Presents the most comprehensive formats support
- Originally written in C++ - wrapped with swig to python. Consequently, itk python code is unnatural/not pythonic and hard to understand
- Uses itk world coordinates for origin and directions. Default orientation: RAI
- Dicom file: can save only UChar - unsigned int 8, good for segmentations. int16/float are not supported
- Derived: SimpleITK (sitk), allows saving dicom folder
- Pythonic nifti package
- Contains reorientation handling
- Packs metadata into affine matrix
- Uses nifti world coordinates for affine and orientation. Default orientation: RAS+ = LPI
- Pythonic dicom package
- Relatively easy access to tags
- Supports modifying dicom single file pixel data and saving it - dicom2dicom
- No reorientation support. Can use nibabel: ornt_transform and apply_orientation. Get original orientation with itk
- Derived: dicom_numpy for combining slices - dicom folder, high level
- Nifti segmentation:
- itk
- nib
- Nifti image (dense):
- nib
- itk
input/output | nifti | dicom folder | dicom file |
---|---|---|---|
nifti | v | v | v |
dicom folder | v | v | v |
dicom file | v | v | v |
IO engine | ITK | NiBabel | Pydicom |
---|---|---|---|
nifti support | v | v | x |
dicom support | v | x | v |
single dicom file reader | v | x | v |
single dicom file writer | v | x | v |
reorientation | v | v | x |
metadata | v | v | v |
saving dicom int16 | x | v - with template | |
saving dicom uint8 | v | x | |
pythonic | x | v | v |
high level | x | v | x |
- (add dataset sources)
Build the whl file with the following command (in the cmd/terminal):
(<env-name>) C:\...\medio>python setup.py sdist bdist_wheel
Make sure you are in the project's root - where the setup.py file is located.