|
| bool | load (const std::string &mhdFileName, bool strictSyntax=false, bool ignoreHalfPixelOffset=false) |
| | Load a MetaImage header.
|
| |
| bool | save (const std::string &mhdFileName) const |
| | Save a MetaImage header file.
|
| |
|
void | fromImageDescriptor (const ImageDescriptor &desc) |
| | Load values from ImageDescriptor.
|
| |
|
bool | fromSharedImageSet (const SharedImageSet &sis) |
| | Load values from SharedImageSet. Returns false on failure.
|
| |
|
void | fromFileName (const std::string &headerFileName, int nFiles=1) |
| | Load values based on the name + filesystem structure of the header file + number of slices .
|
| |
|
ImageDescriptor | createImageDescriptor () const |
| | Create an ImageDescriptor corresponding to this header.
|
| |
|
FileType | metaImageFileType () |
| | Getter and setter methods:
|
| |
|
void | setMetaImageFileType (FileType in) |
| |
|
std::vector< std::string > | rawFiles () |
| |
|
void | setRawFiles (std::vector< Filesystem::File >) |
| |
|
ByteOrder | msb () |
| |
|
void | setMsb (ByteOrder msb) |
| |
|
bool | compressed () |
| |
|
void | setCompressed (bool compressed) |
| |
|
Data::Modality | modality () |
| |
|
void | setModality (Data::Modality modality) |
| |
|
mat4 | matrix () |
| |
|
void | setMatrix (const mat4 matrix) |
| |
|
int | ndims () |
| |
|
bool | keepScaleAndOffset () |
| |
|
void | setKeepScaleAndOffset (bool keepScaleAndOffset) |
| |
|
PixelType | pixelType () |
| |
|
void | setPixelType (PixelType pixelType) |
| |
|
bool | elementByteOrderMSB () |
| |
|
double | imfusionElementShift () |
| |
|
double | imfusionElementScale () |
| |
|
|
std::vector< std::string > | m_rawFiles |
| | Raw image file name.
|
| |
|
FileType | m_metaImageFileType = FileType::MHD |
| | Whether this is a mhd, mha or multifile mhd file.
|
| |
|
int | m_frames = 1 |
| | Number of frames for 4D data.
|
| |
|
int | m_ndims = -1 |
| | Number of dimensions.
|
| |
|
int | m_elementNumberOfChannels = 1 |
| | Number of channels.
|
| |
|
std::vector< int > | m_dimSize |
| | How many elements per dimension.
|
| |
|
std::vector< double > | m_elementSpacing |
| | Spacing.
|
| |
|
ByteOrder | m_msb = ByteOrder::LittleEndian |
| | Byte order of image data.
|
| |
|
PixelType | m_pixelType = PixelType::UByte |
| |
|
size_t | m_comSize = 0 |
| | Size of the compressed data.
|
| |
|
int | m_offset = 0 |
| | Offset when loading MHA.
|
| |
|
bool | m_isMetric = false |
| |
|
mat4 | m_matrix = mat4::Identity() |
| | Transformation matrix.
|
| |
|
Data::Modality | m_modality = Data::NA |
| | Image modality.
|
| |
|
double | m_imfusionElementShift = 0.0 |
| | Shift parameter.
|
| |
|
double | m_imfusionElementScale = 1.0 |
| | Scale parameter.
|
| |
|
double | m_imfusionMetaImageVersion = -1 |
| | Version parameter, see currentImFusionMetaImageVersion.
|
| |
|
bool | m_keepScaleAndOffset = false |
| | Binary data does not have intensity scale+offset applied.
|
| |
|
bool | m_compressed = false |
| | Binary data is compressed.
|
| |
◆ ByteOrder
| Enumerator |
|---|
| BigEndian | the most significant byte (MSB) in a multi-byte structure is stored first
|
| LittleEndian | the least significant byte (LSB) in a multi-byte structure is stored first
|
◆ recognizedHeaderKeywords()
List of keywords of a MetaImage header that are read.
Other keywords may be ignored. This list is kept for reference only.
◆ load()
| bool load |
( |
const std::string & | mhdFileName, |
|
|
bool | strictSyntax = false, |
|
|
bool | ignoreHalfPixelOffset = false ) |
Load a MetaImage header.
- Parameters
-
| filename | The absolute path to the MetaImage file. The extension of the given filename, either '.mhd' or '.mha', determines the type of the MetaImage file. |
| strictSyntax | determines whether or not to fail when unexpected data is encountered (such as trailing non-whitespace characters after numbers). |
| ignoreHalfPixelOffset | should be set if no half-pixel offset to the Position/Orientation provided should be applied. Returns true on success. |
◆ save()
Save a MetaImage header file.
Automatically appends .mhd extension if not present. Automatically creates the directory the file is in if not present. Does not save intensity shift+scale parameters if m_keepShiftAndScale is not set. Removes half-pixel offset from matrix when saving Position/Orientation Returns true on success.
◆ loadSharedImageSet()
Load SharedImageSet content, return zero pointer on failure.
Multi-file 3D data is interpreted as one slice per file. Optionally the data will be prepared (i.e. normalized) after loading, and a custom derived data container instance will be used if provided.
- Parameters
-
◆ saveSharedImageSet()
Save selected SharedImageSet content (without header).
Location to save in is taken from m_rawFiles. If is.size() > 1, then multifile mode is forced, we do not currently support multi-frame single-file MetaImage files.
- Parameters
-
| unscaledImageBuffer | should point to the result of img->unscaled() if m_keepScaleAndOffset is false where img is the first selected image. |
The documentation for this class was generated from the following file: