vtk-dicom  0.8.17
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkNIFTIHeader Class Reference

Store NIfTI header information. More...

#include <vtkNIFTIHeader.h>

Inheritance diagram for vtkNIFTIHeader:
Inheritance graph
[legend]
Collaboration diagram for vtkNIFTIHeader:
Collaboration graph
[legend]

Public Types

enum  IntentCodeEnum {
  IntentNone = 0 , IntentCorrel = 2 , IntentTTest = 3 , IntentFTest = 4 ,
  IntentZScore = 5 , IntentChiSQ = 6 , IntentBeta = 7 , IntentBinom = 8 ,
  IntentGamma = 9 , IntentPoisson = 10 , IntentNormal = 11 , IntentFTestNonc = 12 ,
  IntentChiSQNonc = 13 , IntentLogistic = 14 , IntentLaplace = 15 , IntentUniform = 16 ,
  IntentTTestNonc = 17 , IntentWeibull = 18 , IntentChi = 19 , IntentInvGauss = 20 ,
  IntentExtVal = 21 , IntentPVal = 22 , IntentLogPVal = 23 , IntentLog10PVal = 24 ,
  IntentEstimate = 1001 , IntentLabel = 1002 , IntentNeuroName = 1003 , IntentGenMatrix = 1004 ,
  IntentSymMatrix = 1005 , IntentDispVect = 1006 , IntentVector = 1007 , IntentPointSet = 1008 ,
  IntentTriangle = 1009 , IntentQuaternion = 1010 , IntentDimless = 1011 , IntentTimeSeries = 2001 ,
  IntentNodeIndex = 2002 , IntentRGBVector = 2003 , IntentRGBAVector = 2004 , IntentShape = 2005
}
 NIFTI intent codes.
 
enum  XFormCodeEnum {
  XFormUnkown = 0 , XFormScannerAnat = 1 , XFormAlignedAnat = 2 , XFormTalairach = 3 ,
  XFormMNI152 = 4 , XFormTemplateOther = 5
}
 NIFTI transform codes.
 
enum  SliceCodeEnum {
  SliceUnknown = 0 , SliceSeqInc = 1 , SliceSeqDec = 2 , SliceAltInc = 3 ,
  SliceAltDec = 4 , SliceAltInc2 = 5 , SliceAltDec2 = 6
}
 NIFTI slice codes.
 
enum  UnitsXYZTEnum {
  UnitsUnknown = 0 , UnitsMeter = 1 , UnitsMM = 2 , UnitsMicron = 3 ,
  UnitsSpace = 7 , UnitsSec = 8 , UnitsMSec = 16 , UnitsUSec = 24 ,
  UnitsHz = 32 , UnitsPPM = 40 , UnitsRads = 48 , UnitsTime = 56
}
 NIFTI unit codes.
 
enum  DataTypeEnum {
  TypeUInt8 = 2 , TypeInt16 = 4 , TypeInt32 = 8 , TypeFloat32 = 16 ,
  TypeComplex64 = 32 , TypeFloat64 = 64 , TypeRGB24 = 128 , TypeInt8 = 256 ,
  TypeUInt16 = 512 , TypeUInt32 = 768 , TypeInt64 = 1024 , TypeUInt64 = 1280 ,
  TypeFloat128 = 1536 , TypeComplex128 = 1792 , TypeComplex256 = 2048 , TypeRGBA32 = 2304
}
 NIFTI data types. More...
 
enum  HeaderSizeEnum { Nifti1HeaderSize = 348 , Nifti2HeaderSize = 540 }
 NIFTI header sizes.
 
typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkNIFTIHeaderNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
 Print information about this object.
 
const char * GetMagic ()
 Get the magic number for the NIFTI file as a null-terminated string.
 
vtkTypeInt64 GetVoxOffset ()
 Get the offset to the pixel data within the file.
 
int GetDataType ()
 Get the data type.
 
int GetBitPix ()
 Get the number of bits per pixel.
 
vtkTypeInt64 GetDim (int i)
 Get the nth dimension of the data, where 1 is first dimension. More...
 
double GetPixDim (int i)
 Get the sample spacing in the nth dimension, 1 is first dimension. More...
 
virtual void SetIntentCode (int)
 Get the NIFTI intent code. More...
 
int GetIntentCode ()
 
void SetIntentName (const char *name)
 Get the intent name. This should match the intent code.
 
