VTK
vtkMedicalImageProperties.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMedicalImageProperties.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef __vtkMedicalImageProperties_h
27 #define __vtkMedicalImageProperties_h
28 
29 #include "vtkObject.h"
30 
31 class vtkMedicalImagePropertiesInternals;
32 
34 {
35 public:
38  void PrintSelf(ostream& os, vtkIndent indent);
39 
41  virtual void Clear();
42 
44 
45  vtkSetStringMacro(PatientName);
46  vtkGetStringMacro(PatientName);
48 
50 
51  vtkSetStringMacro(PatientID);
52  vtkGetStringMacro(PatientID);
54 
56 
59  vtkSetStringMacro(PatientAge);
60  vtkGetStringMacro(PatientAge);
62 
67  static int GetAgeAsFields(const char *age, int &year, int &month, int &week, int &day);
68 
69  // For Tcl:
70  // From C++ use GetPatientAge + GetAgeAsField
71  // Those function parse a DICOM string, and return the value of the number
72  // expressed this is either expressed in year, month or days. Thus if a
73  // string is expressed in years
74  // GetPatientAgeDay/GetPatientAgeWeek/GetPatientAgeMonth will return 0
75  int GetPatientAgeYear();
76  int GetPatientAgeMonth();
77  int GetPatientAgeWeek();
78  int GetPatientAgeDay();
79 
81 
82  vtkSetStringMacro(PatientSex);
83  vtkGetStringMacro(PatientSex);
85 
87 
89  vtkSetStringMacro(PatientBirthDate);
90  vtkGetStringMacro(PatientBirthDate);
92 
93  // For Tcl:
94  // From C++ use GetPatientBirthDate + GetDateAsFields
95  int GetPatientBirthDateYear();
96  int GetPatientBirthDateMonth();
97  int GetPatientBirthDateDay();
98 
100 
101  vtkSetStringMacro(StudyDate);
102  vtkGetStringMacro(StudyDate);
104 
106 
108  vtkSetStringMacro(AcquisitionDate);
109  vtkGetStringMacro(AcquisitionDate);
111 
112  // For Tcl:
113  // From C++ use GetAcquisitionDate + GetDateAsFields
114  int GetAcquisitionDateYear();
115  int GetAcquisitionDateMonth();
116  int GetAcquisitionDateDay();
117 
119 
121  vtkSetStringMacro(StudyTime);
122  vtkGetStringMacro(StudyTime);
124 
126 
129  vtkSetStringMacro(AcquisitionTime);
130  vtkGetStringMacro(AcquisitionTime);
132 
134 
136  vtkSetStringMacro(ImageDate);
137  vtkGetStringMacro(ImageDate);
139 
140  // For Tcl:
141  // From C++ use GetImageDate + GetDateAsFields
142  int GetImageDateYear();
143  int GetImageDateMonth();
144  int GetImageDateDay();
145 
149  static int GetDateAsFields(const char *date, int &year, int &month, int &day);
150 
154  static int GetTimeAsFields(const char *time, int &hour, int &minute, int &second /* , long &milliseconds */);
155 
159  static int GetDateAsLocale(const char *date, char *locale);
160 
162 
164  vtkSetStringMacro(ImageTime);
165  vtkGetStringMacro(ImageTime);
167 
169 
170  vtkSetStringMacro(ImageNumber);
171  vtkGetStringMacro(ImageNumber);
173 
175 
176  vtkSetStringMacro(SeriesNumber);
177  vtkGetStringMacro(SeriesNumber);
179 
181 
183  vtkSetStringMacro(SeriesDescription);
184  vtkGetStringMacro(SeriesDescription);
186 
188 
189  vtkSetStringMacro(StudyID);
190  vtkGetStringMacro(StudyID);
192 
194 
195  vtkSetStringMacro(StudyDescription);
196  vtkGetStringMacro(StudyDescription);
198 
200 
201  vtkSetStringMacro(Modality);
202  vtkGetStringMacro(Modality);
204 
206 
207  vtkSetStringMacro(Manufacturer);
208  vtkGetStringMacro(Manufacturer);
210 
212 
213  vtkSetStringMacro(ManufacturerModelName);
214  vtkGetStringMacro(ManufacturerModelName);
216 
218 
219  vtkSetStringMacro(StationName);
220  vtkGetStringMacro(StationName);
222 
224 
225  vtkSetStringMacro(InstitutionName);
226  vtkGetStringMacro(InstitutionName);
228 
230 
232  vtkSetStringMacro(ConvolutionKernel);
233  vtkGetStringMacro(ConvolutionKernel);
235 
237 
239  vtkSetStringMacro(SliceThickness);
240  vtkGetStringMacro(SliceThickness);
241  virtual double GetSliceThicknessAsDouble();
243 
245 
247  vtkSetStringMacro(KVP);
248  vtkGetStringMacro(KVP);
250 
252 
254  vtkSetStringMacro(GantryTilt);
255  vtkGetStringMacro(GantryTilt);
256  virtual double GetGantryTiltAsDouble();
258 
260 
262  vtkSetStringMacro(EchoTime);
263  vtkGetStringMacro(EchoTime);
265 
267 
269  vtkSetStringMacro(EchoTrainLength);
270  vtkGetStringMacro(EchoTrainLength);
272 
274 
277  vtkSetStringMacro(RepetitionTime);
278  vtkGetStringMacro(RepetitionTime);
280 
282 
284  vtkSetStringMacro(ExposureTime);
285  vtkGetStringMacro(ExposureTime);
287 
289 
290  vtkSetStringMacro(XRayTubeCurrent);
291  vtkGetStringMacro(XRayTubeCurrent);
293 
295 
297  vtkSetStringMacro(Exposure);
298  vtkGetStringMacro(Exposure);
300 
302 
303  vtkSetVector6Macro(DirectionCosine,double);
304  vtkGetVector6Macro(DirectionCosine,double);
306 
307  // Interface to allow insertion of user define values, for instance in DICOM
308  // one would want to
309  // store the Protocol Name (0018,1030), in this case one would do:
310  // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
311  virtual void AddUserDefinedValue(const char *name, const char *value);
312  virtual const char *GetUserDefinedValue(const char *name);
313  virtual unsigned int GetNumberOfUserDefinedValues();
314  virtual const char *GetUserDefinedNameByIndex(unsigned int idx);
315  virtual const char *GetUserDefinedValueByIndex(unsigned int idx);
316  virtual void RemoveAllUserDefinedValues();
317 
319 
327  virtual int AddWindowLevelPreset(double w, double l);
328  virtual void RemoveWindowLevelPreset(double w, double l);
329  virtual void RemoveAllWindowLevelPresets();
330  virtual int GetNumberOfWindowLevelPresets();
331  virtual int HasWindowLevelPreset(double w, double l);
332  virtual int GetWindowLevelPresetIndex(double w, double l);
333  virtual int GetNthWindowLevelPreset(int idx, double *w, double *l);
334  virtual double* GetNthWindowLevelPreset(int idx);
335  virtual void SetNthWindowLevelPresetComment(int idx, const char *comment);
336  virtual const char* GetNthWindowLevelPresetComment(int idx);
338 
340 
344  const char *GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
345  void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid);
347 
350  int GetSliceIDFromInstanceUID(int &volumeidx, const char *uid);
351 
352  //BTX
353  typedef enum {
354  AXIAL = 0,
356  SAGITTAL
357  } OrientationType;
358  //ETX
359  int GetOrientationType(int volumeidx);
360  void SetOrientationType(int volumeidx, int orientation);
361  static const char *GetStringFromOrientationType(unsigned int type);
362 
364  virtual void DeepCopy(vtkMedicalImageProperties *p);
365 
366 protected:
369 
370  char *StudyDate;
372  char *StudyTime;
375  char *EchoTime;
377  char *Exposure;
379  char *GantryTilt;
380  char *ImageDate;
381  char *ImageNumber;
382  char *ImageTime;
384  char *KVP;
387  char *Modality;
388  char *PatientAge;
390  char *PatientID;
391  char *PatientName;
392  char *PatientSex;
397  char *StationName;
399  char *StudyID;
401  double DirectionCosine[6];
402 
403  //BTX
405 
406  vtkMedicalImagePropertiesInternals *Internals;
407  //ETX
409 
410 private:
411  vtkMedicalImageProperties(const vtkMedicalImageProperties&); // Not implemented.
412  void operator=(const vtkMedicalImageProperties&); // Not implemented.
413 };
414 
415 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
#define VTK_IO_EXPORT
some medical image properties.
static vtkObject * New()
vtkMedicalImagePropertiesInternals * Internals