SLIMMER
Public Member Functions | Static Public Attributes | Protected Attributes
BasicHeader Class Reference

Medical Image Volume Info. More...

#include <BasicHeader.h>

Inheritance diagram for BasicHeader:
SimpleTField< T, TS > SimpleTField< float > SimpleTField< T > SimpleTField< T2 > Stack< T, TTransformType >

List of all members.

Public Member Functions

 BasicHeader (const unsigned int x=1, const unsigned int y=1, const unsigned int z=1, const unsigned int t=1)
 Default Constructor.
 BasicHeader (const BasicHeader &hd)
 Copy Constructor.
virtual ~BasicHeader ()
 Destructor (nothing to do!)
BasicHeaderoperator= (const BasicHeader &hd)
 Assignment operator.
double MinVal () const
 Return Minimum Voxel Value.
double MaxVal () const
 Return Maximum Voxel Value.
void SetMinVal (double val)
 Set Minimum Voxel Value.
void SetMaxVal (double val)
 Set Maximum Voxel Value.
int MemDataType () const
 Return Type Used in Memory.
int FileDataType () const
 Return Type Stored on Disk.
void SetMemDataType (int t)
 Set Memory Data Type (don't Use!: Set at Compile Time)
void SetFileDataType (int t)
 Set File Data Type.
char * FileDataTypeName (char *name) const
 Return a name for file data type.
unsigned int FileDataTypeSize ()
 Return the size for the file data type.
const float VoxSz (const int dim) const
 Voxel Size in mm.
void SetVoxSz (const int dim, const float sz)
 Set Voxel Size in mm.
const float VoxRes (const int dim) const
 Voxel Resolution in mm.
void SetVoxRes (const int dim, const float sz)
 Set Voxel Resolution in mm.
const float SampSz (const int dim) const
 Voxel Size in mm (Old: For Backward Compatibility)
void SetSampSz (const int dim, const float sz)
 Set Voxel Size in mm (Old: For Backward Compatibility)
const unsigned int nVox (const unsigned int dim) const
 Number of Voxels in Given Dimension.
void SetnVox (int dim, unsigned int sz)
 Set Number of Voxels in a given dimension.
float Fov (const int dim) const
 Return Effective Field of View.
void SetNmSamp (int dim, unsigned int sz)
 Set Number of Voxels in a given dimension (Old: to Support Earlier Code)
const unsigned int NmSamp (const int dim) const
 Number of Voxels in Given Dimension (Old: to Support Earlier Code)
const unsigned long int totVox () const
 Total Number of Voxels in Data Set.
const unsigned long int totSpaceVox () const
 Total Number of Spatial (3D) Voxels in Data Set.
const unsigned long int TotSamp () const
 Total Number of Voxels (Old Function: For Backward Compatibility)
void ReScaleSpatialVox (const float scale)
 Change Spatial Voxel Size.
void ReSizeVox (const float x, const float y, const float z)
 Change Spatial Voxel Sizes.
bool Timed ()
const void SetTimed (bool t)
 < Flag Indicating if slice timing stored
float SliceTime (const unsigned int slice, const unsigned int frame=0) const
void SetSliceTime (float v, const unsigned int slice, const unsigned int frame=0)
 Set Timing of a Given Slice.
void ResetSliceTimeByInterleaving (const unsigned int n_intlv=2)
 Reset slice timing to simulate interleaving.
void SetTimeSize (int s=-1)
 Set Time Size.
SimpleVTVec< float > SliceTime () const
 Return Slice Timing Vector.
int SameSize (const BasicHeader &src, const float tol=0.0001) const
 Test if Same number of Voxels AND Voxel Size.
int SameSpatialSize (const BasicHeader &src, const float tol=0.0001) const
 Test if Same number of Spatial Voxels AND Spatial Voxel Size.
int SameVox3D (const BasicHeader &src) const
 Test if Same number of Voxels in 3D.
int SameVox4D (const BasicHeader &src) const
 Test if Same number of Voxels in 4D.
float ScanRot (const unsigned int dim) const
 Return Scan Rotation Angle (0 to 2)
float ScanSkew (const int dim) const
 Return Scan Skew Angle (0 to 2)
int ScanReflect (const int dim) const
 Return Scan Reflection.
void SetScanRot (const int dim, const float ang)
void SetScanSkew (const int dim, const float ang)
void SetScanReflect (const int dim, const int flag)
int InImage (const unsigned int x=0, const unsigned int y=0, const unsigned int z=0, const unsigned int t=0) const
 Simple Bounds Check for given Voxel Coordinate.
template<typename TL >
SimpleTVec< float, 3 > mmLoc2VoxLoc (const SimpleTVec< TL, 3 > &mmLoc) const
 Map a Vector location from mm -> vox.
template<typename TL >
SimpleTVec< float, 3 > VoxLoc2mmLoc (const SimpleTVec< TL, 3 > &voxLoc) const
 Map a Vector location from vox -> mm.
template<typename TL >
SimpleTVec< float, 3 > VoxLoc2mmLoc (const TL x, const TL y, const TL z=0) const
 Map location from vox -> mm.
SimpleTVec< float, 4 > mmLoc2VoxLoc (const SimpleTVec< float, 4 > &mmLoc) const
 Map an Extended (Homogeneous Coordinate Transformation) Vector location from mm -> vox.
SimpleTVec< float, 4 > VoxLoc2mmLoc (const SimpleTVec< float, 4 > &voxLoc) const
 Map an Extended (Homogeneous Coordinate Transformation) Vector location from vox -> mm.
SimpleTVec< float, 4 > VoxLoc2mmLocHC (const SimpleTVec< float, 3 > &voxLoc) const
 Map an 3D Vector location from vox -> mm Extended (Homogeneous Coordinate Transformation) Location.
SimpleTMat< float, 4, 4 > vox2mmMat () const
 Return Homogeneous Transformation Matrix Mapping from vox to mm.
SimpleTMat< float, 4, 4 > mm2voxMat () const
 Return Homogeneous Transformation Matrix Mapping from mm to vox.
char * PatientName ()
 Return Patient Name if Known.
void SetPatientName (char *patname, int len)
 Set Patient Name.
char * FileName ()
 Return Current File Name Associated with this Image.
char * ShortFileName ()
 Return Current File Name (without path) Associated with this image.
void SetFileName (const char *patname)
 Set File Name Associated with this Image.
char * PatientID ()
 Return patient ID Information String.
void SetPatientID (const char *patid, int len)
 Set patient ID Information String.
char * AcqTime ()
 Return Acquisition Time String.
void SetAcqTime (const char *acqtime, int len)
 Set Acquisition Time String.
char * AcqDate ()
 Return Acquisition Date String.
void SetAcqDate (const char *acqdate, int len)
 Set Acquisition Date String.
char * RecDate ()
 Return Reconstruction Date String.
void SetRecDate (char *recdate, int len)
 Set Reconstruction Date String.
char * RecTime ()
 Return Reconstruction Time String.
void SetRecTime (const char *rectime, int len)
 Set Reconstruction Time String.
char * ScanHist ()
 Return Scan/Image Processing History String.
void Add2ScanHist (const char *str)
 Add to Scan/Image Processing History String.
void PrintNumVox (FILE *fp=stdout)
 Print Number of Voxels.
void PrintVoxSz (FILE *fp=stdout)
 Print Voxels Dimensions.

Static Public Attributes

static const char _versionID [] = "$Id: BasicHeader.h,v 1.40 2011/12/07 21:56:09 bicg Exp $"

Protected Attributes

double _minval
 Minimum Value in Dataset.
double _maxval
 Maximum Value in Dataset.
unsigned int _NmSamp [IMDATA_MAXDIM]
 Num. Voxels in each dimension.
float _SampSz [IMDATA_MAXDIM]
 Size of Voxels in mm in each dimension.
float _VoxRes [IMDATA_MAXDIM]
 Effective Voxel Resolution (FWHM) in mm in each dimension.
short _MemDataType
 Memory Data Type.
short _FileDataType
 File Data Type.
int _ScanReflect [3]
 Scan Reflections.
float _ScanRot [3]
 Scan Rotation Angles (deg)
float _ScanSkew [3]
 Scan Skewing Angles (deg)
char _PatName [48]
 Patient name if known.
char _PatId [48]
 patient ID number if known
char _AcqTime [16]
 Acqusition Time.
char _AcqDate [16]
 Acqusition Date.
char _RecTime [16]
 Reconstruction Time.
char _RecDate [16]
 Reconstruction Date.
char _FileName [BH_FILENAME_LEN]
 Current File Name on Disk.
char _ScanHist [BH_HIST_LEN]
 History of Processing/Acquisition.
SimpleVTVec< float > _sliceTime
 Store of Slice Timing Information in float vector.
bool _timed
 Flag to indicate timing is available.

Detailed Description

Medical Image Volume Info.

Contains Information associated with 3D/4D Spatial/Temporal Images

Class defining Basic Spatial Image Data header handles mm<->voxel mapping

Note: center of image volume is mm origin, this may be between two voxels or in the middle of a voxel, depending on the number of voxel in the volume

Also contains variables holding data assoicated with image (patient info/ acq date etc)

Author:
Colin Studholme 1997-2008
Id:
BasicHeader.h,v 1.40 2011/12/07 21:56:09 bicg Exp

Member Function Documentation

float BasicHeader::Fov ( const int  dim) const [inline]

Return Effective Field of View.

Return Field of View in mm

const void BasicHeader::SetTimed ( bool  t) [inline]

< Flag Indicating if slice timing stored

Set Slice Timing Flag

const unsigned long int BasicHeader::totSpaceVox ( ) const [inline]

Total Number of Spatial (3D) Voxels in Data Set.

< Total Number of Spatial Voxels

const unsigned long int BasicHeader::totVox ( ) const [inline]

Total Number of Voxels in Data Set.

< Total Number of Voxels

 All Classes Functions Variables Typedefs