const char * GetIntentName ()
 
virtual void SetIntentP1 (double)
 Get one of the NIFTI intent parameters. More...
 
double GetIntentP1 ()
 
virtual void SetIntentP2 (double)
 
double GetIntentP2 ()
 
virtual void SetIntentP3 (double)
 
double GetIntentP3 ()
 
virtual void SetSclSlope (double)
 Get the scale and slope to apply to get real-valued data.
 
double GetSclSlope ()
 
virtual void SetSclInter (double)
 
double GetSclInter ()
 
virtual void SetCalMin (double)
 Get the calibrated range (cal_min, cal_max) of the data.
 
double GetCalMin ()
 
virtual void SetCalMax (double)
 
double GetCalMax ()
 
virtual void SetSliceDuration (double)
 Get the slice_duration and toffset from the header.
 
double GetSliceDuration ()
 
virtual void SetTOffset (double)
 
double GetTOffset ()
 
virtual void SetSliceStart (vtkTypeInt64)
 Get the slice range for the data.
 
vtkTypeInt64 GetSliceStart ()
 
virtual void SetSliceEnd (vtkTypeInt64)
 
vtkTypeInt64 GetSliceEnd ()
 
virtual void SetSliceCode (int)
 Get the slice code for the data.
 
int GetSliceCode ()
 
virtual void SetXYZTUnits (int)
 Get a bitfield that describes the units for the first 4 dims.
 
int GetXYZTUnits ()
 
virtual void SetDimInfo (int)
 Get a bitfield with extra information about the dimensions, it. More...
 
int GetDimInfo ()
 
void SetDescrip (const char *descrip)
 Get a null-terminated file descriptor, this usually gives the. More...
 
const char * GetDescrip ()
 
void SetAuxFile (const char *auxfile)
 Get an auxiliary file, e.g. a color table, that is associated. More...
 
const char * GetAuxFile ()
 
virtual void SetQFormCode (int)
 Get the QForm or SForm code.
 
int GetQFormCode ()
 
virtual void SetSFormCode (int)
 
int GetSFormCode ()
 
virtual void SetQuaternB (double)
 Get information about the quaternion transformation. Note that. More...
 
double GetQuaternB ()
 
virtual void SetQuaternC (double)
 
double GetQuaternC ()
 
virtual void SetQuaternD (double)
 
double GetQuaternD ()
 
virtual void SetQOffsetX (double)
 
double GetQOffsetX ()
 
virtual void SetQOffsetY (double)
 
double GetQOffsetY ()
 
virtual void SetQOffsetZ (double)
 
double GetQOffsetZ ()
 
virtual void SetSRowX (double, double, double, double)
 Get information about the matrix transformation. More...
 
virtual void SetSRowX (double[4])
 
virtual double * GetSRowX ()
 
virtual void GetSRowX (double &, double &, double &, double &)
 
virtual void GetSRowX (double[4])
 
virtual void SetSRowY (double, double, double, double)
 
virtual void SetSRowY (double[4])
 
virtual double * GetSRowY ()
 
virtual void GetSRowY (double &, double &, double &, double &)
 
virtual void GetSRowY (double[4])
 
virtual void SetSRowZ (double, double, double, double)
 
virtual void SetSRowZ (double[4])
 
virtual double * GetSRowZ ()
 
virtual void GetSRowZ (double &, double &, double &, double &)
 
virtual void GetSRowZ (double[4])
 
void Initialize ()
 Initialize the header to default values.
 
void DeepCopy (vtkNIFTIHeader *o)
 Make a copy of the header.
 
void SetHeader (const nifti_1_header *hdr)
 Set the values from an existing nifti struct, or vice-versa.
 
void GetHeader (nifti_1_header *hdr)
 
void SetHeader (const nifti_2_header *hdr)
 
void GetHeader (nifti_2_header *hdr)
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommand * GetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkNIFTIHeaderNew ()
 Static method for construction.
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkNIFTIHeaderSafeDownCast (vtkObjectBase *o)
 
static void ByteSwapHeader (nifti_1_header *hdr)
 Byte-swap the nifti header struct.
 
static void ByteSwapHeader (nifti_2_header *hdr)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
void SetStringValue (char *x, const char *y, size_t n)
 
- Protected Member Functions inherited from vtkObject
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

char Magic [12]
 
