VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/Image/vtkMedicalImageProperties.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkMedicalImageProperties.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00026 #ifndef vtkMedicalImageProperties_h
00027 #define vtkMedicalImageProperties_h
00028 
00029 #include "vtkIOImageModule.h" // For export macro
00030 #include "vtkObject.h"
00031 
00032 class vtkMedicalImagePropertiesInternals;
00033 
00034 class VTKIOIMAGE_EXPORT vtkMedicalImageProperties : public vtkObject
00035 {
00036 public:
00037   static vtkMedicalImageProperties *New();
00038   vtkTypeMacro(vtkMedicalImageProperties,vtkObject);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040 
00042   virtual void Clear();
00043 
00045 
00046   vtkSetStringMacro(PatientName);
00047   vtkGetStringMacro(PatientName);
00049 
00051 
00052   vtkSetStringMacro(PatientID);
00053   vtkGetStringMacro(PatientID);
00055 
00057 
00060   vtkSetStringMacro(PatientAge);
00061   vtkGetStringMacro(PatientAge);
00063 
00068   static int GetAgeAsFields(const char *age, int &year, int &month, int &week, int &day);
00069 
00070   // For Tcl:
00071   // From C++ use GetPatientAge + GetAgeAsField
00072   // Those function parse a DICOM string, and return the value of the number
00073   // expressed this is either expressed in year, month or days. Thus if a
00074   // string is expressed in years
00075   // GetPatientAgeDay/GetPatientAgeWeek/GetPatientAgeMonth will return 0
00076   int GetPatientAgeYear();
00077   int GetPatientAgeMonth();
00078   int GetPatientAgeWeek();
00079   int GetPatientAgeDay();
00080 
00082 
00083   vtkSetStringMacro(PatientSex);
00084   vtkGetStringMacro(PatientSex);
00086 
00088 
00090   vtkSetStringMacro(PatientBirthDate);
00091   vtkGetStringMacro(PatientBirthDate);
00093 
00094   // For Tcl:
00095   // From C++ use GetPatientBirthDate + GetDateAsFields
00096   int GetPatientBirthDateYear();
00097   int GetPatientBirthDateMonth();
00098   int GetPatientBirthDateDay();
00099 
00101 
00102   vtkSetStringMacro(StudyDate);
00103   vtkGetStringMacro(StudyDate);
00105 
00107 
00109   vtkSetStringMacro(AcquisitionDate);
00110   vtkGetStringMacro(AcquisitionDate);
00112 
00113   // For Tcl:
00114   // From C++ use GetAcquisitionDate + GetDateAsFields
00115   int GetAcquisitionDateYear();
00116   int GetAcquisitionDateMonth();
00117   int GetAcquisitionDateDay();
00118 
00120 
00122   vtkSetStringMacro(StudyTime);
00123   vtkGetStringMacro(StudyTime);
00125 
00127 
00130   vtkSetStringMacro(AcquisitionTime);
00131   vtkGetStringMacro(AcquisitionTime);
00133 
00135 
00137   vtkSetStringMacro(ImageDate);
00138   vtkGetStringMacro(ImageDate);
00140 
00141   // For Tcl:
00142   // From C++ use GetImageDate + GetDateAsFields
00143   int GetImageDateYear();
00144   int GetImageDateMonth();
00145   int GetImageDateDay();
00146 
00150   static int GetDateAsFields(const char *date, int &year, int &month, int &day);
00151 
00155   static int GetTimeAsFields(const char *time, int &hour, int &minute, int &second /* , long &milliseconds */);
00156 
00160   static int GetDateAsLocale(const char *date, char *locale);
00161 
00163 
00165   vtkSetStringMacro(ImageTime);
00166   vtkGetStringMacro(ImageTime);
00168 
00170 
00171   vtkSetStringMacro(ImageNumber);
00172   vtkGetStringMacro(ImageNumber);
00174 
00176 
00177   vtkSetStringMacro(SeriesNumber);
00178   vtkGetStringMacro(SeriesNumber);
00180 
00182 
00184   vtkSetStringMacro(SeriesDescription);
00185   vtkGetStringMacro(SeriesDescription);
00187 
00189 
00190   vtkSetStringMacro(StudyID);
00191   vtkGetStringMacro(StudyID);
00193 
00195 
00196   vtkSetStringMacro(StudyDescription);
00197   vtkGetStringMacro(StudyDescription);
00199 
00201 
00202   vtkSetStringMacro(Modality);
00203   vtkGetStringMacro(Modality);
00205 
00207 
00208   vtkSetStringMacro(Manufacturer);
00209   vtkGetStringMacro(Manufacturer);
00211 
00213 
00214   vtkSetStringMacro(ManufacturerModelName);
00215   vtkGetStringMacro(ManufacturerModelName);
00217 
00219 
00220   vtkSetStringMacro(StationName);
00221   vtkGetStringMacro(StationName);
00223 
00225 
00226   vtkSetStringMacro(InstitutionName);
00227   vtkGetStringMacro(InstitutionName);
00229 
00231 
00233   vtkSetStringMacro(ConvolutionKernel);
00234   vtkGetStringMacro(ConvolutionKernel);
00236 
00238 
00240   vtkSetStringMacro(SliceThickness);
00241   vtkGetStringMacro(SliceThickness);
00242   virtual double GetSliceThicknessAsDouble();
00244 
00246 
00248   vtkSetStringMacro(KVP);
00249   vtkGetStringMacro(KVP);
00251 
00253 
00255   vtkSetStringMacro(GantryTilt);
00256   vtkGetStringMacro(GantryTilt);
00257   virtual double GetGantryTiltAsDouble();
00259 
00261 
00263   vtkSetStringMacro(EchoTime);
00264   vtkGetStringMacro(EchoTime);
00266 
00268 
00270   vtkSetStringMacro(EchoTrainLength);
00271   vtkGetStringMacro(EchoTrainLength);
00273 
00275 
00278   vtkSetStringMacro(RepetitionTime);
00279   vtkGetStringMacro(RepetitionTime);
00281 
00283 
00285   vtkSetStringMacro(ExposureTime);
00286   vtkGetStringMacro(ExposureTime);
00288 
00290 
00291   vtkSetStringMacro(XRayTubeCurrent);
00292   vtkGetStringMacro(XRayTubeCurrent);
00294 
00296 
00298   vtkSetStringMacro(Exposure);
00299   vtkGetStringMacro(Exposure);
00301 
00303 
00304   vtkSetVector6Macro(DirectionCosine,double);
00305   vtkGetVector6Macro(DirectionCosine,double);
00307 
00308   // Interface to allow insertion of user define values, for instance in DICOM
00309   // one would want to
00310   // store the Protocol Name (0018,1030), in this case one would do:
00311   // AddUserDefinedValue( "Protocol Name", "T1W/SE/1024" );
00312   virtual void AddUserDefinedValue(const char *name, const char *value);
00313   virtual const char *GetUserDefinedValue(const char *name);
00314   virtual unsigned int GetNumberOfUserDefinedValues();
00315   virtual const char *GetUserDefinedNameByIndex(unsigned int idx);
00316   virtual const char *GetUserDefinedValueByIndex(unsigned int idx);
00317   virtual void RemoveAllUserDefinedValues();
00318 
00320 
00328   virtual int AddWindowLevelPreset(double w, double l);
00329   virtual void RemoveWindowLevelPreset(double w, double l);
00330   virtual void RemoveAllWindowLevelPresets();
00331   virtual int GetNumberOfWindowLevelPresets();
00332   virtual int HasWindowLevelPreset(double w, double l);
00333   virtual int GetWindowLevelPresetIndex(double w, double l);
00334   virtual int GetNthWindowLevelPreset(int idx, double *w, double *l);
00335   virtual double* GetNthWindowLevelPreset(int idx);
00336   virtual void SetNthWindowLevelPresetComment(int idx, const char *comment);
00337   virtual const char* GetNthWindowLevelPresetComment(int idx);
00339 
00341 
00345   const char *GetInstanceUIDFromSliceID(int volumeidx, int sliceid);
00346   void SetInstanceUIDFromSliceID(int volumeidx, int sliceid, const char *uid);
00348 
00351   int GetSliceIDFromInstanceUID(int &volumeidx, const char *uid);
00352 
00353   //BTX
00354   typedef enum {
00355     AXIAL = 0,
00356     CORONAL,
00357     SAGITTAL
00358   } OrientationType;
00359   //ETX
00360   int GetOrientationType(int volumeidx);
00361   void SetOrientationType(int volumeidx, int orientation);
00362   static const char *GetStringFromOrientationType(unsigned int type);
00363 
00365   virtual void DeepCopy(vtkMedicalImageProperties *p);
00366 
00367 protected:
00368   vtkMedicalImageProperties();
00369   ~vtkMedicalImageProperties();
00370 
00371   char *StudyDate;
00372   char *AcquisitionDate;
00373   char *StudyTime;
00374   char *AcquisitionTime;
00375   char *ConvolutionKernel;
00376   char *EchoTime;
00377   char *EchoTrainLength;
00378   char *Exposure;
00379   char *ExposureTime;
00380   char *GantryTilt;
00381   char *ImageDate;
00382   char *ImageNumber;
00383   char *ImageTime;
00384   char *InstitutionName;
00385   char *KVP;
00386   char *ManufacturerModelName;
00387   char *Manufacturer;
00388   char *Modality;
00389   char *PatientAge;
00390   char *PatientBirthDate;
00391   char *PatientID;
00392   char *PatientName;
00393   char *PatientSex;
00394   char *RepetitionTime;
00395   char *SeriesDescription;
00396   char *SeriesNumber;
00397   char *SliceThickness;
00398   char *StationName;
00399   char *StudyDescription;
00400   char *StudyID;
00401   char *XRayTubeCurrent;
00402   double DirectionCosine[6];
00403 
00404   //BTX
00406 
00407   vtkMedicalImagePropertiesInternals *Internals;
00408   //ETX
00410 
00411 private:
00412   vtkMedicalImageProperties(const vtkMedicalImageProperties&); // Not implemented.
00413   void operator=(const vtkMedicalImageProperties&); // Not implemented.
00414 };
00415 
00416 #endif