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 
28 namespace igtl
29 {
30 
33 {
34 public:
36  typedef Object Superclass;
39 
42 
43 public:
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 
78  void SetTimeStamp(igtl::TimeStamp::Pointer& time);
79 
81  void GetTimeStamp(igtl::TimeStamp::Pointer& time);
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 
103 protected:
105  ~ImageMetaElement();
106 
107 protected:
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 {
139 public:
144 
147 
148 protected:
149  GetImageMetaMessage() : MessageBase() { this->m_DefaultBodyType = "GET_IMGMETA"; };
151 protected:
152  virtual int GetBodyPackSize() { return 0; };
153  virtual int PackBody() { AllocatePack(); return 1; };
154  virtual int UnpackBody() { return 1; };
155 };
156 
157 
164 {
165 public:
170 
173 
174 public:
175 
178  int AddImageMetaElement(ImageMetaElement::Pointer& elem);
179 
181  void ClearImageMetaElement();
182 
184  int GetNumberOfImageMetaElement();
185 
187  void GetImageMetaElement(int index, ImageMetaElement::Pointer& elem);
188 
189 
190 protected:
192  ~ImageMetaMessage();
193 
194 protected:
195 
196  virtual int GetBodyPackSize();
197  virtual int PackBody();
198  virtual int UnpackBody();
199 
201  std::vector<ImageMetaElement::Pointer> m_ImageMetaList;
202 
203 };
204 
205 
206 } // namespace igtl
207 
208 #endif // _igtlImageMetaMessage_h
209 
210 
211 
igtl::GetImageMetaMessage::GetImageMetaMessage
GetImageMetaMessage()
Definition: igtlImageMetaMessage.h:149
igtl::ImageMetaMessage::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlImageMetaMessage.h:169
igtlMessageBase.h
igtl::ImageMetaElement::m_ScalarType
igtlUint8 m_ScalarType
scalar type. see scalar_type in IMAGE message
Definition: igtlImageMetaMessage.h:131
igtl::ImageMetaMessage::Pointer
SmartPointer< Self > Pointer
Definition: igtlImageMetaMessage.h:168
igtlNewMacro
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
igtl::GetImageMetaMessage::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlImageMetaMessage.h:143
igtl::ImageMetaElement::GetPatientID
const char * GetPatientID()
Gets the patient ID.
Definition: igtlImageMetaMessage.h:75
igtlImageMessage.h
igtl::ImageMetaElement::GetModality
const char * GetModality()
Gets the name of the image modality.
Definition: igtlImageMetaMessage.h:63
igtlMath.h
igtl::ImageMetaElement::ConstPointer
SmartPointer< const Self > ConstPointer
Definition: igtlImageMetaMessage.h:38
igtl::GetImageMetaMessage::Self
GetImageMetaMessage Self
Definition: igtlImageMetaMessage.h:140
igtl::ImageMetaElement::Superclass
Object Superclass
Definition: igtlImageMetaMessage.h:36
igtl::ImageMetaMessage
Definition: igtlImageMetaMessage.h:163
igtl::MessageBase
Definition: igtlMessageBase.h:55
igtl::ImageMetaElement::GetDeviceName
const char * GetDeviceName()
Gets the device name (message name).
Definition: igtlImageMetaMessage.h:56
igtl::GetImageMetaMessage::UnpackBody
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
Definition: igtlImageMetaMessage.h:154
igtl::Object
Base class for most igtl classes.
Definition: igtlObject.h:60
igtl::ImageMetaElement::Pointer
SmartPointer< Self > Pointer
Definition: igtlImageMetaMessage.h:37
igtl::ImageMetaElement::GetPatientName
const char * GetPatientName()
Gets the patient name.
Definition: igtlImageMetaMessage.h:69
igtl::ImageMetaMessage::m_ImageMetaList
std::vector< ImageMetaElement::Pointer > m_ImageMetaList
A list of pointers to image meta data.
Definition: igtlImageMetaMessage.h:201
igtl::GetImageMetaMessage::Superclass
MessageBase Superclass
Definition: igtlImageMetaMessage.h:141
igtl
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
Definition: igtlBindMessage.h:25
IGTLCommon_EXPORT
#define IGTLCommon_EXPORT
Definition: igtlWin32Header.h:151
igtl::GetImageMetaMessage::~GetImageMetaMessage
~GetImageMetaMessage()
Definition: igtlImageMetaMessage.h:150
igtl::GetImageMetaMessage::Pointer
SmartPointer< Self > Pointer
Definition: igtlImageMetaMessage.h:142
igtl::ImageMetaElement::m_Name
std::string m_Name
name / description (<= 64 bytes)
Definition: igtlImageMetaMessage.h:110
igtl::ImageMetaElement::m_TimeStamp
TimeStamp::Pointer m_TimeStamp
scan time
Definition: igtlImageMetaMessage.h:125
igtl::ImageMetaMessage::Superclass
MessageBase Superclass
Definition: igtlImageMetaMessage.h:167
igtl::ImageMetaElement::Self
ImageMetaElement Self
Definition: igtlImageMetaMessage.h:35
igtl::ImageMetaElement::GetName
const char * GetName()
Gets the image name/description.
Definition: igtlImageMetaMessage.h:49
igtl::ImageMetaMessage::Self
ImageMetaMessage Self
Definition: igtlImageMetaMessage.h:166
igtl::GetImageMetaMessage::PackBody
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
Definition: igtlImageMetaMessage.h:153
igtl::GetImageMetaMessage
A class for the GET_IMGMETA message type.
Definition: igtlImageMetaMessage.h:137
igtl::ImageMetaElement::m_Modality
std::string m_Modality
modality name (<= 32 bytes)
Definition: igtlImageMetaMessage.h:116
igtl::ImageMetaElement::m_DeviceName
std::string m_DeviceName
device name to query the IMAGE and COLORT
Definition: igtlImageMetaMessage.h:113
igtl::SmartPointer< Self >
igtlTypeMacro
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
igtlObject.h
igtl::GetImageMetaMessage::GetBodyPackSize
virtual int GetBodyPackSize()
Gets the size of the serialized body.
Definition: igtlImageMetaMessage.h:152
igtl::ImageMetaElement::m_PatientID
std::string m_PatientID
patient ID (MRN etc.) (<= 64 bytes)
Definition: igtlImageMetaMessage.h:122
igtlTypes.h
igtl::ImageMetaElement
A class to manage meta data of images.
Definition: igtlImageMetaMessage.h:32
igtl::ImageMetaElement::m_PatientName
std::string m_PatientName
patient name (<= 64 bytes)
Definition: igtlImageMetaMessage.h:119

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