VTK  9.1.0
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
33class vtkMedicalImagePropertiesInternals;
34
35class VTKIOIMAGE_EXPORT vtkMedicalImageProperties : public vtkObject
36{
37public:
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
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
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
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
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);
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);
423
425
438 virtual int AddWindowLevelPreset(double w, double l);
439 virtual void RemoveWindowLevelPreset(double w, double l);
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
482
483protected:
486
492 char* EchoTime;
494 char* Exposure;
501 char* KVP;
504 char* Modality;
516 char* StudyID;
518 double DirectionCosine[6];
519
523 vtkMedicalImagePropertiesInternals* Internals;
524
525private:
527 void operator=(const vtkMedicalImageProperties&) = delete;
528};
529
530#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
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 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 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 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:73
@ orientation
Definition: vtkX3D.h:268
@ value
Definition: vtkX3D.h:226
@ time
Definition: vtkX3D.h:503
@ type
Definition: vtkX3D.h:522
@ date
Definition: vtkX3D.h:325
@ name
Definition: vtkX3D.h:225
#define VTK_SIZEHINT(...)