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 =========================================================================*/
27 #ifndef vtkMedicalImageProperties_h
28 #define vtkMedicalImageProperties_h
29 
30 #include "vtkIOImageModule.h" // For export macro
31 #include "vtkObject.h"
32 
33 class vtkMedicalImagePropertiesInternals;
34 
35 class VTKIOIMAGE_EXPORT vtkMedicalImageProperties : public vtkObject
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
45  virtual void Clear();
46 
48 
52  vtkSetStringMacro(PatientName);
53  vtkGetStringMacro(PatientName);
55 
57 
61  vtkSetStringMacro(PatientID);
62  vtkGetStringMacro(PatientID);
64 
66 
72  vtkSetStringMacro(PatientAge);
73  vtkGetStringMacro(PatientAge);
75 
82  static int GetAgeAsFields(const char *age, int &year, int &month, int &week, int &day);
83 
84  // For Tcl:
85  // From C++ use GetPatientAge + GetAgeAsField
86  // Those function parse a DICOM string, and return the value of the number
87  // expressed this is either expressed in year, month or days. Thus if a
88  // string is expressed in years
89  // GetPatientAgeDay/GetPatientAgeWeek/GetPatientAgeMonth will return 0
90  int GetPatientAgeYear();
91  int GetPatientAgeMonth();
92  int GetPatientAgeWeek();
93  int GetPatientAgeDay();
94 
96 
100  vtkSetStringMacro(PatientSex);
101  vtkGetStringMacro(PatientSex);
103 
105 
110  vtkSetStringMacro(PatientBirthDate);
111  vtkGetStringMacro(PatientBirthDate);
113 
114  // For Tcl:
115  // From C++ use GetPatientBirthDate + GetDateAsFields
116  int GetPatientBirthDateYear();
117  int GetPatientBirthDateMonth();
118  int GetPatientBirthDateDay();
119 
121 
126  vtkSetStringMacro(StudyDate);
127  vtkGetStringMacro(StudyDate);
129 
131 
136  vtkSetStringMacro(AcquisitionDate);
137  vtkGetStringMacro(AcquisitionDate);
139 
140  // For Tcl:
141  // From C++ use GetAcquisitionDate + GetDateAsFields
142  int GetAcquisitionDateYear();
143  int GetAcquisitionDateMonth();
144  int GetAcquisitionDateDay();
145 
147 
152  vtkSetStringMacro(StudyTime);
153  vtkGetStringMacro(StudyTime);
155 
157 
162  vtkSetStringMacro(AcquisitionTime);
163  vtkGetStringMacro(AcquisitionTime);
165 
167 
172  vtkSetStringMacro(ImageDate);
173  vtkGetStringMacro(ImageDate);
175 
176  // For Tcl:
177  // From C++ use GetImageDate + GetDateAsFields
178  int GetImageDateYear();
179  int GetImageDateMonth();
180  int GetImageDateDay();
181 
187  static int GetDateAsFields(const char *date, int &year, int &month, int &day);
188 
194  static int GetTimeAsFields(const char *time, int &hour, int &minute, int &second /* , long &milliseconds */);
195 
202  static int GetDateAsLocale(const char *date, char *locale);
203 
205 
210  vtkSetStringMacro(ImageTime);
211  vtkGetStringMacro(ImageTime);
213 
215 
219  vtkSetStringMacro(ImageNumber);
220  vtkGetStringMacro(ImageNumber);
222 
224 
228  vtkSetStringMacro(SeriesNumber);
229  vtkGetStringMacro(SeriesNumber);
231 
233 
238  vtkSetStringMacro(SeriesDescription);
239  vtkGetStringMacro(SeriesDescription);
241 
243 
247  vtkSetStringMacro(StudyID);
248  vtkGetStringMacro(StudyID);
250 
252 
256  vtkSetStringMacro(StudyDescription);
257  vtkGetStringMacro(StudyDescription);
259 
261 
265  vtkSetStringMacro(Modality);
266  vtkGetStringMacro(Modality);
268 
270 
274  vtkSetStringMacro(Manufacturer);
275  vtkGetStringMacro(Manufacturer);
277 
279 
283  vtkSetStringMacro(ManufacturerModelName);
284  vtkGetStringMacro(ManufacturerModelName);
286 
288 
292  vtkSetStringMacro(StationName);
293  vtkGetStringMacro(StationName);
295 
297 
301  vtkSetStringMacro(InstitutionName);
302  vtkGetStringMacro(InstitutionName);
304 
306 
310  vtkSetStringMacro(ConvolutionKernel);
311  vtkGetStringMacro(ConvolutionKernel);
313 
315 
319  vtkSetStringMacro(SliceThickness);
320  vtkGetStringMacro(SliceThickness);
321  virtual double GetSliceThicknessAsDouble();
323 
325 
329  vtkSetStringMacro(KVP);
330  vtkGetStringMacro(KVP);
332 
334 
339  vtkSetStringMacro(GantryTilt);
340  vtkGetStringMacro(GantryTilt);
341  virtual double GetGantryTiltAsDouble();
343 
345 
351  vtkSetStringMacro(EchoTime);
352  vtkGetStringMacro(EchoTime);
354 
356 
361  vtkSetStringMacro(EchoTrainLength);
362  vtkGetStringMacro(EchoTrainLength);
364 
366 
372  vtkSetStringMacro(RepetitionTime);
373  vtkGetStringMacro(RepetitionTime);
375 
377 
381  vtkSetStringMacro(ExposureTime);
382  vtkGetStringMacro(ExposureTime);
384 
386 
390  vtkSetStringMacro(XRayTubeCurrent);
391  vtkGetStringMacro(XRayTubeCurrent);
393 
395 
400  vtkSetStringMacro(Exposure);
401  vtkGetStringMacro(Exposure);
403 
405 
408  vtkSetVector6Macro(DirectionCosine,double);
409  vtkGetVector6Macro(DirectionCosine,double);
411 
412  // Interface to allow insertion of user define values, for instance in DICOM
413  // one would want to
414  // store the Protocol Name (0018,1030), in this case one would do:
415  // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
416  virtual void AddUserDefinedValue(const char *name, const char *value);
417  virtual const char *GetUserDefinedValue(const char *name);
418  virtual unsigned int GetNumberOfUserDefinedValues();
419  virtual const char *GetUserDefinedNameByIndex(unsigned int idx);
420  virtual const char *GetUserDefinedValueByIndex(unsigned int idx);
421  virtual void RemoveAllUserDefinedValues();
422 
424 
437  virtual int AddWindowLevelPreset(double w, double l);
438  virtual void RemoveWindowLevelPreset(double w, double l);
439  virtual void RemoveAllWindowLevelPresets();
440  virtual int GetNumberOfWindowLevelPresets();
441  virtual int HasWindowLevelPreset(double w, double l);
442  virtual int GetWindowLevelPresetIndex(double w, double l);
443  virtual int GetNthWindowLevelPreset(int idx, double *w, double *l);
444  virtual double* GetNthWindowLevelPreset(int idx);
445  virtual void SetNthWindowLevelPresetComment(int idx, const char *comment);
446  virtual const char* GetNthWindowLevelPresetComment(int idx);
448 
450 
456  const char *GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
457  void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid);
459 
464  int GetSliceIDFromInstanceUID(int &volumeidx, const char *uid);
465 
466  typedef enum {
467  AXIAL = 0,
469  SAGITTAL
470  } OrientationType;
471 
472  int GetOrientationType(int volumeidx);
473  void SetOrientationType(int volumeidx, int orientation);
474  static const char *GetStringFromOrientationType(unsigned int type);
475 
479  virtual void DeepCopy(vtkMedicalImageProperties *p);
480 
481 protected:
484 
485  char *StudyDate;
487  char *StudyTime;
490  char *EchoTime;
492  char *Exposure;
494  char *GantryTilt;
495  char *ImageDate;
496  char *ImageNumber;
497  char *ImageTime;
499  char *KVP;
502  char *Modality;
503  char *PatientAge;
505  char *PatientID;
506  char *PatientName;
507  char *PatientSex;
512  char *StationName;
514  char *StudyID;
516  double DirectionCosine[6];
517 
521  vtkMedicalImagePropertiesInternals *Internals;
522 
523 private:
524  vtkMedicalImageProperties(const vtkMedicalImageProperties&) VTK_DELETE_FUNCTION;
525  void operator=(const vtkMedicalImageProperties&) VTK_DELETE_FUNCTION;
526 };
527 
528 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
some medical image properties.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkMedicalImagePropertiesInternals * Internals
PIMPL Encapsulation for STL containers.