VTK  9.0.1
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) override;
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(
195  const char* time, int& hour, int& minute, int& second /* , long &milliseconds */);
196 
203  static int GetDateAsLocale(const char* date, char* locale);
204 
206 
211  vtkSetStringMacro(ImageTime);
212  vtkGetStringMacro(ImageTime);
214 
216 
220  vtkSetStringMacro(ImageNumber);
221  vtkGetStringMacro(ImageNumber);
223 
225 
229  vtkSetStringMacro(SeriesNumber);
230  vtkGetStringMacro(SeriesNumber);
232 
234 
239  vtkSetStringMacro(SeriesDescription);
240  vtkGetStringMacro(SeriesDescription);
242 
244 
248  vtkSetStringMacro(StudyID);
249  vtkGetStringMacro(StudyID);
251 
253 
257  vtkSetStringMacro(StudyDescription);
258  vtkGetStringMacro(StudyDescription);
260 
262 
266  vtkSetStringMacro(Modality);
267  vtkGetStringMacro(Modality);
269 
271 
275  vtkSetStringMacro(Manufacturer);
276  vtkGetStringMacro(Manufacturer);
278 
280 
284  vtkSetStringMacro(ManufacturerModelName);
285  vtkGetStringMacro(ManufacturerModelName);
287 
289 
293  vtkSetStringMacro(StationName);
294  vtkGetStringMacro(StationName);
296 
298 
302  vtkSetStringMacro(InstitutionName);
303  vtkGetStringMacro(InstitutionName);
305 
307 
311  vtkSetStringMacro(ConvolutionKernel);
312  vtkGetStringMacro(ConvolutionKernel);
314 
316 
320  vtkSetStringMacro(SliceThickness);
321  vtkGetStringMacro(SliceThickness);
322  virtual double GetSliceThicknessAsDouble();
324 
326 
330  vtkSetStringMacro(KVP);
331  vtkGetStringMacro(KVP);
333 
335 
340  vtkSetStringMacro(GantryTilt);
341  vtkGetStringMacro(GantryTilt);
342  virtual double GetGantryTiltAsDouble();
344 
346 
352  vtkSetStringMacro(EchoTime);
353  vtkGetStringMacro(EchoTime);
355 
357 
362  vtkSetStringMacro(EchoTrainLength);
363  vtkGetStringMacro(EchoTrainLength);
365 
367 
373  vtkSetStringMacro(RepetitionTime);
374  vtkGetStringMacro(RepetitionTime);
376 
378 
382  vtkSetStringMacro(ExposureTime);
383  vtkGetStringMacro(ExposureTime);
385 
387 
391  vtkSetStringMacro(XRayTubeCurrent);
392  vtkGetStringMacro(XRayTubeCurrent);
394 
396 
401  vtkSetStringMacro(Exposure);
402  vtkGetStringMacro(Exposure);
404 
406 
409  vtkSetVector6Macro(DirectionCosine, double);
410  vtkGetVector6Macro(DirectionCosine, double);
412 
413  // Interface to allow insertion of user define values, for instance in DICOM
414  // one would want to
415  // store the Protocol Name (0018,1030), in this case one would do:
416  // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
417  virtual void AddUserDefinedValue(const char* name, const char* value);
418  virtual const char* GetUserDefinedValue(const char* name);
419  virtual unsigned int GetNumberOfUserDefinedValues();
420  virtual const char* GetUserDefinedNameByIndex(unsigned int idx);
421  virtual const char* GetUserDefinedValueByIndex(unsigned int idx);
422  virtual void RemoveAllUserDefinedValues();
423 
425 
438  virtual int AddWindowLevelPreset(double w, double l);
439  virtual void RemoveWindowLevelPreset(double w, double l);
440  virtual void RemoveAllWindowLevelPresets();
441  virtual int GetNumberOfWindowLevelPresets();
442  virtual int HasWindowLevelPreset(double w, double l);
443  virtual int GetWindowLevelPresetIndex(double w, double l);
444  virtual int GetNthWindowLevelPreset(int idx, double* w, double* l);
445  virtual double* GetNthWindowLevelPreset(int idx) VTK_SIZEHINT(2);
446  virtual void SetNthWindowLevelPresetComment(int idx, const char* comment);
447  virtual const char* GetNthWindowLevelPresetComment(int idx);
449 
451 
457  const char* GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
458  void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char* uid);
460 
465  int GetSliceIDFromInstanceUID(int& volumeidx, const char* uid);
466 
467  typedef enum
468  {
469  AXIAL = 0,
471  SAGITTAL
472  } OrientationType;
473 
474  int GetOrientationType(int volumeidx);
475  void SetOrientationType(int volumeidx, int orientation);
476  static const char* GetStringFromOrientationType(unsigned int type);
477 
481  virtual void DeepCopy(vtkMedicalImageProperties* p);
482 
483 protected:
485  ~vtkMedicalImageProperties() override;
486 
487  char* StudyDate;
489  char* StudyTime;
492  char* EchoTime;
494  char* Exposure;
496  char* GantryTilt;
497  char* ImageDate;
498  char* ImageNumber;
499  char* ImageTime;
501  char* KVP;
504  char* Modality;
505  char* PatientAge;
507  char* PatientID;
508  char* PatientName;
509  char* PatientSex;
514  char* StationName;
516  char* StudyID;
518  double DirectionCosine[6];
519 
523  vtkMedicalImagePropertiesInternals* Internals;
524 
525 private:
527  void operator=(const vtkMedicalImageProperties&) = delete;
528 };
529 
530 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_SIZEHINT(...)
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.