ITK
6.0.0
Insight Toolkit
|
#include <itkMRCHeaderObject.h>
This class is a light wrapper for a couple of plain old data structures, so that they can be utilized in a MetaDataDictionary.
The class is designed to be initialized from a chuck of bytes that are read in from a file. Verification is performed to ensure that the bytes appear to be the correct format for the headers.
The POD structures a publicly available without access methods.
This code was contributed in the Insight Journal paper: "A Streaming IO Base Class and Support for Streaming the MRC and VTK File Format" by Lowekamp B., Chen D. https://doi.org/10.54294/olkmog9
Definition at line 48 of file itkMRCHeaderObject.h.
Classes | |
struct | FeiExtendedHeader |
struct | Header |
Public Types | |
enum | { MRCHEADER_MODE_UINT8 = 0, MRCHEADER_MODE_INT8 = 0, MRCHEADER_MODE_IN16 = 1, MRCHEADER_MODE_FLOAT = 2, MRCHEADER_MODE_COMPLEX_INT16 = 3, MRCHEADER_MODE_COMPLEX_FLOAT = 4, MRCHEADER_MODE_UINT16 = 6, MRCHEADER_MODE_RGB_BYTE = 16 } |
enum | { MRCHEADER_MAP_X = 1, MRCHEADER_MAP_Y = 2, MRCHEADER_MAP_Z = 3 } |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = MRCHeaderObject |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Public Member Functions | |
void | DeepCopy (ConstPointer h) |
SizeValueType | GetExtendedHeaderSize () const |
const Header & | GetHeader () const |
SizeValueType | GetHeaderSize () const |
const char * | GetNameOfClass () const override |
bool | IsOriginalHeaderBigEndian () const |
bool | SetExtendedHeader (const void *buffer) |
bool | SetHeader (const Header *buffer) |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual Pointer | CreateAnother () const |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
virtual void | Register () const |
virtual void | SetReferenceCount (int) |
virtual void | UnRegister () const noexcept |
Static Public Member Functions | |
static Pointer | New () |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Public Attributes | |
Header | m_Header {} |
Protected Member Functions | |
MRCHeaderObject () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
void | swapHeader (bool bigEndian) |
~MRCHeaderObject () override | |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Attributes | |
bool | m_BigEndianHeader {} |
FeiExtendedHeader * | m_ExtendedFeiHeader { nullptr } |
void * | m_ExtendedHeader { nullptr } |
SizeValueType | m_ExtendedHeaderSize { 0 } |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
using itk::MRCHeaderObject::ConstPointer = SmartPointer<const Self> |
Definition at line 57 of file itkMRCHeaderObject.h.
Definition at line 56 of file itkMRCHeaderObject.h.
Standard class type aliases.
Definition at line 54 of file itkMRCHeaderObject.h.
Definition at line 55 of file itkMRCHeaderObject.h.
anonymous enum |
pixel type enumeration
Enumerator | |
---|---|
MRCHEADER_MODE_UINT8 | |
MRCHEADER_MODE_INT8 | |
MRCHEADER_MODE_IN16 | |
MRCHEADER_MODE_FLOAT | |
MRCHEADER_MODE_COMPLEX_INT16 | |
MRCHEADER_MODE_COMPLEX_FLOAT | |
MRCHEADER_MODE_UINT16 | |
MRCHEADER_MODE_RGB_BYTE |
Definition at line 220 of file itkMRCHeaderObject.h.
anonymous enum |
map enumeration
Enumerator | |
---|---|
MRCHEADER_MAP_X | |
MRCHEADER_MAP_Y | |
MRCHEADER_MAP_Z |
Definition at line 233 of file itkMRCHeaderObject.h.
|
protected |
|
overrideprotected |
void itk::MRCHeaderObject::DeepCopy | ( | ConstPointer | h | ) |
SizeValueType itk::MRCHeaderObject::GetExtendedHeaderSize | ( | ) | const |
the expected number of bytes in the extended header, this is only valid after a successful call to SetHeader.
const Header& itk::MRCHeaderObject::GetHeader | ( | ) | const |
|
inline |
the expected number of bytes in the header
Definition at line 285 of file itkMRCHeaderObject.h.
|
overridevirtual |
Reimplemented from itk::LightObject.
bool itk::MRCHeaderObject::IsOriginalHeaderBigEndian | ( | ) | const |
returns true if the original header from SetHeader was big endian.
|
static |
Method for creation through the object factory.
|
overrideprotectedvirtual |
Prints loads of information from the header
Reimplemented from itk::LightObject.
bool itk::MRCHeaderObject::SetExtendedHeader | ( | const void * | buffer | ) |
After SetHeader is called GetExtendedHeaderSize contains the expected size of the buffer argument. This buffer is expected to be the bytes which follow the header in the file.
The return value indicates if the extended header buffer is valid and known. If false is returned then extended header information is not available.
bool itk::MRCHeaderObject::SetHeader | ( | const Header * | buffer | ) |
buffer | is assumed to point to a 1024 block of memory which has the header |
The return value indicates if buffer appears valid. If false is returned then the header member variable is in an undefined state.
If the byte order of the header then byte swapping will be performed.
|
protected |
Methods to fix the order of a set header
|
private |
Definition at line 318 of file itkMRCHeaderObject.h.
|
private |
Definition at line 316 of file itkMRCHeaderObject.h.
|
private |
Definition at line 314 of file itkMRCHeaderObject.h.
|
private |
Definition at line 313 of file itkMRCHeaderObject.h.
Header itk::MRCHeaderObject::m_Header {} |
Public available data : FIXME : NO MEMBER VARIABLES SHOULD BE PUBLIC.
Definition at line 297 of file itkMRCHeaderObject.h.