the interface for classes that support the various image formats. More...
#include "formats/list.h"
Public Member Functions | |
Base (const char *desc) | |
virtual | ~Base () |
virtual std::unique_ptr< ImageIO::Base > | read (Header &H) const =0 |
read image file(s) and fill the Image::Header H with the appropriate information. More... | |
virtual bool | check (Header &H, size_t num_axes) const =0 |
check whether the Image::Header H can be created using this handler. More... | |
virtual std::unique_ptr< ImageIO::Base > | create (Header &H) const =0 |
create the image corresponding to the Image::Header H . More... | |
Public Attributes | |
const char * | description |
a short human-readable description of the image format More... | |
the interface for classes that support the various image formats.
All image formats supported by MRtrix are handled by a class derived from the Formats::Base. An instance of each of these classes is added to the list in the file list.cpp.
|
pure virtual |
check whether the Image::Header H
can be created using this handler.
This function will check whether this handler can write images in the format suggested by the filename. It will then check whether the format can handle the number of dimensions requested, and modify the header appropriately if needed.
Implemented in MR::Formats::Pipe, MR::Formats::DICOM, MR::Formats::MRtrix, MR::Formats::MRtrix_GZ, MR::Formats::NIfTI1, MR::Formats::NIfTI2, MR::Formats::NIfTI1_GZ, MR::Formats::NIfTI2_GZ, MR::Formats::MRI, MR::Formats::XDS, MR::Formats::MGH, MR::Formats::MGZ, MR::Formats::PAR, and MR::Formats::MRtrix_sparse.
|
pure virtual |
create the image corresponding to the Image::Header H
.
This function will create images in the corresponding format, assuming the header has been validated using the check() function beforehand.
Implemented in MR::Formats::Pipe, MR::Formats::DICOM, MR::Formats::MRtrix, MR::Formats::MRtrix_GZ, MR::Formats::NIfTI1, MR::Formats::NIfTI2, MR::Formats::NIfTI1_GZ, MR::Formats::NIfTI2_GZ, MR::Formats::MRI, MR::Formats::XDS, MR::Formats::MGH, MR::Formats::MGZ, MR::Formats::PAR, and MR::Formats::MRtrix_sparse.
|
pure virtual |
read image file(s) and fill the Image::Header H
with the appropriate information.
This function will check whether this handler can read images in the format suggested by the filename. It will then attempt to read the corresponding image, and update the Image::Header H
with the relevant information.
H
with all the relevant information as read from the images before returning. Implemented in MR::Formats::Pipe, MR::Formats::DICOM, MR::Formats::MRtrix, MR::Formats::MRtrix_GZ, MR::Formats::NIfTI1, MR::Formats::NIfTI2, MR::Formats::NIfTI1_GZ, MR::Formats::NIfTI2_GZ, MR::Formats::MRI, MR::Formats::XDS, MR::Formats::MGH, MR::Formats::MGZ, MR::Formats::PAR, and MR::Formats::MRtrix_sparse.
const char* MR::Formats::Base::description |