VTK  9.3.20240425
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
21VTK_ABI_NAMESPACE_BEGIN
22class vtkMedicalImagePropertiesInternals;
23
24class VTKIOIMAGE_EXPORT vtkMedicalImageProperties : public vtkObject
25{
26public:
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
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
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
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
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);
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);
412
414
427 virtual int AddWindowLevelPreset(double w, double l);
428 virtual void RemoveWindowLevelPreset(double w, double l);
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
471
472protected:
475
481 char* EchoTime;
483 char* Exposure;
490 char* KVP;
493 char* Modality;
505 char* StudyID;
507 double DirectionCosine[6];
508
512 vtkMedicalImagePropertiesInternals* Internals;
513
514private:
516 void operator=(const vtkMedicalImageProperties&) = delete;
517};
518
519VTK_ABI_NAMESPACE_END
520#endif
a simple class to control print indentation
Definition vtkIndent.h:108
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)
static const char * GetStringFromOrientationType(unsigned int type)
virtual int GetNumberOfWindowLevelPresets()
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual const char * GetUserDefinedValueByIndex(unsigned int idx)
virtual double * GetNthWindowLevelPreset(int idx)
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
vtkMedicalImagePropertiesInternals * Internals
PIMPL Encapsulation for STL containers.
static vtkMedicalImageProperties * New()
virtual void Clear()
Convenience method to reset all fields to an empty string/value.
int GetOrientationType(int volumeidx)
virtual void DeepCopy(vtkMedicalImageProperties *p)
Copy the contents of p to this instance.
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,...
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 vtkTypeBool HasWindowLevelPreset(double w, double l)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual double GetGantryTiltAsDouble()
Gantry/Detector tilt (Nominal angle of tilt in degrees of the scanning gantry.) For ex: DICOM (0018,...
virtual const char * GetUserDefinedValue(const char *name)
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 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 const char * GetUserDefinedNameByIndex(unsigned int idx)
virtual void RemoveAllWindowLevelPresets()
Add/Remove/Query the window/level presets that may have been associated to a medical image.
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.
virtual const char * GetNthWindowLevelPresetComment(int idx)
Add/Remove/Query the window/level presets that may have been associated to a medical image.
virtual void RemoveAllUserDefinedValues()
abstract base class for most VTK objects
Definition vtkObject.h:162
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)