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/11/23 21:04:02 $
00007   Version:   $Revision: 1.22 $
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 
00053 class ITK_EXPORT GDCMImageIO : public ImageIOBase
00054 {
00055 public:
00057   typedef GDCMImageIO Self;
00058   typedef ImageIOBase Superclass;
00059   typedef SmartPointer<Self>  Pointer;
00060   
00062   itkNewMacro(Self);
00063 
00065   itkTypeMacro(GDCMImageIO, Superclass);
00066 
00067   /*-------- This part of the interface deals with reading data. ------ */
00068 
00071   virtual bool CanReadFile(const char*);
00072   
00074   virtual void ReadImageInformation();
00075   
00077   virtual void Read(void* buffer);
00078 
00079   /*-------- This part of the interfaces deals with writing data. ----- */
00080 
00083   virtual bool CanWriteFile(const char*);
00084 
00087   virtual void WriteImageInformation();
00088   
00091   virtual void Write(const void* buffer);
00092   
00096   itkGetMacro(RescaleSlope, double);
00097   itkGetMacro(RescaleIntercept, double);
00098 
00103   itkGetStringMacro(UIDPrefix);
00104   itkSetStringMacro(UIDPrefix);
00105 
00107   itkGetStringMacro(StudyInstanceUID);
00108   itkGetStringMacro(SeriesInstanceUID);
00109   itkGetStringMacro(FrameOfReferenceInstanceUID);
00110 
00113   itkSetMacro(KeepOriginalUID,bool);
00114   itkGetMacro(KeepOriginalUID,bool);
00115   itkBooleanMacro(KeepOriginalUID);
00116 
00120   void GetPatientName(char* name);
00121   void GetPatientID(char* id);
00122   void GetPatientSex(char* sex);
00123   void GetPatientAge(char* age);
00124   void GetStudyID(char* id);
00125   void GetPatientDOB(char* dob);
00126   void GetStudyDescription(char* desc);
00127   void GetBodyPart(char* part);
00128   void GetNumberOfSeriesInStudy(char* series);
00129   void GetNumberOfStudyRelatedSeries(char* series);
00130   void GetStudyDate(char* date);
00131   void GetModality(char* modality);
00132   void GetManufacturer(char* manu);
00133   void GetInstitution(char* ins);
00134   void GetModel(char* model);
00135   void GetScanOptions(char *options);
00136 
00143   static bool GetLabelFromTag( const std::string & tag, 
00144                                       std::string & labelId );
00145 
00152   itkSetMacro(MaxSizeLoadEntry, long);
00153 
00154 protected:
00155   GDCMImageIO();
00156   ~GDCMImageIO();
00157   void PrintSelf(std::ostream& os, Indent indent) const;
00158 
00159   bool OpenGDCMFileForReading(std::ifstream& os, const char* filename);
00160   bool OpenGDCMFileForWriting(std::ofstream& os, const char* filename);
00161   void InternalReadImageInformation(std::ifstream& file);
00162 
00163   double m_RescaleSlope;
00164   double m_RescaleIntercept;
00165 
00166   std::string m_UIDPrefix;
00167   std::string m_StudyInstanceUID;
00168   std::string m_SeriesInstanceUID;
00169   std::string m_FrameOfReferenceInstanceUID;
00170   bool m_KeepOriginalUID;
00171   long m_MaxSizeLoadEntry;
00172 
00173 private:
00174   GDCMImageIO(const Self&); //purposely not implemented
00175   void operator=(const Self&); //purposely not implemented
00176 
00177   std::string m_PatientName;
00178   std::string m_PatientID;
00179   std::string m_PatientDOB;
00180   std::string m_StudyID;   
00181   std::string m_StudyDescription;
00182   std::string m_BodyPart;
00183   std::string m_NumberOfSeriesInStudy;
00184   std::string m_NumberOfStudyRelatedSeries;
00185   std::string m_PatientSex;
00186   std::string m_PatientAge;
00187   std::string m_StudyDate;
00188   std::string m_Modality;
00189   std::string m_Manufacturer;
00190   std::string m_Institution;
00191   std::string m_Model;
00192   std::string m_ScanOptions;
00193 
00194   ImageIOBase::IOComponentType m_InternalComponentType;
00195 };
00196 
00197 } // end namespace itk
00198 
00199 #endif // __itkGDCMImageIO_h

Generated at Wed May 24 23:11:37 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000