![]() |
ImFusion SDK 4.3
|
#include <ImFusion/IO/NiftiIO.h>
Class for reading and writing Nifti images. More...
Class for reading and writing Nifti images.
Nifti image files have one of two extensions, .nii or .nii.gz. The file is designed to hold a time series of 3D images. For this reason this class loads the image data into a SharedImageSet, even though in many cases there is only one 3D image stored in the file.
NiftiIO class reads and writes the image data as it is stored on disc, i.e. in LPS coordinates, so no tranformation is applied to to the matrix of the SharedImageSet. The NiftiIoAlgorithm on the other hand does transform the matrix so that the Nifti files loaded in the ImFusion Suite appear properly. For more details on coordinate systems and the Nifti file format see the following links: https://www.slicer.org/wiki/Coordinate_systems https://brainder.org/2012/09/23/the-nifti-file-format/ Static Public Member Functions | |
| static std::unique_ptr< SharedImageSet > | readImage (const std::string &filename, Progress *progress=nullptr, bool keepRasCoordinates=false) |
| Reads a Nifti file into a SharedImageSet. | |
| static bool | writeImage (const std::string &filename, const SharedImageSet &sis, bool convertToRasCoordinates=true) |
| Writes a SharedImageSet as a Nifti file. | |
|
static |
Reads a Nifti file into a SharedImageSet.
If the sform affine transformation, that is used, otherwise the qform rigid transform is used. cf. https://brainder.org/2012/09/23/the-nifti-file-format/ (section on 'Orientation information') for more details
| keepRasCoordinates | Flag whether to keep the image in the Nifti RAS coordinate system or transform to LPS used by ImFusion |
|
static |
Writes a SharedImageSet as a Nifti file.
The given filename must have extension .nii or .nii.gz. The SharedImageSet's matrix is set as the sform affine transformation, and the rotation and translation are extracted and set asthe qform rigid transform. cf. https://brainder.org/2012/09/23/the-nifti-file-format/ (section on 'Orientation information') for more details
| convertToRasCoordinates | Flag whether to keep the image in the ImFusion LPS coordinate system or transform to RAS |