CustusX  22.04-rc5
An IGT application
cx::NIfTIReader Class Reference

Reader for NIfTI files. More...

#include <cxNIfTIReader.h>

Inheritance diagram for cx::NIfTIReader:
cx::FileReaderWriterImplService cx::FileReaderWriterService

Public Member Functions

 NIfTIReader (PatientModelServicePtr patientModelService)
 
virtual ~NIfTIReader ()
 
bool isNull ()
 
bool canRead (const QString &type, const QString &filename)
 
bool readInto (ImagePtr image, QString filename)
 
virtual bool readInto (DataPtr data, QString path)
 
QString canReadDataType () const
 
DataPtr read (const QString &uid, const QString &filename)
 
std::vector< DataPtrread (const QString &filename)
 
QString canWriteDataType () const
 
bool canWrite (const QString &type, const QString &filename) const
 
void write (DataPtr data, const QString &filename)
 
virtual vtkImageDataPtr loadVtkImageData (QString filename)
 
- Public Member Functions inherited from cx::FileReaderWriterImplService
 FileReaderWriterImplService (QString name, QString canReadDataType, QString canWriteDataType, QString fileSuffix, PatientModelServicePtr patientModelService)
 
virtual QString getName () const
 
virtual QString getFileSuffix () const
 
virtual vtkPolyDataPtr loadVtkPolyData (QString filename)
 
- Public Member Functions inherited from cx::FileReaderWriterService
virtual ~FileReaderWriterService ()
 

Additional Inherited Members

- Static Public Member Functions inherited from cx::FileReaderWriterService
static FileReaderWriterServicePtr getNullObject ()
 
- Protected Member Functions inherited from cx::FileReaderWriterImplService
bool canReadInternal (const QString &type, const QString &filename) const
 
bool canWriteInternal (const QString &type, const QString &filename) const
 
DataPtr createData (QString type, QString filename, QString name="") const
 

Detailed Description

Reader for NIfTI files.

Definition at line 24 of file cxNIfTIReader.h.

Constructor & Destructor Documentation

cx::NIfTIReader::NIfTIReader ( PatientModelServicePtr  patientModelService)

Definition at line 27 of file cxNIfTIReader.cpp.

cx::NIfTIReader::~NIfTIReader ( )
virtual

Definition at line 33 of file cxNIfTIReader.cpp.

Member Function Documentation

bool cx::NIfTIReader::canRead ( const QString &  type,
const QString &  filename 
)
virtual

Implements cx::FileReaderWriterService.

Definition at line 96 of file cxNIfTIReader.cpp.

QString cx::NIfTIReader::canReadDataType ( ) const
virtual

Implements cx::FileReaderWriterService.

Definition at line 91 of file cxNIfTIReader.cpp.

bool cx::NIfTIReader::canWrite ( const QString &  type,
const QString &  filename 
) const
virtual

Implements cx::FileReaderWriterService.

Definition at line 131 of file cxNIfTIReader.cpp.

QString cx::NIfTIReader::canWriteDataType ( ) const
virtual

Implements cx::FileReaderWriterService.

Definition at line 126 of file cxNIfTIReader.cpp.

bool cx::NIfTIReader::isNull ( )
virtual

Implements cx::FileReaderWriterService.

Definition at line 86 of file cxNIfTIReader.cpp.

vtkImageDataPtr cx::NIfTIReader::loadVtkImageData ( QString  filename)
virtual

https://nifti.nimh.nih.gov/nifti-1/documentation/faq#Q19 Q19. Why does NIfTI-1 allow for two coordinate systems (the qform and sform)? (Mark Jenkinson) The basic idea behind having two coordinate systems is to allow the image to store information about (1) the scanner coordinate system used in the acquisition of the volume (in the qform) and (2) the relationship to a standard coordinate system - e.g. MNI coordinates (in the sform).

The qform allows orientation information to be kept for alignment purposes without losing volumetric information, since the qform only stores a rigid-body transformation which preserves volume. On the other hand, the sform stores a general affine transformation which can map the image coordinates into a standard coordinate system, like Talairach or MNI, without the need to resample the image.

By having both coordinate systems, it is possible to keep the original data (without resampling), along with information on how it was acquired (qform) and how it relates to other images via a standard space (sform). This ability is advantageous for many analysis pipelines, and has previously required storing additional files along with the image files. By using NIfTI-1 this extra information can be kept in the image files themselves.

Note: the qform and sform also store information on whether the coordinate system is left-handed or right-handed (see Q15) and so when both are set they must be consistent, otherwise the handedness of the coordinate system (often used to distinguish left-right order) is unknown and the results of applying operations to such an image are unspecified.

Reimplemented from cx::FileReaderWriterImplService.

Definition at line 60 of file cxNIfTIReader.cpp.

DataPtr cx::NIfTIReader::read ( const QString &  uid,
const QString &  filename 
)
virtual

Implements cx::FileReaderWriterService.

Definition at line 101 of file cxNIfTIReader.cpp.

std::vector< DataPtr > cx::NIfTIReader::read ( const QString &  filename)
virtual

Implements cx::FileReaderWriterService.

Definition at line 108 of file cxNIfTIReader.cpp.

bool cx::NIfTIReader::readInto ( ImagePtr  image,
QString  filename 
)

Definition at line 38 of file cxNIfTIReader.cpp.

bool cx::NIfTIReader::readInto ( DataPtr  data,
QString  path 
)
virtual

Implements cx::FileReaderWriterService.

Definition at line 55 of file cxNIfTIReader.cpp.

void cx::NIfTIReader::write ( cx::DataPtr  data,
const QString &  filename 
)
virtual

Implements cx::FileReaderWriterService.

Definition at line 136 of file cxNIfTIReader.cpp.


The documentation for this class was generated from the following files: