VTK
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);
41
45 virtual void Clear();
46
48
52 vtkSetStringMacro(PatientName);
53 vtkGetStringMacro(PatientName);
55
57
61 vtkSetStringMacro(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);
129
131
136 vtkSetStringMacro(AcquisitionDate);
137 vtkGetStringMacro(AcquisitionDate);
139
140 // For Tcl:
141 // From C++ use GetAcquisitionDate + GetDateAsFields
145
147
152 vtkSetStringMacro(StudyTime);
155
157
162 vtkSetStringMacro(AcquisitionTime);
163 vtkGetStringMacro(AcquisitionTime);
165
167
172 vtkSetStringMacro(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(const char *time, int &hour, int &minute, int &second /* , long &milliseconds */);
195
202 static int GetDateAsLocale(const char *date, char *locale);
203
205
210 vtkSetStringMacro(ImageTime);
213
215
219 vtkSetStringMacro(ImageNumber);
220 vtkGetStringMacro(ImageNumber);
222
224
228 vtkSetStringMacro(SeriesNumber);
229 vtkGetStringMacro(SeriesNumber);
231
233
238 vtkSetStringMacro(SeriesDescription);
239 vtkGetStringMacro(SeriesDescription);
241
243
247 vtkSetStringMacro(StudyID);
250
252
256 vtkSetStringMacro(StudyDescription);
257 vtkGetStringMacro(StudyDescription);
259
261
265 vtkSetStringMacro(Modality);
268
270
274 vtkSetStringMacro(Manufacturer);
275 vtkGetStringMacro(Manufacturer);
277
279
283 vtkSetStringMacro(ManufacturerModelName);
284 vtkGetStringMacro(ManufacturerModelName);
286
288
292 vtkSetStringMacro(StationName);
293 vtkGetStringMacro(StationName);
295
297
301 vtkSetStringMacro(InstitutionName);
302 vtkGetStringMacro(InstitutionName);
304
306
310 vtkSetStringMacro(ConvolutionKernel);
311 vtkGetStringMacro(ConvolutionKernel);
313
315
319 vtkSetStringMacro(SliceThickness);
320 vtkGetStringMacro(SliceThickness);
323
325
329 vtkSetStringMacro(KVP);
332
334
339 vtkSetStringMacro(GantryTilt);
340 vtkGetStringMacro(GantryTilt);
341 virtual double GetGantryTiltAsDouble();
343
345
351 vtkSetStringMacro(EchoTime);
354
356
361 vtkSetStringMacro(EchoTrainLength);
362 vtkGetStringMacro(EchoTrainLength);
364
366
372 vtkSetStringMacro(RepetitionTime);
373 vtkGetStringMacro(RepetitionTime);
375
377
381 vtkSetStringMacro(ExposureTime);
382 vtkGetStringMacro(ExposureTime);
384
386
390 vtkSetStringMacro(XRayTubeCurrent);
391 vtkGetStringMacro(XRayTubeCurrent);
393
395
400 vtkSetStringMacro(Exposure);
403
405
408 vtkSetVector6Macro(DirectionCosine,double);
409 vtkGetVector6Macro(DirectionCosine,double);
411
412 // Interface to allow insertion of user define values, for instance in DICOM
413 // one would want to
414 // store the Protocol Name (0018,1030), in this case one would do:
415 // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
416 virtual void AddUserDefinedValue(const char *name, const char *value);
417 virtual const char *GetUserDefinedValue(const char *name);
418 virtual unsigned int GetNumberOfUserDefinedValues();
419 virtual const char *GetUserDefinedNameByIndex(unsigned int idx);
420 virtual const char *GetUserDefinedValueByIndex(unsigned int idx);
422
424
437 virtual int AddWindowLevelPreset(double w, double l);
438 virtual void RemoveWindowLevelPreset(double w, double l);
441 virtual int HasWindowLevelPreset(double w, double l);
442 virtual int GetWindowLevelPresetIndex(double w, double l);
443 virtual int GetNthWindowLevelPreset(int idx, double *w, double *l);
444 virtual double* GetNthWindowLevelPreset(int idx);
445 virtual void SetNthWindowLevelPresetComment(int idx, const char *comment);
446 virtual const char* GetNthWindowLevelPresetComment(int idx);
448
450
456 const char *GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
457 void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid);
459
464 int GetSliceIDFromInstanceUID(int &volumeidx, const char *uid);
465
466 typedef enum {
467 AXIAL = 0,
469 SAGITTAL
470 } OrientationType;
471
472 int GetOrientationType(int volumeidx);
473 void SetOrientationType(int volumeidx, int orientation);
474 static const char *GetStringFromOrientationType(unsigned int type);
475
480
481protected:
484
490 char *EchoTime;
492 char *Exposure;
499 char *KVP;
502 char *Modality;
514 char *StudyID;
516 double DirectionCosine[6];
517
521 vtkMedicalImagePropertiesInternals *Internals;
522
523private:
524 vtkMedicalImageProperties(const vtkMedicalImageProperties&) VTK_DELETE_FUNCTION;
525 void operator=(const vtkMedicalImageProperties&) VTK_DELETE_FUNCTION;
526};
527
528#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
some medical image properties.
virtual double GetSliceThicknessAsDouble()
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()
virtual const char * GetUserDefinedValueByIndex(unsigned int idx)
virtual double * GetNthWindowLevelPreset(int idx)
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...
vtkMedicalImagePropertiesInternals * Internals
PIMPL Encapsulation for STL containers.
static vtkMedicalImageProperties * New()
virtual void Clear()
Convenience method to reset all fields to an emptry string/value.
int GetOrientationType(int volumeidx)
virtual int HasWindowLevelPreset(double w, double l)
virtual void DeepCopy(vtkMedicalImageProperties *p)
Copy the contents of p to this instance.
virtual void RemoveWindowLevelPreset(double w, double l)
virtual int GetWindowLevelPresetIndex(double w, double l)
void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid)
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()
virtual const char * GetUserDefinedValue(const char *name)
virtual void SetNthWindowLevelPresetComment(int idx, const char *comment)
virtual int GetNthWindowLevelPreset(int idx, double *w, double *l)
virtual unsigned int GetNumberOfUserDefinedValues()
virtual const char * GetUserDefinedNameByIndex(unsigned int idx)
virtual void RemoveAllWindowLevelPresets()
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)
Methods invoked by print to print information about the object including superclasses.
virtual const char * GetNthWindowLevelPresetComment(int idx)
virtual void RemoveAllUserDefinedValues()
abstract base class for most VTK objects
Definition: vtkObject.h:60
@ orientation
Definition: vtkX3D.h:262
@ value
Definition: vtkX3D.h:220
@ time
Definition: vtkX3D.h:497
@ type
Definition: vtkX3D.h:516
@ date
Definition: vtkX3D.h:319
@ name
Definition: vtkX3D.h:219
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.