freImagePolyStorage.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freImagePolyStorage.h,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 #ifndef __freImagePolyStorage_h
00023 #define __freImagePolyStorage_h
00024 
00025 #include "freImageTypes.h"
00026 
00027 namespace FREE
00028 {
00037 template<class TPixel2D, class TPixel3D = TPixel2D>
00038 class ImagePolyStorage
00039 {
00040 public:
00041         enum DimensionType
00042         {
00043                 Dim_Undefined = 0, 
00044                 Dim_2D = 2, 
00045                 Dim_3D = 3, 
00046         };
00047 
00048         typedef TPixel2D Pixel2DType;
00049         typedef TPixel3D Pixel3DType;
00050         typedef itk::Image<TPixel2D, 2> Image2DType;
00051         typedef typename Image2DType::Pointer Image2DPointer;
00052   typedef itk::Image<TPixel3D, 3> Image3DType;
00053         typedef typename Image3DType::Pointer Image3DPointer;
00054 
00061         bool GetImage(Image2DType*& pImage) const;
00063         bool GetImage(Image2DPointer& smpImage) const;
00065         bool GetImage(Image3DType*& pImage) const;
00067         bool GetImage(Image3DPointer& smpImage) const;
00068 
00069         void SetImage(Image2DType* pImage);
00070 
00071         void SetImage(Image3DType* pImage);
00072 
00073         bool GetPixelByPhysicalPoint(const ImageTypes<2>::PointType& point, Pixel2DType& pixel) const;
00074         bool GetPixelByPhysicalPoint(const ImageTypes<3>::PointType& point, Pixel3DType& pixel) const;
00075 
00076         bool GetPixelByIndex(const typename Image2DType::IndexType& index, Pixel2DType& pixel) const;
00077         bool GetPixelByIndex(const typename Image3DType::IndexType& index, Pixel3DType& pixel) const;
00078 
00079         void Reset();
00080 
00081         DimensionType GetImageDimension() const
00082         {
00083                 return m_ImageDimension;
00084         }
00085 
00087   ImagePolyStorage();
00088 
00089   ImagePolyStorage(Image2DType* pImage);
00090 
00091   ImagePolyStorage(Image3DType* pImage);
00092 
00094   ~ImagePolyStorage();
00095 
00096 private:
00097   Image2DPointer m_smp2DImage;
00098   Image3DPointer m_smp3DImage;
00099         DimensionType m_ImageDimension;
00100 };
00101 
00103 typedef ImagePolyStorage<InternalImagePixelType> InternalImagePolyStorageType;
00104 
00106 typedef ImagePolyStorage< ImageTypes<2>::TransformationFieldPixelType, ImageTypes<3>::TransformationFieldPixelType > TransformationFieldPolyStorageType;
00107 
00109 typedef ImagePolyStorage<ViewImagePixelType> ViewImagePolyStorageType;
00110 
00112 typedef ImagePolyStorage<MaskPixelType> MaskPolyStorageType;
00113 
00114 }//end of namespace FREE
00115 
00116 #ifndef ITK_MANUAL_INSTANTIATION
00117 #include "freImagePolyStorage.txx"
00118 #endif
00119 
00120 #endif

Generated at Sat Oct 13 16:06:10 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000