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 
TimeStamp::Pointer m_TimeStamp
scan time
virtual int GetBodyPackSize()
Gets the size of the serialized body.
A class for the GET_IMGMETA message type.
const char * GetDeviceName()
Gets the device name (message name).
SmartPointer< Self > Pointer
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
const char * GetPatientID()
Gets the patient ID.
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...
SmartPointer< const Self > ConstPointer
const char * GetName()
Gets the image name/description.
const char * GetModality()
Gets the name of the image modality.
std::string m_Modality
modality name (<= 32 bytes)
std::string m_Name
name / description (<= 64 bytes)
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define IGTLCommon_EXPORT
std::string m_PatientID
patient ID (MRN etc.) (<= 64 bytes)
igtlUint8 m_ScalarType
scalar type. see scalar_type in IMAGE message
SmartPointer< const Self > ConstPointer
std::string m_PatientName
patient name (<= 64 bytes)
A class to manage meta data of images.
const char * GetPatientName()
Gets the patient name.
std::string m_DeviceName
device name to query the IMAGE and COLORT
SmartPointer< Self > Pointer
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
Base class for most igtl classes.
Definition: igtlObject.h:60
std::vector< ImageMetaElement::Pointer > m_ImageMetaList
A list of pointers to image meta data.

Generated at Sat Aug 22 2015 03:53:40 for OpenIGTLink by doxygen 1.8.9.1 written by Dimitri van Heesch, © 1997-2012