Handling of nifti files
As mentioned in Image formats, there are different schemes to store medical data relative to the coordinate system and orientation of the scanner. As we follow the Nifti data structure in vicom, we are dependent on the scheme Nifti uses, which is RAS. The data + affine matrix will produce an image in the scanner coordinate system with a clearly defined position. However, multiple combinations of data and affine matrix can produce the same image in the scanner coordinate system. For example flipping of axes can be adjusted for in the affine. This is problematic when we want to compare images, as we cannot be sure that the data arrays (without the affine) are in the same orientation.
Therefore, we are doing internal validation checks to enforce the data to be strictly positive in the RAS directions. Hence you should always use our function to load nifti files and not the nibabel function.
!!! note
If you want to build a Volume object, it is generally recommended to use
DICOM files instead of Nifti files, as Nifti files do not contain any metadata
which may be needed for further processing.
!!! note
Calling the load_from_nifti() function will return a :code:Volume object by
default. Use load_from_nifti().to_nii() if you want a nibabel image.
::: vicom.nifti.load_from_nifti.load_volume_from_nifti options: show_root_heading: true
::: vicom.nifti.write_to_nifti.write_to_nifti options: show_root_heading: true