Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlImageMetaMessage.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: The OpenIGTLink Library
4 Language: C++
5 Web page: http://openigtlink.org/
6
7 Copyright (c) Insight Software Consortium. All rights reserved.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
12
13=========================================================================*/
14
15#ifndef __igtlImageMetaMessage_h
16#define __igtlImageMetaMessage_h
17
18#include <vector>
19#include <string>
20
21#include "igtlObject.h"
22#include "igtlMath.h"
23#include "igtlMessageBase.h"
24#include "igtlTypes.h"
25
26#include "igtlImageMessage.h"
27
28namespace igtl
29{
30
33{
34public:
39
42
43public:
44
46 int SetName(const char* name);
47
49 const char* GetName() { return this->m_Name.c_str(); };
50
53 int SetDeviceName(const char* devname);
54
56 const char* GetDeviceName() { return this->m_DeviceName.c_str(); };
57
60 int SetModality(const char* modality);
61
63 const char* GetModality() { return this->m_Modality.c_str(); };
64
66 int SetPatientName(const char* patname);
67
69 const char* GetPatientName() { return this->m_PatientName.c_str(); };
70
72 int SetPatientID(const char* patid);
73
75 const char* GetPatientID() { return this->m_PatientID.c_str(); }
76
79
82
85 void SetSize(igtlUint16 size[3]);
86
88 void SetSize(igtlUint16 si, igtlUint16 sj, igtlUint16 sk);
89
92 void GetSize(igtlUint16* size);
93
95 void GetSize(igtlUint16& si, igtlUint16& sj, igtlUint16& sk);
96
98 void SetScalarType(igtlUint8 type);
99
101 igtlUint8 GetScalarType();
102
103protected:
106
107protected:
108
110 std::string m_Name;
111
113 std::string m_DeviceName;
114
116 std::string m_Modality;
117
119 std::string m_PatientName;
120
122 std::string m_PatientID;
123
126
128 igtlUint16 m_Size[3];
129
131 igtlUint8 m_ScalarType;
132
133};
134
135
138{
139public:
144
147
148protected:
149 GetImageMetaMessage() : MessageBase() { this->m_SendMessageType = "GET_IMGMETA"; };
151protected:
152 virtual int CalculateContentBufferSize() { return 0; };
153 virtual int PackContent() { AllocateBuffer(); return 1; };
154 virtual int UnpackContent() { return 1; };
155};
156
157
204
205
206} // namespace igtl
207
208#endif // _igtlImageMetaMessage_h
A class for the GET_IMGMETA message type.
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
igtlTypeMacro(igtl::GetImageMetaMessage, igtl::MessageBase)
SmartPointer< const Self > ConstPointer
igtlNewMacro(igtl::GetImageMetaMessage)
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
A class to manage meta data of images.
const char * GetDeviceName()
Gets the device name (message name).
std::string m_PatientName
patient name (<= 64 bytes)
int SetPatientID(const char *patid)
Sets the patient ID. The string 'patid' must not exceed 64 characters.
const char * GetModality()
Gets the name of the image modality.
const char * GetPatientID()
Gets the patient ID.
int SetPatientName(const char *patname)
Sets the patient name. The string 'patname' must not exceed 64 characters.
void SetScalarType(igtlUint8 type)
Sets the scalar type of the image.
TimeStamp::Pointer m_TimeStamp
scan time
void SetSize(igtlUint16 si, igtlUint16 sj, igtlUint16 sk)
Sets the size of the image by the numbers of voxels in i, j, and k directions.
void GetSize(igtlUint16 &si, igtlUint16 &sj, igtlUint16 &sk)
Gets the size of the image by the numbers of voxels in i, j, and k directions.
std::string m_PatientID
patient ID (MRN etc.) (<= 64 bytes)
const char * GetPatientName()
Gets the patient name.
igtlNewMacro(igtl::ImageMetaElement)
int SetModality(const char *modality)
igtlUint8 m_ScalarType
scalar type. see scalar_type in IMAGE message
void SetSize(igtlUint16 size[3])
int SetDeviceName(const char *devname)
std::string m_DeviceName
device name to query the IMAGE and COLORT
std::string m_Modality
modality name (<= 32 bytes)
void SetTimeStamp(igtl::TimeStamp::Pointer &time)
Sets the scan time for the image.
igtlTypeMacro(igtl::ImageMetaElement, igtl::Object)
void GetTimeStamp(igtl::TimeStamp::Pointer &time)
Gets the scan time for the image.
void GetSize(igtlUint16 *size)
const char * GetName()
Gets the image name/description.
int SetName(const char *name)
Sets the image name/description. The string 'name' must not exceed 64 characters.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
std::string m_Name
name / description (<= 64 bytes)
igtlUint8 GetScalarType()
Gets the scalar type of the image.
igtlTypeMacro(igtl::ImageMetaMessage, igtl::MessageBase)
int AddImageMetaElement(ImageMetaElement::Pointer &elem)
virtual int PackContent()
Packs (serialize) the content. Must be implemented in all child classes.
virtual int CalculateContentBufferSize()
Gets the size of the serialized content.
int GetNumberOfImageMetaElement()
Gets the number of the image meta elements in the list.
virtual int UnpackContent()
Unpacks (deserialize) the content. Must be implemented in all child classes.
SmartPointer< const Self > ConstPointer
std::vector< ImageMetaElement::Pointer > m_ImageMetaList
A list of pointers to image meta data.
SmartPointer< Self > Pointer
void ClearImageMetaElement()
Clears the all image meta elements in the list.
igtlNewMacro(igtl::ImageMetaMessage)
void GetImageMetaElement(int index, ImageMetaElement::Pointer &elem)
Gets the image meta data specified by the index.
Base class for most igtl classes.
Definition igtlObject.h:61
Implements transparent reference counting.
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012