Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkGDCMImageIO.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGDCMImageIO.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/06/09 21:42:41 $
00007   Version:   $Revision: 1.19 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkGDCMImageIO_h
00021 #define __itkGDCMImageIO_h
00022 
00023 #include "itkImageIOBase.h"
00024 #include <fstream>
00025 #include <string>
00026 
00027 namespace itk
00028 {
00029 
00051 class ITK_EXPORT GDCMImageIO : public ImageIOBase
00052 {
00053 public:
00055   typedef GDCMImageIO Self;
00056   typedef ImageIOBase Superclass;
00057   typedef SmartPointer<Self>  Pointer;
00058   
00060   itkNewMacro(Self);
00061 
00063   itkTypeMacro(GDCMImageIO, Superclass);
00064 
00065   /*-------- This part of the interface deals with reading data. ------ */
00066 
00069   virtual bool CanReadFile(const char*);
00070   
00072   virtual void ReadImageInformation();
00073   
00075   virtual void Read(void* buffer);
00076 
00077   /*-------- This part of the interfaces deals with writing data. ----- */
00078 
00081   virtual bool CanWriteFile(const char*);
00082 
00085   virtual void WriteImageInformation();
00086   
00089   virtual void Write(const void* buffer);
00090   
00094   itkGetMacro(RescaleSlope, double);
00095   itkGetMacro(RescaleIntercept, double);
00096 
00101   itkGetStringMacro(UIDPrefix);
00102   itkSetStringMacro(UIDPrefix);
00103 
00105   itkGetStringMacro(StudyInstanceUID);
00106   itkGetStringMacro(SeriesInstanceUID);
00107   itkGetStringMacro(FrameOfReferenceInstanceUID);
00108 
00111   itkSetMacro(KeepOriginalUID,bool);
00112   itkGetMacro(KeepOriginalUID,bool);
00113   itkBooleanMacro(KeepOriginalUID);
00114 
00118   void GetPatientName(char* name);
00119   void GetPatientID(char* id);
00120   void GetPatientSex(char* sex);
00121   void GetPatientAge(char* age);
00122   void GetStudyID(char* id);
00123   void GetPatientDOB(char* dob);
00124   void GetStudyDescription(char* desc);
00125   void GetBodyPart(char* part);
00126   void GetNumberOfSeriesInStudy(char* series);
00127   void GetNumberOfStudyRelatedSeries(char* series);
00128   void GetStudyDate(char* date);
00129   void GetModality(char* modality);
00130   void GetManufacturer(char* manu);
00131   void GetInstitution(char* ins);
00132   void GetModel(char* model);
00133   void GetScanOptions(char *options);
00134 
00141   static bool GetLabelFromTag( const std::string & tag, 
00142                                       std::string & labelId );
00143 
00144 protected:
00145   GDCMImageIO();
00146   ~GDCMImageIO();
00147   void PrintSelf(std::ostream& os, Indent indent) const;
00148 
00149   bool OpenGDCMFileForReading(std::ifstream& os, const char* filename);
00150   bool OpenGDCMFileForWriting(std::ofstream& os, const char* filename);
00151   void InternalReadImageInformation(std::ifstream& file);
00152 
00153   double m_RescaleSlope;
00154   double m_RescaleIntercept;
00155 
00156   std::string m_UIDPrefix;
00157   std::string m_StudyInstanceUID;
00158   std::string m_SeriesInstanceUID;
00159   std::string m_FrameOfReferenceInstanceUID;
00160   bool m_KeepOriginalUID;
00161 
00162 private:
00163   GDCMImageIO(const Self&); //purposely not implemented
00164   void operator=(const Self&); //purposely not implemented
00165 
00166   std::string m_PatientName;
00167   std::string m_PatientID;
00168   std::string m_PatientDOB;
00169   std::string m_StudyID;   
00170   std::string m_StudyDescription;
00171   std::string m_BodyPart;
00172   std::string m_NumberOfSeriesInStudy;
00173   std::string m_NumberOfStudyRelatedSeries;
00174   std::string m_PatientSex;
00175   std::string m_PatientAge;
00176   std::string m_StudyDate;
00177   std::string m_Modality;
00178   std::string m_Manufacturer;
00179   std::string m_Institution;
00180   std::string m_Model;
00181   std::string m_ScanOptions;
00182 };
00183 
00184 } // end namespace itk
00185 
00186 #endif // __itkGDCMImageIO_h

Generated at Tue Aug 30 16:44:00 2005 for ITK by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2000