vtkTypeInt64 VoxOffset
 
int DataType
 
int BitPix
 
vtkTypeInt64 Dim [8]
 
double PixDim [8]
 
int IntentCode
 
char IntentName [18]
 
double IntentP1
 
double IntentP2
 
double IntentP3
 
double SclSlope
 
double SclInter
 
double CalMin
 
double CalMax
 
double SliceDuration
 
double TOffset
 
vtkTypeInt64 SliceStart
 
vtkTypeInt64 SliceEnd
 
int SliceCode
 
int XYZTUnits
 
int DimInfo
 
char Descrip [82]
 
char AuxFile [26]
 
int QFormCode
 
int SFormCode
 
double QuaternB
 
double QuaternC
 
double QuaternD
 
double QOffsetX
 
double QOffsetY
 
double QOffsetZ
 
double SRowX [4]
 
double SRowY [4]
 
double SRowZ [4]
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

Store NIfTI header information.

This class stores the header of a NIfTI file in a VTK-friendly format. By using this class, it is possible to specify the header information that will be stored in a file written by the vtkNIFTIWriter. Note that the SForm and QForm orientation information in this class will be ignored by the writer if an SForm and QForm have been explicitly set via the writer's SetSForm and SetQForm methods. Also note that all info like Dim, PixDim, DataType, etc. will be ignored by the writer because this information must instead be taken from the vtkImageData information. Finally, note that the vtkNIFTIWriter will ignore the Descrip field, since it has its own SetDescription method.

This class was contributed to VTK by the Calgary Image Processing and Analysis Centre (CIPAC).

See also
vtkNIFTIReader, vtkNIFTIWriter

Member Enumeration Documentation

◆ DataTypeEnum

NIFTI data types.

Types RGB24 and RGB32 are represented in VTK as a multi-component unsigned char image. Complex values are represented as two-component images. The NIFTI types Float128 and Complex256 are not supported.

Member Function Documentation

◆ GetDim()

vtkTypeInt64 vtkNIFTIHeader::GetDim ( int  i)
inline

Get the nth dimension of the data, where 1 is first dimension.

GetDim(0) returns the number of dimensions that are defined for the file.

◆ GetPixDim()

double vtkNIFTIHeader::GetPixDim ( int  i)
inline

Get the sample spacing in the nth dimension, 1 is first dimension.

If GetPixDim(0) is negative, then the quaternion for the qform describes the correct orientation only after the slice ordering has been reversed.

◆ IsA()

virtual vtkTypeBool vtkNIFTIHeader::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SetAuxFile()

void vtkNIFTIHeader::SetAuxFile ( const char *  auxfile)

Get an auxiliary file, e.g. a color table, that is associated.

with this data. The length of the filename must be a maximum of 24 characters, and it will be assumed to be in the same directory as the NIFTI file.

◆ SetDescrip()

void vtkNIFTIHeader::SetDescrip ( const char *  descrip)

Get a null-terminated file descriptor, this usually gives the.

name of the software that wrote the file. It will have a maximum length of 80 characters.

◆ SetDimInfo()

virtual void vtkNIFTIHeader::SetDimInfo ( int  )
virtual

Get a bitfield with extra information about the dimensions, it.

states which dimensions are the phase encode, frequency encode, and slice encode dimensions for MRI acquisitions.

◆ SetIntentCode()

virtual void vtkNIFTIHeader::SetIntentCode ( int  )
virtual

Get the NIFTI intent code.

This is an enumerated value in the NIFTI header that states what the data is intended to be used for.

◆ SetIntentP1()

virtual void vtkNIFTIHeader::SetIntentP1 ( double  )
virtual

Get one of the NIFTI intent parameters.

The definition of these parameters varies according to the IntentCode.

◆ SetQuaternB()

virtual void vtkNIFTIHeader::SetQuaternB ( double  )
virtual

Get information about the quaternion transformation. Note that.

Note that the vtkNIFTIWriter ignores this part of the header if a quaternion has been set via vtkNIFTIWriter::SetQFormMatrix().

◆ SetSRowX()

virtual void vtkNIFTIHeader::SetSRowX ( double  ,
double  ,
double  ,
double   
)
virtual

Get information about the matrix transformation.

Note that the vtkNIFTIWriter ignores this part of the header if a matrix has been set via vtkNIFTIWriter::SetSFormMatrix().


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