Mercurial > hg > orthanc
comparison OrthancCppClient/Instance.h @ 593:9d2592c08919
documentation completed
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 04 Oct 2013 15:04:37 +0200 |
parents | eaca3d38b2aa |
children | 2d0a347e8cfc |
comparison
equal
deleted
inserted
replaced
592:c5ee586a0a08 | 593:9d2592c08919 |
---|---|
41 | 41 |
42 namespace OrthancClient | 42 namespace OrthancClient |
43 { | 43 { |
44 class OrthancConnection; | 44 class OrthancConnection; |
45 | 45 |
46 /** | |
47 * {summary}{Connection to an instance stored in %Orthanc.} | |
48 * {description}{This class encapsulates a connection to an image instance | |
49 * from a remote instance of %Orthanc.} | |
50 **/ | |
46 class LAAW_API Instance : public Orthanc::IDynamicObject | 51 class LAAW_API Instance : public Orthanc::IDynamicObject |
47 { | 52 { |
48 private: | 53 private: |
49 const OrthancConnection& connection_; | 54 const OrthancConnection& connection_; |
50 std::string id_; | 55 std::string id_; |
56 void DownloadImage(); | 61 void DownloadImage(); |
57 | 62 |
58 void DownloadDicom(); | 63 void DownloadDicom(); |
59 | 64 |
60 public: | 65 public: |
66 /** | |
67 * {summary}{Create a connection to some image instance.} | |
68 * {param}{connection The remote instance of %Orthanc.} | |
69 * {param}{id The %Orthanc identifier of the image instance.} | |
70 **/ | |
61 Instance(const OrthancConnection& connection, | 71 Instance(const OrthancConnection& connection, |
62 const char* id); | 72 const char* id); |
63 | 73 |
74 | |
75 /** | |
76 * {summary}{Get the %Orthanc identifier of this identifier.} | |
77 * {returns}{The identifier.} | |
78 **/ | |
64 const char* GetId() const | 79 const char* GetId() const |
65 { | 80 { |
66 return id_.c_str(); | 81 return id_.c_str(); |
67 } | 82 } |
68 | 83 |
84 | |
85 /** | |
86 * {summary}{Set the extraction mode for the 2D image corresponding to this instance.} | |
87 * {param}{mode The extraction mode.} | |
88 **/ | |
69 void SetImageExtractionMode(Orthanc::ImageExtractionMode mode); | 89 void SetImageExtractionMode(Orthanc::ImageExtractionMode mode); |
70 | 90 |
91 /** | |
92 * {summary}{Get the extraction mode for the 2D image corresponding to this instance.} | |
93 * {returns}{The extraction mode.} | |
94 **/ | |
71 Orthanc::ImageExtractionMode GetImageExtractionMode() const | 95 Orthanc::ImageExtractionMode GetImageExtractionMode() const |
72 { | 96 { |
73 return mode_; | 97 return mode_; |
74 } | 98 } |
75 | 99 |
100 | |
101 /** | |
102 * {summary}{Get the string value of some DICOM tag of this instance.} | |
103 * {param}{tag The name of the tag of interest.} | |
104 * {returns}{The value of the tag.} | |
105 **/ | |
76 const char* GetTagAsString(const char* tag) const; | 106 const char* GetTagAsString(const char* tag) const; |
77 | 107 |
108 /** | |
109 * {summary}{Get the floating point value that is stored in some DICOM tag of this instance.} | |
110 * {param}{tag The name of the tag of interest.} | |
111 * {returns}{The value of the tag.} | |
112 **/ | |
78 float GetTagAsFloat(const char* tag) const; | 113 float GetTagAsFloat(const char* tag) const; |
79 | 114 |
115 /** | |
116 * {summary}{Get the integer value that is stored in some DICOM tag of this instance.} | |
117 * {param}{tag The name of the tag of interest.} | |
118 * {returns}{The value of the tag.} | |
119 **/ | |
80 int32_t GetTagAsInt(const char* tag) const; | 120 int32_t GetTagAsInt(const char* tag) const; |
81 | 121 |
122 | |
123 /** | |
124 * {summary}{Get the width of the 2D image.} | |
125 * {description}{Get the width of the 2D image that is encoded by this DICOM instance.} | |
126 * {returns}{The width.} | |
127 **/ | |
82 uint32_t GetWidth(); | 128 uint32_t GetWidth(); |
83 | 129 |
130 /** | |
131 * {summary}{Get the height of the 2D image.} | |
132 * {description}{Get the height of the 2D image that is encoded by this DICOM instance.} | |
133 * {returns}{The height.} | |
134 **/ | |
84 uint32_t GetHeight(); | 135 uint32_t GetHeight(); |
85 | 136 |
137 /** | |
138 * {summary}{Get the number of bytes between two lines of the image (pitch).} | |
139 * {description}{Get the number of bytes between two lines of the image in the memory buffer returned by GetBuffer(). This value depends on the extraction mode for the image.} | |
140 * {returns}{The pitch.} | |
141 **/ | |
86 uint32_t GetPitch(); | 142 uint32_t GetPitch(); |
87 | 143 |
144 /** | |
145 * {summary}{Get the format of the pixels of the 2D image.} | |
146 * {description}{Return the memory layout that is used for the 2D image that is encoded by this DICOM instance. This value depends on the extraction mode for the image.} | |
147 * {returns}{The pixel format.} | |
148 **/ | |
88 Orthanc::PixelFormat GetPixelFormat(); | 149 Orthanc::PixelFormat GetPixelFormat(); |
89 | 150 |
151 /** | |
152 * {summary}{Access the memory buffer in which the raw pixels of the 2D image are stored.} | |
153 * {returns}{A pointer to the memory buffer.} | |
154 **/ | |
90 const void* GetBuffer(); | 155 const void* GetBuffer(); |
91 | 156 |
157 /** | |
158 * {summary}{Access the memory buffer in which the raw pixels of some line of the 2D image are stored.} | |
159 * {param}{y The line of interest.} | |
160 * {returns}{A pointer to the memory buffer.} | |
161 **/ | |
92 const void* GetBuffer(uint32_t y); | 162 const void* GetBuffer(uint32_t y); |
93 | 163 |
164 /** | |
165 * {summary}{Get the size of the DICOM file corresponding to this instance.} | |
166 * {returns}{The file size.} | |
167 **/ | |
168 const uint64_t GetDicomSize(); | |
169 | |
170 /** | |
171 * {summary}{Get a pointer to the content of the DICOM file corresponding to this instance.} | |
172 * {returns}{The DICOM file.} | |
173 **/ | |
174 const void* GetDicom(); | |
175 | |
176 /** | |
177 * {summary}{Discard the downloaded 2D image, so as to make room in memory.} | |
178 **/ | |
94 void DiscardImage(); | 179 void DiscardImage(); |
95 | 180 |
181 /** | |
182 * {summary}{Discard the downloaded DICOM file, so as to make room in memory.} | |
183 **/ | |
96 void DiscardDicom(); | 184 void DiscardDicom(); |
97 | |
98 const uint64_t GetDicomSize(); | |
99 | |
100 const void* GetDicom(); | |
101 | 185 |
102 LAAW_API_INTERNAL void SplitVectorOfFloats(std::vector<float>& target, | 186 LAAW_API_INTERNAL void SplitVectorOfFloats(std::vector<float>& target, |
103 const char* tag); | 187 const char* tag); |
104 }; | 188 }; |
105 } | 189 } |