ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkGE5ImageIO.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  *=========================================================================*/
00032 #ifndef __itkGE5ImageIO_h
00033 #define __itkGE5ImageIO_h
00034 
00035 
00036 #include "itkIPLCommonImageIO.h"
00037 #include "Ge5xHdr.h"
00038 
00039 namespace itk
00040 {
00050 class ITK_EXPORT GE5ImageIO:public IPLCommonImageIO
00051 {
00052 public:
00054   typedef GE5ImageIO           Self;
00055   typedef IPLCommonImageIO     Superclass;
00056   typedef SmartPointer< Self > Pointer;
00057 
00059   itkNewMacro(Self);
00060 
00062   itkTypeMacro(GE5ImageIO, Superclass);
00063 
00064   /*-------- This part of the interfaces deals with reading data. ----- */
00065 
00072   virtual bool CanReadFile(const char *FileNameToRead);
00073 
00074   /* * Set the spacing and dimension information for the set filename. */
00075   // Implemented in superclass
00076   //      virtual void ReadImageInformation();
00077 
00079   void ModifyImageInformation();
00080 
00081   /* * Get the type of the pixel.  */
00082   // Implemented in superclass
00083   //      virtual const std::type_info& GetPixelType() const;
00084 
00085   /* * Reads the data from disk into the memory buffer provided. */
00086   // Implemented in superclass
00087   //      virtual void Read(void* buffer);
00088 
00089   /* * Compute the size (in bytes) of the components of a pixel. For
00090        * example, and RGB pixel of unsigned char would have a
00091        * component size of 1 byte. */
00092   // Implemented in superclass
00093   //      virtual unsigned int GetComponentSize() const;
00094 
00095   /*-------- This part of the interfaces deals with writing data. ----- */
00096 
00097   /* * Determine if the file can be written with this ImageIO implementation.
00098    * \param FileNameToWrite The name of the file to test for writing.
00099    * \author Hans J. Johnson
00100    * \post Sets classes ImageIOBase::m_FileName variable to be FileNameToWrite
00101    * \return Returns true if this ImageIO can write the file specified.
00102   */
00103   // Implemented in superclass
00104   //      virtual bool CanWriteFile(const char * FileNameToWrite);
00105 
00106   /* * Set the spacing and dimension information for the set filename. */
00107   // Implemented in superclass
00108   //      virtual void WriteImageInformation();
00109 
00110   /* * Writes the data to disk from the memory buffer provided. Make sure
00111     * that the IORegions has been set properly. */
00112   // Implemented in superclass
00113   //      virtual void Write(const void* buffer);
00114 protected:
00115   GE5ImageIO();
00116   ~GE5ImageIO();
00117 
00118   virtual GEImageHeader * ReadHeader(const char *FileNameToRead);
00119 
00120 private:
00121   void SwapPixHdr(Ge5xPixelHeader *hdr);
00122 
00123   int CheckGE5xImages(char const *const imageFileTemplate, std::string & reason);
00124 
00125   GE5ImageIO(const Self &);     //purposely not implemented
00126   void operator=(const Self &); //purposely not implemented
00127 };
00128 } // end namespace itk
00129 
00130 #endif // __itkAnalyzeImageIO_h
00131