go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxRegistrationBase.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 __elxRegistrationBase_h
00016 #define __elxRegistrationBase_h
00017 
00019 #include "elxMacro.h"
00020 
00021 #include "elxBaseComponentSE.h"
00022 #include "itkMultiResolutionImageRegistrationMethod2.h"
00023 
00025 #include "itkImageMaskSpatialObject2.h"
00026 #include "itkErodeMaskImageFilter.h"
00027 
00028 
00029 namespace elastix
00030 {
00031 using namespace itk;
00032 
00073   template <class TElastix>
00074     class RegistrationBase : public BaseComponentSE<TElastix>
00075   {
00076   public:
00077 
00079     typedef RegistrationBase            Self;
00080     typedef BaseComponentSE<TElastix>   Superclass;
00081 
00083     itkTypeMacro( RegistrationBase, BaseComponentSE );
00084 
00086     typedef typename Superclass::ElastixType            ElastixType;
00087     typedef typename Superclass::ElastixPointer         ElastixPointer;
00088     typedef typename Superclass::ConfigurationType      ConfigurationType;
00089     typedef typename Superclass::ConfigurationPointer   ConfigurationPointer;
00090     typedef typename Superclass::RegistrationType       RegistrationType;
00091     typedef typename Superclass::RegistrationPointer    RegistrationPointer;
00092 
00094     typedef typename ElastixType::FixedImageType    FixedImageType;
00095     typedef typename ElastixType::MovingImageType   MovingImageType;
00096 
00098     itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
00100     itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
00101 
00103     typedef itk::MultiResolutionImageRegistrationMethod2<
00104       FixedImageType, MovingImageType >       ITKBaseType;
00105 
00107     typedef std::vector<bool>                 UseMaskErosionArrayType;
00108 
00110     virtual ITKBaseType * GetAsITKBaseType(void)
00111     {
00112       return dynamic_cast<ITKBaseType *>(this);
00113     }
00114 
00116     virtual const ITKBaseType * GetAsITKBaseType(void) const
00117     {
00118       return dynamic_cast<const ITKBaseType *>(this);
00119     }
00120 
00141     virtual bool ReadMaskParameters(
00142       UseMaskErosionArrayType & useMaskErosionArray,
00143       const unsigned int nrOfMasks,
00144       const std::string & whichMask,
00145       const unsigned int level ) const;
00146 
00150     virtual void AfterEachResolutionBase( void );
00151 
00152   protected:
00153 
00155     RegistrationBase() {}
00157     virtual ~RegistrationBase() {}
00158 
00160     typedef typename ElastixType::MaskPixelType           MaskPixelType;
00161     typedef typename ElastixType::FixedMaskType           FixedMaskImageType;
00162     typedef typename ElastixType::MovingMaskType          MovingMaskImageType;
00163     typedef typename FixedMaskImageType::Pointer          FixedMaskImagePointer;
00164     typedef typename MovingMaskImageType::Pointer         MovingMaskImagePointer;
00165     typedef ImageMaskSpatialObject2<
00166       itkGetStaticConstMacro( FixedImageDimension ) >     FixedMaskSpatialObjectType;
00167     typedef ImageMaskSpatialObject2<
00168       itkGetStaticConstMacro( MovingImageDimension ) >    MovingMaskSpatialObjectType;
00169     typedef typename
00170       FixedMaskSpatialObjectType::Pointer                 FixedMaskSpatialObjectPointer;
00171     typedef typename
00172       MovingMaskSpatialObjectType::Pointer                MovingMaskSpatialObjectPointer;
00173 
00174     typedef typename ITKBaseType::FixedImagePyramidType   FixedImagePyramidType;
00175     typedef typename ITKBaseType::MovingImagePyramidType  MovingImagePyramidType;
00176 
00178     typedef ErodeMaskImageFilter< FixedMaskImageType >    FixedMaskErodeFilterType;
00179     typedef typename FixedMaskErodeFilterType::Pointer    FixedMaskErodeFilterPointer;
00180     typedef ErodeMaskImageFilter< MovingMaskImageType >   MovingMaskErodeFilterType;
00181     typedef typename MovingMaskErodeFilterType::Pointer   MovingMaskErodeFilterPointer;
00182 
00195     FixedMaskSpatialObjectPointer GenerateFixedMaskSpatialObject(
00196       const FixedMaskImageType * maskImage, bool useMaskErosion,
00197       const FixedImagePyramidType * pyramid, unsigned int level ) const;
00198 
00211     MovingMaskSpatialObjectPointer GenerateMovingMaskSpatialObject(
00212       const MovingMaskImageType * maskImage, bool useMaskErosion,
00213       const MovingImagePyramidType * pyramid, unsigned int level ) const;
00214 
00215   private:
00216 
00218     RegistrationBase( const Self& );  // purposely not implemented
00220     void operator=( const Self& );    // purposely not implemented
00221 
00222   }; // end class RegistrationBase
00223 
00224 
00225 } // end namespace elastix
00226 
00227 
00228 #ifndef ITK_MANUAL_INSTANTIATION
00229 #include "elxRegistrationBase.hxx"
00230 #endif
00231 
00232 #endif // end #ifndef __elxRegistrationBase_h


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