VTK  9.3.1
vtkMedicalImageProperties.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
15 #ifndef vtkMedicalImageProperties_h
16 #define vtkMedicalImageProperties_h
17 
18 #include "vtkIOImageModule.h" // For export macro
19 #include "vtkObject.h"
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkMedicalImagePropertiesInternals;
23 
24 class VTKIOIMAGE_EXPORT vtkMedicalImageProperties : public vtkObject
25 {
26 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
34  virtual void Clear();
35 
37 
41  vtkSetStringMacro(PatientName);
42  vtkGetStringMacro(PatientName);
44 
46 
50  vtkSetStringMacro(PatientID);
51  vtkGetStringMacro(PatientID);
53 
55 
61  vtkSetStringMacro(PatientAge);
62  vtkGetStringMacro(PatientAge);
64 
71  static int GetAgeAsFields(const char* age, int& year, int& month, int& week, int& day);
72 
73  // For Tcl:
74  // From C++ use GetPatientAge + GetAgeAsField
75  // Those function parse a DICOM string, and return the value of the number
76  // expressed this is either expressed in year, month or days. Thus if a
77  // string is expressed in years
78  // GetPatientAgeDay/GetPatientAgeWeek/GetPatientAgeMonth will return 0
79  int GetPatientAgeYear();
80  int GetPatientAgeMonth();
81  int GetPatientAgeWeek();
82  int GetPatientAgeDay();
83 
85 
89  vtkSetStringMacro(PatientSex);
90  vtkGetStringMacro(PatientSex);
92 
94 
99  vtkSetStringMacro(PatientBirthDate);
100  vtkGetStringMacro(PatientBirthDate);
102 
103  // For Tcl:
104  // From C++ use GetPatientBirthDate + GetDateAsFields
105  int GetPatientBirthDateYear();
106  int GetPatientBirthDateMonth();
107  int GetPatientBirthDateDay();
108 
110 
115  vtkSetStringMacro(StudyDate);
116  vtkGetStringMacro(StudyDate);
118 
120 
125  vtkSetStringMacro(AcquisitionDate);
126  vtkGetStringMacro(AcquisitionDate);
128 
129  // For Tcl:
130  // From C++ use GetAcquisitionDate + GetDateAsFields
131  int GetAcquisitionDateYear();
132  int GetAcquisitionDateMonth();
133  int GetAcquisitionDateDay();
134 
136 
141  vtkSetStringMacro(StudyTime);
142  vtkGetStringMacro(StudyTime);
144 
146 
151  vtkSetStringMacro(AcquisitionTime);
152  vtkGetStringMacro(AcquisitionTime);
154 
156 
161  vtkSetStringMacro(ImageDate);
162  vtkGetStringMacro(ImageDate);
164 
165  // For Tcl:
166  // From C++ use GetImageDate + GetDateAsFields
167  int GetImageDateYear();
168  int GetImageDateMonth();
169  int GetImageDateDay();
170 
176  static int GetDateAsFields(const char* date, int& year, int& month, int& day);
177 
183  static int GetTimeAsFields(
184  const char* time, int& hour, int& minute, int& second /* , long &milliseconds */);
185 
192  static int GetDateAsLocale(const char* date, char* locale);
193 
195 
200  vtkSetStringMacro(ImageTime);
201  vtkGetStringMacro(ImageTime);
203 
205 
209  vtkSetStringMacro(ImageNumber);
210  vtkGetStringMacro(ImageNumber);
212 
214 
218  vtkSetStringMacro(SeriesNumber);
219  vtkGetStringMacro(SeriesNumber);
221 
223 
228  vtkSetStringMacro(SeriesDescription);
229  vtkGetStringMacro(SeriesDescription);
231 
233 
237  vtkSetStringMacro(StudyID);
238  vtkGetStringMacro(StudyID);
240 
242 
246  vtkSetStringMacro(StudyDescription);
247  vtkGetStringMacro(StudyDescription);
249 
251 
255  vtkSetStringMacro(Modality);
256  vtkGetStringMacro(Modality);
258 
260 
264  vtkSetStringMacro(Manufacturer);
265  vtkGetStringMacro(Manufacturer);
267 
269 
273  vtkSetStringMacro(ManufacturerModelName);
274  vtkGetStringMacro(ManufacturerModelName);
276 
278 
282  vtkSetStringMacro(StationName);
283  vtkGetStringMacro(StationName);
285 
287 
291  vtkSetStringMacro(InstitutionName);
292  vtkGetStringMacro(InstitutionName);
294 
296 
300  vtkSetStringMacro(ConvolutionKernel);
301  vtkGetStringMacro(ConvolutionKernel);
303 
305 
309  vtkSetStringMacro(SliceThickness);
310  vtkGetStringMacro(SliceThickness);
311  virtual double GetSliceThicknessAsDouble();
313 
315 
319  vtkSetStringMacro(KVP);
320  vtkGetStringMacro(KVP);
322 
324 
329  vtkSetStringMacro(GantryTilt);
330  vtkGetStringMacro(GantryTilt);
331  virtual double GetGantryTiltAsDouble();
333 
335 
341  vtkSetStringMacro(EchoTime);
342  vtkGetStringMacro(EchoTime);
344 
346 
351  vtkSetStringMacro(EchoTrainLength);
352  vtkGetStringMacro(EchoTrainLength);
354 
356 
362  vtkSetStringMacro(RepetitionTime);
363  vtkGetStringMacro(RepetitionTime);
365 
367 
371  vtkSetStringMacro(ExposureTime);
372  vtkGetStringMacro(ExposureTime);
374 
376 
380  vtkSetStringMacro(XRayTubeCurrent);
381  vtkGetStringMacro(XRayTubeCurrent);
383 
385 
390  vtkSetStringMacro(Exposure);
391  vtkGetStringMacro(Exposure);
393 
395 
398  vtkSetVector6Macro(DirectionCosine, double);
399  vtkGetVector6Macro(DirectionCosine, double);
401 
402  // Interface to allow insertion of user define values, for instance in DICOM
403  // one would want to
404  // store the Protocol Name (0018,1030), in this case one would do:
405  // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
406  virtual void AddUserDefinedValue(const char* name, const char* value);
407  virtual const char* GetUserDefinedValue(const char* name);
408  virtual unsigned int GetNumberOfUserDefinedValues();
409  virtual const char* GetUserDefinedNameByIndex(unsigned int idx);
410  virtual const char* GetUserDefinedValueByIndex(unsigned int idx);
411  virtual void RemoveAllUserDefinedValues();
412 
414 
427  virtual int AddWindowLevelPreset(double w, double l);
428  virtual void RemoveWindowLevelPreset(double w, double l);
429  virtual void RemoveAllWindowLevelPresets();
430  virtual int GetNumberOfWindowLevelPresets();
431  virtual vtkTypeBool HasWindowLevelPreset(double w, double l);
432  virtual int GetWindowLevelPresetIndex(double w, double l);
433  virtual int GetNthWindowLevelPreset(int idx, double* w, double* l);
434  virtual double* GetNthWindowLevelPreset(int idx) VTK_SIZEHINT(2);
435  virtual void SetNthWindowLevelPresetComment(int idx, const char* comment);
436  virtual const char* GetNthWindowLevelPresetComment(int idx);
438 
440 
446  const char* GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
447  void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char* uid);
449 
454  int GetSliceIDFromInstanceUID(int& volumeidx, const char* uid);
455 
456  typedef enum
457  {
458  AXIAL = 0,
460  SAGITTAL
461  } OrientationType;
462 
463  int GetOrientationType(int volumeidx);
464  void SetOrientationType(int volumeidx, int orientation);
465  static const char* GetStringFromOrientationType(unsigned int type);
466 
470  virtual void DeepCopy(vtkMedicalImageProperties* p);
471 
472 protected:
474  ~vtkMedicalImageProperties() override;
475 
476  char* StudyDate;
478  char* StudyTime;
481  char* EchoTime;
483  char* Exposure;
485  char* GantryTilt;
486  char* ImageDate;
487  char* ImageNumber;
488  char* ImageTime;
490  char* KVP;
493  char* Modality;
494  char* PatientAge;
496  char* PatientID;
497  char* PatientName;
498  char* PatientSex;
503  char* StationName;
505  char* StudyID;
507  double DirectionCosine[6];
508 
512  vtkMedicalImagePropertiesInternals* Internals;
513 
514 private:
516  void operator=(const vtkMedicalImageProperties&) = delete;
517 };
518 
519 VTK_ABI_NAMESPACE_END
520 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
a simple class to control print indentation
Definition: vtkIndent.h:28
#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.