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 "vtkIOImageModule.h" // For export macro
30 #include "vtkObject.h"
31 
32 class vtkMedicalImagePropertiesInternals;
33 
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent);
40 
42  virtual void Clear();
43 
45 
46  vtkSetStringMacro(PatientName);
47  vtkGetStringMacro(PatientName);
49 
51 
52  vtkSetStringMacro(PatientID);
53  vtkGetStringMacro(PatientID);
55 
57 
60  vtkSetStringMacro(PatientAge);
61  vtkGetStringMacro(PatientAge);
63 
68  static int GetAgeAsFields(const char *age, int &year, int &month, int &week, int &day);
69 
70  // For Tcl:
71  // From C++ use GetPatientAge + GetAgeAsField
72  // Those function parse a DICOM string, and return the value of the number
73  // expressed this is either expressed in year, month or days. Thus if a
74  // string is expressed in years
75  // GetPatientAgeDay/GetPatientAgeWeek/GetPatientAgeMonth will return 0
76  int GetPatientAgeYear();
77  int GetPatientAgeMonth();
78  int GetPatientAgeWeek();
79  int GetPatientAgeDay();
80 
82 
83  vtkSetStringMacro(PatientSex);
84  vtkGetStringMacro(PatientSex);
86 
88 
90  vtkSetStringMacro(PatientBirthDate);
91  vtkGetStringMacro(PatientBirthDate);
93 
94  // For Tcl:
95  // From C++ use GetPatientBirthDate + GetDateAsFields
96  int GetPatientBirthDateYear();
97  int GetPatientBirthDateMonth();
98  int GetPatientBirthDateDay();
99 
101 
102  vtkSetStringMacro(StudyDate);
103  vtkGetStringMacro(StudyDate);
105 
107 
109  vtkSetStringMacro(AcquisitionDate);
110  vtkGetStringMacro(AcquisitionDate);
112 
113  // For Tcl:
114  // From C++ use GetAcquisitionDate + GetDateAsFields
115  int GetAcquisitionDateYear();
116  int GetAcquisitionDateMonth();
117  int GetAcquisitionDateDay();
118 
120 
122  vtkSetStringMacro(StudyTime);
123  vtkGetStringMacro(StudyTime);
125 
127 
130  vtkSetStringMacro(AcquisitionTime);
131  vtkGetStringMacro(AcquisitionTime);
133 
135 
137  vtkSetStringMacro(ImageDate);
138  vtkGetStringMacro(ImageDate);
140 
141  // For Tcl:
142  // From C++ use GetImageDate + GetDateAsFields
143  int GetImageDateYear();
144  int GetImageDateMonth();
145  int GetImageDateDay();
146 
150  static int GetDateAsFields(const char *date, int &year, int &month, int &day);
151 
155  static int GetTimeAsFields(const char *time, int &hour, int &minute, int &second /* , long &milliseconds */);
156 
160  static int GetDateAsLocale(const char *date, char *locale);
161 
163 
165  vtkSetStringMacro(ImageTime);
166  vtkGetStringMacro(ImageTime);
168 
170 
171  vtkSetStringMacro(ImageNumber);
172  vtkGetStringMacro(ImageNumber);
174 
176 
177  vtkSetStringMacro(SeriesNumber);
178  vtkGetStringMacro(SeriesNumber);
180 
182 
184  vtkSetStringMacro(SeriesDescription);
185  vtkGetStringMacro(SeriesDescription);
187 
189 
190  vtkSetStringMacro(StudyID);
191  vtkGetStringMacro(StudyID);
193 
195 
196  vtkSetStringMacro(StudyDescription);
197  vtkGetStringMacro(StudyDescription);
199 
201 
202  vtkSetStringMacro(Modality);
203  vtkGetStringMacro(Modality);
205 
207 
208  vtkSetStringMacro(Manufacturer);
209  vtkGetStringMacro(Manufacturer);
211 
213 
214  vtkSetStringMacro(ManufacturerModelName);
215  vtkGetStringMacro(ManufacturerModelName);
217 
219 
220  vtkSetStringMacro(StationName);
221  vtkGetStringMacro(StationName);
223 
225 
226  vtkSetStringMacro(InstitutionName);
227  vtkGetStringMacro(InstitutionName);
229 
231 
233  vtkSetStringMacro(ConvolutionKernel);
234  vtkGetStringMacro(ConvolutionKernel);
236 
238 
240  vtkSetStringMacro(SliceThickness);
241  vtkGetStringMacro(SliceThickness);
242  virtual double GetSliceThicknessAsDouble();
244 
246 
248  vtkSetStringMacro(KVP);
249  vtkGetStringMacro(KVP);
251 
253 
255  vtkSetStringMacro(GantryTilt);
256  vtkGetStringMacro(GantryTilt);
257  virtual double GetGantryTiltAsDouble();
259 
261 
263  vtkSetStringMacro(EchoTime);
264  vtkGetStringMacro(EchoTime);
266 
268 
270  vtkSetStringMacro(EchoTrainLength);
271  vtkGetStringMacro(EchoTrainLength);
273 
275 
278  vtkSetStringMacro(RepetitionTime);
279  vtkGetStringMacro(RepetitionTime);
281 
283 
285  vtkSetStringMacro(ExposureTime);
286  vtkGetStringMacro(ExposureTime);
288 
290 
291  vtkSetStringMacro(XRayTubeCurrent);
292  vtkGetStringMacro(XRayTubeCurrent);
294 
296 
298  vtkSetStringMacro(Exposure);
299  vtkGetStringMacro(Exposure);
301 
303 
304  vtkSetVector6Macro(DirectionCosine,double);
305  vtkGetVector6Macro(DirectionCosine,double);
307 
308  // Interface to allow insertion of user define values, for instance in DICOM
309  // one would want to
310  // store the Protocol Name (0018,1030), in this case one would do:
311  // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
312  virtual void AddUserDefinedValue(const char *name, const char *value);
313  virtual const char *GetUserDefinedValue(const char *name);
314  virtual unsigned int GetNumberOfUserDefinedValues();
315  virtual const char *GetUserDefinedNameByIndex(unsigned int idx);
316  virtual const char *GetUserDefinedValueByIndex(unsigned int idx);
317  virtual void RemoveAllUserDefinedValues();
318 
320 
328  virtual int AddWindowLevelPreset(double w, double l);
329  virtual void RemoveWindowLevelPreset(double w, double l);
330  virtual void RemoveAllWindowLevelPresets();
331  virtual int GetNumberOfWindowLevelPresets();
332  virtual int HasWindowLevelPreset(double w, double l);
333  virtual int GetWindowLevelPresetIndex(double w, double l);
334  virtual int GetNthWindowLevelPreset(int idx, double *w, double *l);
335  virtual double* GetNthWindowLevelPreset(int idx);
336  virtual void SetNthWindowLevelPresetComment(int idx, const char *comment);
337  virtual const char* GetNthWindowLevelPresetComment(int idx);
339 
341 
345  const char *GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
346  void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid);
348 
351  int GetSliceIDFromInstanceUID(int &volumeidx, const char *uid);
352 
353  //BTX
354  typedef enum {
355  AXIAL = 0,
357  SAGITTAL
358  } OrientationType;
359  //ETX
360  int GetOrientationType(int volumeidx);
361  void SetOrientationType(int volumeidx, int orientation);
362  static const char *GetStringFromOrientationType(unsigned int type);
363 
365  virtual void DeepCopy(vtkMedicalImageProperties *p);
366 
367 protected:
370 
371  char *StudyDate;
373  char *StudyTime;
376  char *EchoTime;
378  char *Exposure;
380  char *GantryTilt;
381  char *ImageDate;
382  char *ImageNumber;
383  char *ImageTime;
385  char *KVP;
388  char *Modality;
389  char *PatientAge;
391  char *PatientID;
392  char *PatientName;
393  char *PatientSex;
398  char *StationName;
400  char *StudyID;
402  double DirectionCosine[6];
403 
404  //BTX
406 
407  vtkMedicalImagePropertiesInternals *Internals;
408  //ETX
410 
411 private:
412  vtkMedicalImageProperties(const vtkMedicalImageProperties&); // Not implemented.
413  void operator=(const vtkMedicalImageProperties&); // Not implemented.
414 };
415 
416 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTKIOIMAGE_EXPORT
some medical image properties.
static vtkObject * New()
vtkMedicalImagePropertiesInternals * Internals