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

itkAnalyzeImageIO.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkAnalyzeImageIO.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-02-22 05:53:41 $
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      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00029 #ifndef __itkAnalyzeImageIO_h
00030 #define __itkAnalyzeImageIO_h
00031 
00032 #ifdef _MSC_VER
00033 #pragma warning ( disable : 4786 )
00034 #endif
00035 
00036 #include <fstream>
00037 #include "itkImageIOBase.h"
00038 #include "itkAnalyzeDbh.h"
00039 
00040 namespace itk
00041 {
00093 class ITK_EXPORT AnalyzeImageIO : public ImageIOBase
00094 {
00095 public:
00097   typedef AnalyzeImageIO     Self;
00098   typedef ImageIOBase        Superclass;
00099   typedef SmartPointer<Self> Pointer;
00100 
00102   itkNewMacro(Self);
00103 
00105   itkTypeMacro(AnalyzeImageIO, Superclass);
00106 
00107   /*-------- This part of the interfaces deals with reading data. ----- */
00108 
00115   virtual bool CanReadFile(const char* FileNameToRead);
00116 
00118   virtual void ReadImageInformation();
00119 
00121   virtual void Read(void* buffer);
00122 
00123   /*-------- This part of the interfaces deals with writing data. ----- */
00124 
00131   virtual bool CanWriteFile(const char * FileNameToWrite);
00132 
00134   virtual void WriteImageInformation();
00135 
00138   virtual void Write(const void* buffer);
00139 
00141   virtual std::vector<double> GetDirection(unsigned int i) const;
00142 
00145   virtual std::vector<double> GetDefaultDirection(unsigned int i) const;
00146 
00147 
00148 protected:
00149   AnalyzeImageIO();
00150   ~AnalyzeImageIO();
00151   void PrintSelf(std::ostream& os, Indent indent) const;
00152 private:
00168   typedef enum 
00169   {
00170 
00182   } ValidAnalyzeOrientationFlags;
00183 
00184 
00185 AnalyzeImageIO(const Self&); //purposely not implemented
00186 void operator=(const Self&); //purposely not implemented
00187 void SwapBytesIfNecessary(void * buffer, unsigned long numberOfPixels);
00194 void SwapHeaderBytesIfNecessary( struct dsr * const imageheader );
00195 
00201 void  DefineHeaderObjectDataType(void);
00202 #if defined(REORIENT_IMAGES)
00203 void ReorientIfNecessary(char *p);
00204 struct ipl_dimensions
00205   {
00206   unsigned int slicestride;
00207   unsigned int rowstride;
00208   unsigned int componentstride;x
00209   unsigned int pixelsize;
00210   //
00211   // xsize,ysize,zsize == size in each direction in pixesls
00212   unsigned int xsize;
00213   unsigned int ysize;
00214   unsigned int zsize;
00215   };
00216 
00224 void GetAllDimensions(ipl_dimensions &dim);
00225 ipl_dimensions m_OldDim,m_NewDim;
00226 #endif
00227 
00234 ImageIOBase::ByteOrder CheckAnalyzeEndian(const struct dsr &temphdr);
00235 
00237 struct dsr             m_Hdr;
00238 ImageIOBase::ByteOrder m_MachineByteOrder;
00239 };
00240 extern const char *const ANALYZE_ScanNumber;
00241 extern const char *const ANALYZE_O_MAX;
00242 extern const char *const ANALYZE_O_MIN;
00243 extern const char *const ANALYZE_S_MAX;
00244 extern const char *const ANALYZE_S_MIN;
00245 extern const char *const ANALYZE_CAL_MAX;
00246 extern const char *const ANALYZE_CAL_MIN;
00247 extern const char *const ANALYZE_GLMAX;
00248 extern const char *const ANALYZE_GLMIN;
00249 extern const char *const ANALYZE_AUX_FILE_NAME;
00250 extern const char *const ANALYZE_CALIBRATIONUNITS;
00251 
00252 } // end namespace itk
00253 
00254 #endif // __itkAnalyzeImageIO_h
00255 

Generated at Tue Sep 15 02:07:04 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000