15#ifndef __igtlImageMessage2_h
16#define __igtlImageMessage2_h
25#define FRAGMENTED_PACK
55 virtual int PackBody() { AllocatePack();
return 1; };
153 int SetSubVolume(
int dimi,
int dimj,
int dimk,
int offi,
int offj,
int offk);
160 void GetSubVolume(
int &dimi,
int &dimj,
int &dimk,
int &offi,
int &offj,
int &offk);
258 return dimensions[0]*dimensions[1]*dimensions[2]*GetScalarSize()*numComponents;
272 return subDimensions[0]*subDimensions[1]*subDimensions[2]*GetScalarSize()*numComponents;
285#ifdef FRAGMENTED_PACK
312#ifdef FRAGMENTED_PACK
323#ifdef FRAGMENTED_PACK
336 int subDimensions[3];
364#ifdef FRAGMENTED_PACK
384 int ScalarSizeTable[12];
igtlNewMacro(igtl::GetImageMessage2)
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
igtlTypeMacro(igtl::GetImageMessage2, igtl::MessageBase)
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
unsigned char * m_SinglePack
A pointer to the serialized data (for backward compatibility with the conventional packing)
int m_SelfAllocatedImageHeader
A flag for the fragmented image pack (allocated by this class).
void SetScalarTypeToInt16()
Sets the image scalar type to 16-bit integer.
void SetScalarTypeToInt32()
Sets the image scalar type to 32-bit integer.
void GetSubVolume(int dim[3], int off[3])
Gets sub-volume dimensions and offset using arrays of the dimensions and the offset.
void SetEndian(int e)
Sets the Endianess of the image scalars. (default is ENDIAN_BIG)
int scalarType
A variable for the scalar type of the voxels.
int GetCoordinateSystem()
Returns coordinate system (COORDINATE_RAS or COORDINATE_LPS)
void SetNormals(float t[3], float s[3], float n[3])
Sets the orientation of the image by the normal vectors for the i, j and k indeces.
int m_SelfAllocatedImage
A flag for the fragmented image pack (allocated by this class).
int GetNumComponents()
Gets the number of components for each voxel.
int GetEndian()
Gets the Endianess of the image scalars.
void GetMatrix(Matrix4x4 &mat)
Gets the origin/orientation matrix.
int GetNumberOfPackFragments()
void SetScalarTypeToUint32()
Sets the image scalar type to unsigned 32-bit integer.
virtual void * GetScalarPointer()
Gets a pointer to the scalar data.
void GetNormals(float o[3][3])
void GetNormals(float t[3], float s[3], float n[3])
Gets the orientation of the image using the normal vectors for the i, j and k indeces.
void SetScalarTypeToInt8()
Sets the image scalar type to 8-bit integer.
void SetNumComponents(int num)
Sets the number of components for each voxel.
void SetSpacing(float s[3])
Sets spacings by an array of spacing values in i, j and k directions.
virtual void AllocateScalars()
void SetScalarTypeToUint16()
Sets the image scalar type to unsigned 16-bit integer.
void GetSpacing(float s[3])
Gets spacings using an array of spacing values in i, j and k directions.
unsigned char * m_Image
A pointer to the serialized image data.
void SetSpacing(float si, float sj, float sk)
Sets spacings by spacing values in i, j and k directions.
SmartPointer< const Self > ConstPointer
int GetPackFragmentSize(int id)
Gets the size of the specified fragment. (for fragmented pack support)
void GetOrigin(float &px, float &py, float &pz)
SmartPointer< Self > Pointer
int GetSubVolumeImageSize()
virtual void SetScalarPointer(void *p)
Sets the pointer to the scalar data (for fragmented pack support).
void SetOrigin(float p[3])
void SetScalarType(int t)
Sets the image scalar type.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
unsigned char * m_ImageHeader
A pointer to the serialized image header.
void GetSubVolume(int &dimi, int &dimj, int &dimk, int &offi, int &offj, int &offk)
int SetSubVolume(int dim[3], int off[3])
virtual void AllocatePack(int bodySize)
void SetScalarTypeToUint8()
Sets the image scalar type to unsigned 8-bit integer.
int GetScalarSize(int type)
Gets the size of the specified scalar type. (e.g. 1 byte for 8-bit integer)
int coordinate
A variable for the scalar type of the voxels.
int SetSubVolume(int dimi, int dimj, int dimk, int offi, int offj, int offk)
void GetDimensions(int &i, int &j, int &k)
Gets image dimensions as the numbers of pixels in i, j and k directions.
void SetNormals(float o[3][3])
virtual int GetBodyPackSize()
Gets the size of the serialized body.
void SetMatrix(Matrix4x4 &mat)
Sets the origin/orientation matrix.
void * GetPackFragmentPointer(int id)
Gets a pointer to the specified fragment of the packed data. (for fragmented pack support)
int numComponents
A variable for the number of components.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
void GetDimensions(int s[3])
Gets image dimensions as an array of the numbers of pixels in i, j and k directions.
int GetScalarType()
Gets the image scalar type.
void GetSpacing(float &si, float &sj, float &sk)
Gets spacings using spacing values in i, j and k directions.
int endian
A variable for the Endian of the scalar values in the image.
void * GetPackPointer()
Gets a pointer to the scalar data (for fragmented pack support).
void SetDimensions(int s[3])
void GetOrigin(float p[3])
void SetOrigin(float px, float py, float pz)
void SetCoordinateSystem(int c)
Sets coordinate system (COORDINATE_RAS or COORDINATE_LPS)
void SetDimensions(int i, int j, int k)
Implements transparent reference counting.
#define igtlTypeMacro(thisClass, superclass)
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...