VTK  9.2.20220926
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 VTK_ABI_NAMESPACE_BEGIN
34 class vtkMedicalImagePropertiesInternals;
35 
36 class VTKIOIMAGE_EXPORT vtkMedicalImageProperties : public vtkObject
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
46  virtual void Clear();
47 
49 
53  vtkSetStringMacro(PatientName);
54  vtkGetStringMacro(PatientName);
56 
58 
62  vtkSetStringMacro(PatientID);
63  vtkGetStringMacro(PatientID);
65 
67 
73  vtkSetStringMacro(PatientAge);
74  vtkGetStringMacro(PatientAge);
76 
83  static int GetAgeAsFields(const char* age, int& year, int& month, int& week, int& day);
84 
85  // For Tcl:
86  // From C++ use GetPatientAge + GetAgeAsField
87  // Those function parse a DICOM string, and return the value of the number
88  // expressed this is either expressed in year, month or days. Thus if a
89  // string is expressed in years
90  // GetPatientAgeDay/GetPatientAgeWeek/GetPatientAgeMonth will return 0
95 
97 
101  vtkSetStringMacro(PatientSex);
102  vtkGetStringMacro(PatientSex);
104 
106 
111  vtkSetStringMacro(PatientBirthDate);
112  vtkGetStringMacro(PatientBirthDate);
114 
115  // For Tcl:
116  // From C++ use GetPatientBirthDate + GetDateAsFields
120 
122 
127  vtkSetStringMacro(StudyDate);
128  vtkGetStringMacro(StudyDate);
130 
132 
137  vtkSetStringMacro(AcquisitionDate);
138  vtkGetStringMacro(AcquisitionDate);
140 
141  // For Tcl:
142  // From C++ use GetAcquisitionDate + GetDateAsFields
146 
148 
153  vtkSetStringMacro(StudyTime);
154  vtkGetStringMacro(StudyTime);
156 
158 
163  vtkSetStringMacro(AcquisitionTime);
164  vtkGetStringMacro(AcquisitionTime);
166 
168 
173  vtkSetStringMacro(ImageDate);
174  vtkGetStringMacro(ImageDate);
176 
177  // For Tcl:
178  // From C++ use GetImageDate + GetDateAsFields
182 
188  static int GetDateAsFields(const char* date, int& year, int& month, int& day);
189 
195  static int GetTimeAsFields(
196  const char* time, int& hour, int& minute, int& second /* , long &milliseconds */);
197 
204  static int GetDateAsLocale(const char* date, char* locale);
205 
207 
212  vtkSetStringMacro(ImageTime);
213  vtkGetStringMacro(ImageTime);
215 
217 
221  vtkSetStringMacro(ImageNumber);
222  vtkGetStringMacro(ImageNumber);
224 
226 
230  vtkSetStringMacro(SeriesNumber);
231  vtkGetStringMacro(SeriesNumber);
233 
235 
240  vtkSetStringMacro(SeriesDescription);
241  vtkGetStringMacro(SeriesDescription);
243 
245 
249  vtkSetStringMacro(StudyID);
250  vtkGetStringMacro(StudyID);
252 
254 
258  vtkSetStringMacro(StudyDescription);
259  vtkGetStringMacro(StudyDescription);
261 
263 
267  vtkSetStringMacro(Modality);
268  vtkGetStringMacro(Modality);
270 
272 
276  vtkSetStringMacro(Manufacturer);
277  vtkGetStringMacro(Manufacturer);
279 
281 
285  vtkSetStringMacro(ManufacturerModelName);
286  vtkGetStringMacro(ManufacturerModelName);
288 
290 
294  vtkSetStringMacro(StationName);
295  vtkGetStringMacro(StationName);
297 
299 
303  vtkSetStringMacro(InstitutionName);
304  vtkGetStringMacro(InstitutionName);
306 
308 
312  vtkSetStringMacro(ConvolutionKernel);
313  vtkGetStringMacro(ConvolutionKernel);
315 
317 
321  vtkSetStringMacro(SliceThickness);
322  vtkGetStringMacro(SliceThickness);
323  virtual double GetSliceThicknessAsDouble();
325 
327 
331  vtkSetStringMacro(KVP);
332  vtkGetStringMacro(KVP);
334 
336 
341  vtkSetStringMacro(GantryTilt);
342  vtkGetStringMacro(GantryTilt);
343  virtual double GetGantryTiltAsDouble();
345 
347 
353  vtkSetStringMacro(EchoTime);
354  vtkGetStringMacro(EchoTime);
356 
358 
363  vtkSetStringMacro(EchoTrainLength);
364  vtkGetStringMacro(EchoTrainLength);
366 
368 
374  vtkSetStringMacro(RepetitionTime);
375  vtkGetStringMacro(RepetitionTime);
377 
379 
383  vtkSetStringMacro(ExposureTime);
384  vtkGetStringMacro(ExposureTime);
386 
388 
392  vtkSetStringMacro(XRayTubeCurrent);
393  vtkGetStringMacro(XRayTubeCurrent);
395 
397 
402  vtkSetStringMacro(Exposure);
403  vtkGetStringMacro(Exposure);
405 
407 
410  vtkSetVector6Macro(DirectionCosine, double);
411  vtkGetVector6Macro(DirectionCosine, double);
413 
414  // Interface to allow insertion of user define values, for instance in DICOM
415  // one would want to
416  // store the Protocol Name (0018,1030), in this case one would do:
417  // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
418  virtual void AddUserDefinedValue(const char* name, const char* value);
419  virtual const char* GetUserDefinedValue(const char* name);
420  virtual unsigned int GetNumberOfUserDefinedValues();
421  virtual const char* GetUserDefinedNameByIndex(unsigned int idx);
422  virtual const char* GetUserDefinedValueByIndex(unsigned int idx);
424 
426 
439  virtual int AddWindowLevelPreset(double w, double l);
440  virtual void RemoveWindowLevelPreset(double w, double l);
443  virtual int HasWindowLevelPreset(double w, double l);
444  virtual int GetWindowLevelPresetIndex(double w, double l);
445  virtual int GetNthWindowLevelPreset(int idx, double* w, double* l);
446  virtual double* GetNthWindowLevelPreset(int idx) VTK_SIZEHINT(2);
447  virtual void SetNthWindowLevelPresetComment(int idx, const char* comment);
448  virtual const char* GetNthWindowLevelPresetComment(int idx);
450 
452 
458  const char* GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
459  void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char* uid);
461 
466  int GetSliceIDFromInstanceUID(int& volumeidx, const char* uid);
467 
468  typedef enum
469  {
470  AXIAL = 0,
472  SAGITTAL
473  } OrientationType;
474 
475  int GetOrientationType(int volumeidx);
476  void SetOrientationType(int volumeidx, int orientation);
477  static const char* GetStringFromOrientationType(unsigned int type);
478 
483 
484 protected:
487 
488  char* StudyDate;
490  char* StudyTime;
493  char* EchoTime;
495  char* Exposure;
497  char* GantryTilt;
498  char* ImageDate;
499  char* ImageNumber;
500  char* ImageTime;
502  char* KVP;
505  char* Modality;
506  char* PatientAge;
508  char* PatientID;
509  char* PatientName;
510  char* PatientSex;
515  char* StationName;
517  char* StudyID;
519  double DirectionCosine[6];
520 
524  vtkMedicalImagePropertiesInternals* Internals;
525 
526 private:
528  void operator=(const vtkMedicalImageProperties&) = delete;
529 };
530 
532 #endif
a simple class to control print indentation
Definition: vtkIndent.h:120
some medical image properties.
virtual double GetSliceThicknessAsDouble()
Slice Thickness (Nominal reconstructed slice thickness, in mm) For ex: DICOM (0018,...
static int GetDateAsLocale(const char *date, char *locale)
Take as input a string in ISO 8601 date (YYYY/MM/DD) and construct a locale date based on the differe...
virtual void AddUserDefinedValue(const char *name, const char *value)
virtual int GetNumberOfWindowLevelPresets()
Add/Remove/Query the window/level presets that may have been associated to a medical image.
const char * GetInstanceUIDFromSliceID(int volumeidx, int sliceid)
Mapping from a sliceidx within a volumeidx into a DICOM Instance UID Some DICOM reader can populate t...
~vtkMedicalImageProperties() override
virtual double * GetNthWindowLevelPreset(int idx)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
vtkMedicalImagePropertiesInternals * Internals
PIMPL Encapsulation for STL containers.
virtual const char * GetUserDefinedValue(const char *name)
virtual void Clear()
Convenience method to reset all fields to an empty string/value.
int GetOrientationType(int volumeidx)
virtual int HasWindowLevelPreset(double w, double l)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual void DeepCopy(vtkMedicalImageProperties *p)
Copy the contents of p to this instance.
virtual const char * GetUserDefinedNameByIndex(unsigned int idx)
virtual void RemoveWindowLevelPreset(double w, double l)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual int GetWindowLevelPresetIndex(double w, double l)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid)
Mapping from a sliceidx within a volumeidx into a DICOM Instance UID Some DICOM reader can populate t...
int GetSliceIDFromInstanceUID(int &volumeidx, const char *uid)
Provides the inverse mapping.
static int GetTimeAsFields(const char *time, int &hour, int &minute, int &second)
Take as input a string in VR:TM format (HHMMSS) and extract the different fields namely: hour,...
virtual const char * GetNthWindowLevelPresetComment(int idx)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
static int GetDateAsFields(const char *date, int &year, int &month, int &day)
Take as input a string in ISO 8601 date (YYYY/MM/DD) and extract the different fields namely: year mo...
virtual double GetGantryTiltAsDouble()
Gantry/Detector tilt (Nominal angle of tilt in degrees of the scanning gantry.) For ex: DICOM (0018,...
virtual void SetNthWindowLevelPresetComment(int idx, const char *comment)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual const char * GetUserDefinedValueByIndex(unsigned int idx)
virtual int GetNthWindowLevelPreset(int idx, double *w, double *l)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual unsigned int GetNumberOfUserDefinedValues()
virtual void RemoveAllWindowLevelPresets()
Add/Remove/Query the window/level presets that may have been associated to a medical image.
static const char * GetStringFromOrientationType(unsigned int type)
void SetOrientationType(int volumeidx, int orientation)
virtual int AddWindowLevelPreset(double w, double l)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
static int GetAgeAsFields(const char *age, int &year, int &month, int &week, int &day)
Take as input a string in VR=AS (DICOM PS3.5) and extract either different fields namely: year month ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkMedicalImageProperties * New()
virtual void RemoveAllUserDefinedValues()
abstract base class for most VTK objects
Definition: vtkObject.h:83
@ orientation
Definition: vtkX3D.h:274
@ value
Definition: vtkX3D.h:232
@ time
Definition: vtkX3D.h:509
@ type
Definition: vtkX3D.h:528
@ date
Definition: vtkX3D.h:331
@ name
Definition: vtkX3D.h:231
#define VTK_SIZEHINT(...)