15 #ifndef __igtlImageMessage2_h 16 #define __igtlImageMessage2_h 25 #define FRAGMENTED_PACK 55 virtual int PackBody() { AllocatePack();
return 1; };
129 void SetDimensions(
int s[3]);
134 void SetDimensions(
int i,
int j,
int k);
137 void GetDimensions(
int s[3]);
140 void GetDimensions(
int &i,
int &j,
int &k);
146 int SetSubVolume(
int dim[3],
int off[3]);
153 int SetSubVolume(
int dimi,
int dimj,
int dimk,
int offi,
int offj,
int offk);
156 void GetSubVolume(
int dim[3],
int off[3]);
160 void GetSubVolume(
int &dimi,
int &dimj,
int &dimk,
int &offi,
int &offj,
int &offk);
163 void SetSpacing(
float s[3]);
166 void SetSpacing(
float si,
float sj,
float sk);
169 void GetSpacing(
float s[3]);
172 void GetSpacing(
float &si,
float &sj,
float &sk);
176 void SetOrigin(
float p[3]);
180 void SetOrigin(
float px,
float py,
float pz);
184 void GetOrigin(
float p[3]);
188 void GetOrigin(
float &px,
float &py,
float &pz);
192 void SetNormals(
float o[3][3]);
195 void SetNormals(
float t[3],
float s[3],
float n[3]);
199 void GetNormals(
float o[3][3]);
202 void GetNormals(
float t[3],
float s[3],
float n[3]);
205 void SetNumComponents(
int num);
208 int GetNumComponents();
258 return dimensions[0]*dimensions[1]*dimensions[2]*GetScalarSize()*numComponents;
272 return subDimensions[0]*subDimensions[1]*subDimensions[2]*GetScalarSize()*numComponents;
280 virtual void AllocateScalars();
283 virtual void* GetScalarPointer();
285 #ifdef FRAGMENTED_PACK 286 virtual void SetScalarPointer(
void * p);
290 void* GetPackPointer();
297 void* GetPackFragmentPointer(
int id);
300 int GetPackFragmentSize(
int id);
301 #endif // FRAGMENTED_PACK 310 virtual int GetBodyPackSize();
312 #ifdef FRAGMENTED_PACK 318 #endif //FRAGMENTED_PACK 320 virtual int PackBody();
321 virtual int UnpackBody();
323 #ifdef FRAGMENTED_PACK 324 virtual void AllocatePack(
int bodySize);
327 #endif //FRAGMENTED_PACK 336 int subDimensions[3];
364 #ifdef FRAGMENTED_PACK 365 unsigned char* m_SinglePack;
384 int ScalarSizeTable[12];
390 #endif // _igtlImageMessage2_h void SetScalarTypeToUint8()
Sets the image scalar type to unsigned 8-bit integer.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
#define igtlTypeMacro(thisClass, superclass)
int GetEndian()
Gets the Endianess of the image scalars.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
void SetScalarTypeToInt32()
Sets the image scalar type to 32-bit integer.
int GetScalarType()
Gets the image scalar type.
int m_SelfAllocatedImageHeader
A flag for the fragmented image pack (allocated by this class).
int GetNumberOfPackFragments()
unsigned char * m_Image
A pointer to the serialized image data.
int GetScalarSize(int type)
Gets the size of the specified scalar type. (e.g. 1 byte for 8-bit integer)
void SetScalarTypeToUint32()
Sets the image scalar type to unsigned 32-bit integer.
SmartPointer< Self > Pointer
int GetSubVolumeImageSize()
SmartPointer< const Self > ConstPointer
void SetScalarTypeToInt16()
Sets the image scalar type to 16-bit integer.
void SetEndian(int e)
Sets the Endianess of the image scalars. (default is ENDIAN_BIG)
SmartPointer< Self > Pointer
int GetCoordinateSystem()
Returns coordinate system (COORDINATE_RAS or COORDINATE_LPS)
int coordinate
A variable for the scalar type of the voxels.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
SmartPointer< const Self > ConstPointer
void SetScalarTypeToInt8()
Sets the image scalar type to 8-bit integer.
void SetScalarTypeToUint16()
Sets the image scalar type to unsigned 16-bit integer.
int scalarType
A variable for the scalar type of the voxels.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
void SetCoordinateSystem(int c)
Sets coordinate system (COORDINATE_RAS or COORDINATE_LPS)
unsigned char * m_ImageHeader
A pointer to the serialized image header.
int endian
A variable for the Endian of the scalar values in the image.
int numComponents
A variable for the number of components.
int m_SelfAllocatedImage
A flag for the fragmented image pack (allocated by this class).
void SetScalarType(int t)
Sets the image scalar type.