go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxResamplerBase.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
00012 
00013 ======================================================================*/
00014 
00015 #ifndef __elxResamplerBase_h
00016 #define __elxResamplerBase_h
00017 
00019 #include "elxMacro.h"
00020 
00021 #include "elxBaseComponentSE.h"
00022 #include "itkResampleImageFilter.h"
00023 #include "elxProgressCommand.h"
00024 
00025 namespace elastix
00026 {
00027   using namespace itk;
00028 
00066   template <class TElastix>
00067     class ResamplerBase : public BaseComponentSE<TElastix>
00068   {
00069   public:
00070 
00072     typedef ResamplerBase               Self;
00073     typedef BaseComponentSE<TElastix>   Superclass;
00074 
00076     itkTypeMacro( ResamplerBase, BaseComponentSE );
00077 
00079     typedef typename Superclass::ElastixType          ElastixType;
00080     typedef typename Superclass::ElastixPointer       ElastixPointer;
00081     typedef typename Superclass::ConfigurationType    ConfigurationType;
00082     typedef typename Superclass::ConfigurationPointer ConfigurationPointer;
00083     typedef typename Superclass::RegistrationType     RegistrationType;
00084     typedef typename Superclass::RegistrationPointer  RegistrationPointer;
00085 
00088     typedef typename ElastixType::MovingImageType     InputImageType;
00089     typedef typename ElastixType::MovingImageType     OutputImageType;
00090     //typedef typename ElastixType::FixedImageType      OutputImageType;
00091     typedef typename ElastixType::CoordRepType        CoordRepType;
00092 
00094     typedef ResampleImageFilter<
00095       InputImageType, OutputImageType, CoordRepType>  ITKBaseType;
00096 
00098     typedef typename ITKBaseType::TransformType       TransformType;
00099     typedef typename ITKBaseType::InterpolatorType    InterpolatorType;
00100     typedef typename ITKBaseType::SizeType            SizeType;
00101     typedef typename ITKBaseType::IndexType           IndexType;
00102     typedef typename ITKBaseType::SpacingType         SpacingType;
00103     typedef typename ITKBaseType::DirectionType       DirectionType;
00104     typedef typename ITKBaseType::OriginPointType     OriginPointType;
00105     typedef typename ITKBaseType::PixelType           OutputPixelType;
00106 
00108     typedef elx::ProgressCommand          ProgressCommandType;
00109 
00111     itkStaticConstMacro( ImageDimension, unsigned int,
00112       OutputImageType::ImageDimension );
00113 
00115     virtual ITKBaseType * GetAsITKBaseType( void )
00116     {
00117       return dynamic_cast<ITKBaseType *>( this );
00118     }
00119 
00121     virtual const ITKBaseType * GetAsITKBaseType( void ) const
00122     {
00123       return dynamic_cast<const ITKBaseType *>( this );
00124     }
00125 
00129     virtual int BeforeAllTransformix( void ){ return 0;};
00130 
00137     virtual void BeforeRegistrationBase( void );
00138 
00142     virtual void AfterEachResolutionBase( void );
00143 
00147     virtual void AfterRegistrationBase( void );
00148 
00150     virtual void ReadFromFile( void );
00151 
00153     virtual void WriteToFile( void ) const;
00154 
00156     virtual void WriteResultImage( const char * filename );
00157 
00158   protected:
00159 
00161     ResamplerBase(){};
00163     virtual ~ResamplerBase() {}
00164 
00166     virtual void SetComponents(void);
00167 
00168   private:
00169 
00171     ResamplerBase(const Self&);   // purposely not implemented
00173     void operator=(const Self&);  // purposely not implemented
00174 
00176     void ReleaseMemory( void );
00177 
00178   }; // end class ResamplerBase
00179 
00180 
00181 } // end namespace elastix
00182 
00183 
00184 #ifndef ITK_MANUAL_INSTANTIATION
00185 #include "elxResamplerBase.hxx"
00186 #endif
00187 
00188 #endif // end #ifndef __elxResamplerBase_h


Generated on 11-05-2012 for elastix by doxygen 1.7.6.1 elastix logo