ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkDICOMImageIO2.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkDICOMImageIO2_h
00019 #define __itkDICOMImageIO2_h
00020 
00021 #include <fstream>
00022 #include "itkImageIOBase.h"
00023 
00024 #include "DICOMParser.h"
00025 #include "DICOMAppHelper.h"
00026 
00027 namespace itk
00028 {
00034 class ITK_EXPORT DICOMImageIO2:public ImageIOBase
00035 {
00036 public:
00037 
00039   typedef DICOMImageIO2        Self;
00040   typedef ImageIOBase          Superclass;
00041   typedef SmartPointer< Self > Pointer;
00042 
00044   itkNewMacro(Self);
00045 
00047   itkTypeMacro(DICOMImageIO2, Superclass);
00048 
00049   /*-------- This part of the interfaces deals with reading data. ----- */
00050 
00053   virtual bool CanReadFile(const char *);
00054 
00056   virtual void ReadImageInformation();
00057 
00059   // virtual const std::type_info& GetPixelType() const;
00060 
00062   virtual void Read(void *buffer);
00063 
00067   // virtual unsigned int GetComponentSize() const;
00068 
00069   /*-------- This part of the interfaces deals with writing data. ----- */
00070 
00073   virtual bool CanWriteFile(const char *) { return false; }
00074 
00076   virtual void WriteImageInformation() {}
00077 
00080   virtual void Write(const void *) {}
00081 
00083   void GetPatientName(char *name);
00084 
00085   void GetPatientID(char *id);
00086 
00087   void GetPatientSex(char *sex);
00088 
00089   void GetPatientAge(char *age);
00090 
00091   void GetStudyID(char *id);
00092 
00093   void GetPatientDOB(char *dob);
00094 
00095   void GetStudyDescription(char *desc);
00096 
00097   void GetBodyPart(char *part);
00098 
00099   void GetNumberOfSeriesInStudy(char *series);
00100 
00101   void GetNumberOfStudyRelatedSeries(char *series);
00102 
00103   void GetStudyDate(char *date);
00104 
00105   void GetModality(char *modality);
00106 
00107   void GetManufacturer(char *manu);
00108 
00109   void GetInstitution(char *ins);
00110 
00111   void GetModel(char *model);
00112 
00113 protected:
00114   DICOMImageIO2();
00115   virtual ~DICOMImageIO2();
00116   void PrintSelf(std::ostream & os, Indent indent) const;
00117 
00118   itkdicomparser::DICOMParser    *m_Parser;
00119   itkdicomparser::DICOMAppHelper *m_AppHelper;
00120 
00121   void ReadDataCallback(doublebyte group,
00122                         doublebyte element,
00123                         itkdicomparser::DICOMParser::VRTypes type,
00124                         unsigned char *val,
00125                         quadbyte len);
00126 
00127   unsigned char *m_ImageDataBuffer;
00128 private:
00129   DICOMImageIO2(const Self &);  //purposely not implemented
00130   void operator=(const Self &); //purposely not implemented
00131 };
00132 } // end namespace itk
00133 
00134 #endif // __itkDICOMImageIO2_h
00135