go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxAdvancedBSplineTransform.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 #ifndef __elxAdvancedBSplineTransform_h
00015 #define __elxAdvancedBSplineTransform_h
00016 
00017 #include "itkAdvancedCombinationTransform.h"
00018 #include "itkAdvancedBSplineDeformableTransform.h"
00019 
00020 #include "itkGridScheduleComputer.h"
00021 #include "itkCyclicBSplineDeformableTransform.h"
00022 #include "itkCyclicGridScheduleComputer.h"
00023 #include "itkUpsampleBSplineParametersFilter.h"
00024 
00025 #include "elxIncludes.h"
00026 
00027 
00028 namespace elastix
00029 {
00030 using namespace itk;
00031 
00106 template < class TElastix >
00107 class AdvancedBSplineTransform
00108   : public
00109   AdvancedCombinationTransform<
00110   ITK_TYPENAME elx::TransformBase<TElastix>::CoordRepType,
00111   elx::TransformBase<TElastix>::FixedImageDimension > ,
00112   public
00113   TransformBase<TElastix>
00114 {
00115 public:
00116 
00118   typedef AdvancedBSplineTransform                Self;
00119   typedef AdvancedCombinationTransform<
00120     typename elx::TransformBase<TElastix>::CoordRepType,
00121     elx::TransformBase<TElastix>::FixedImageDimension > Superclass1;
00122   typedef elx::TransformBase<TElastix>            Superclass2;
00123   typedef SmartPointer<Self>                      Pointer;
00124   typedef SmartPointer<const Self>                ConstPointer;
00125 
00127   itkNewMacro( Self );
00128 
00130   itkTypeMacro( AdvancedBSplineTransform, AdvancedCombinationTransform );
00131 
00136   elxClassNameMacro( "BSplineTransform" );
00137 
00139   itkStaticConstMacro( SpaceDimension, unsigned int, Superclass2::FixedImageDimension );
00140 
00144   typedef itk::AdvancedBSplineDeformableTransformBase<
00145     typename elx::TransformBase<TElastix>::CoordRepType,
00146     itkGetStaticConstMacro( SpaceDimension )>             BSplineTransformBaseType;
00147   typedef typename BSplineTransformBaseType::Pointer      BSplineTransformBasePointer;
00148 
00150   typedef itk::AdvancedBSplineDeformableTransform<
00151     typename elx::TransformBase<TElastix>::CoordRepType,
00152     itkGetStaticConstMacro( SpaceDimension ),
00153     1 >                                                   BSplineTransformLinearType;
00154   typedef itk::AdvancedBSplineDeformableTransform<
00155     typename elx::TransformBase<TElastix>::CoordRepType,
00156     itkGetStaticConstMacro( SpaceDimension ),
00157     2 >                                                   BSplineTransformQuadraticType;
00158   typedef itk::AdvancedBSplineDeformableTransform<
00159     typename elx::TransformBase<TElastix>::CoordRepType,
00160     itkGetStaticConstMacro( SpaceDimension ),
00161     3 >                                                   BSplineTransformCubicType;
00162   typedef itk::CyclicBSplineDeformableTransform<
00163     typename elx::TransformBase<TElastix>::CoordRepType,
00164     itkGetStaticConstMacro( SpaceDimension ),
00165     1 >                                                   CyclicBSplineTransformLinearType;
00166   typedef itk::CyclicBSplineDeformableTransform<
00167     typename elx::TransformBase<TElastix>::CoordRepType,
00168     itkGetStaticConstMacro( SpaceDimension ),
00169     2 >                                                   CyclicBSplineTransformQuadraticType;
00170   typedef itk::CyclicBSplineDeformableTransform<
00171     typename elx::TransformBase<TElastix>::CoordRepType,
00172     itkGetStaticConstMacro( SpaceDimension ),
00173     3 >                                                   CyclicBSplineTransformCubicType;
00174 
00176   typedef typename Superclass1::ScalarType                ScalarType;
00177   typedef typename Superclass1::ParametersType            ParametersType;
00178   typedef typename Superclass1::JacobianType              JacobianType;
00179   typedef typename Superclass1::InputVectorType           InputVectorType;
00180   typedef typename Superclass1::OutputVectorType          OutputVectorType;
00181   typedef typename Superclass1::InputCovariantVectorType  InputCovariantVectorType;
00182   typedef typename Superclass1::OutputCovariantVectorType OutputCovariantVectorType;
00183   typedef typename Superclass1::InputVnlVectorType        InputVnlVectorType;
00184   typedef typename Superclass1::OutputVnlVectorType       OutputVnlVectorType;
00185   typedef typename Superclass1::InputPointType            InputPointType;
00186   typedef typename Superclass1::OutputPointType           OutputPointType;
00187 
00189   typedef typename BSplineTransformBaseType::PixelType        PixelType;
00190   typedef typename BSplineTransformBaseType::ImageType        ImageType;
00191   typedef typename BSplineTransformBaseType::ImagePointer     ImagePointer;
00192   typedef typename BSplineTransformBaseType::RegionType       RegionType;
00193   typedef typename BSplineTransformBaseType::IndexType        IndexType;
00194   typedef typename BSplineTransformBaseType::SizeType         SizeType;
00195   typedef typename BSplineTransformBaseType::SpacingType      SpacingType;
00196   typedef typename BSplineTransformBaseType::OriginType       OriginType;
00197   typedef typename BSplineTransformBaseType::DirectionType    DirectionType;
00198   typedef typename
00199     BSplineTransformBaseType::BulkTransformType               BulkTransformType;
00200   typedef typename
00201     BSplineTransformBaseType::BulkTransformPointer            BulkTransformPointer;
00202   typedef typename
00203     BSplineTransformBaseType::ContinuousIndexType             ContinuousIndexType;
00204   typedef typename
00205     BSplineTransformBaseType::ParameterIndexArrayType         ParameterIndexArrayType;
00206 
00208   typedef typename Superclass2::ElastixType               ElastixType;
00209   typedef typename Superclass2::ElastixPointer            ElastixPointer;
00210   typedef typename Superclass2::ConfigurationType         ConfigurationType;
00211   typedef typename Superclass2::ConfigurationPointer      ConfigurationPointer;
00212   typedef typename Superclass2::RegistrationType          RegistrationType;
00213   typedef typename Superclass2::RegistrationPointer       RegistrationPointer;
00214   typedef typename Superclass2::CoordRepType              CoordRepType;
00215   typedef typename Superclass2::FixedImageType            FixedImageType;
00216   typedef typename Superclass2::MovingImageType           MovingImageType;
00217   typedef typename Superclass2::ITKBaseType               ITKBaseType;
00218   typedef typename Superclass2::CombinationTransformType  CombinationTransformType;
00219 
00221   typedef GridScheduleComputer<
00222     CoordRepType, SpaceDimension >                        GridScheduleComputerType;
00223   typedef CyclicGridScheduleComputer<
00224     CoordRepType, SpaceDimension >                        CyclicGridScheduleComputerType;
00225   typedef typename GridScheduleComputerType::Pointer      GridScheduleComputerPointer;
00226   typedef typename GridScheduleComputerType
00227     ::VectorGridSpacingFactorType                         GridScheduleType;
00228   typedef UpsampleBSplineParametersFilter<
00229     ParametersType, ImageType >                           GridUpsamplerType;
00230   typedef typename GridUpsamplerType::Pointer             GridUpsamplerPointer;
00231 
00236   virtual int BeforeAll( void );
00237 
00249   virtual void BeforeRegistration( void );
00250 
00255   virtual void BeforeEachResolution( void );
00256 
00262   virtual void InitializeTransform( void );
00263 
00269   virtual void IncreaseScale( void );
00270 
00272   virtual void ReadFromFile( void );
00273 
00275   virtual void WriteToFile( const ParametersType & param ) const;
00276 
00278   virtual void SetOptimizerScales( const unsigned int edgeWidth );
00279 
00280 protected:
00281 
00283   AdvancedBSplineTransform();
00284 
00286   virtual ~AdvancedBSplineTransform() {}
00287 
00289   virtual void PreComputeGridInformation( void );
00290 
00291 private:
00292 
00294   AdvancedBSplineTransform( const Self& );  // purposely not implemented
00296   void operator=( const Self& );    // purposely not implemented
00297 
00299   BSplineTransformBasePointer   m_BSplineTransform;
00300   GridScheduleComputerPointer   m_GridScheduleComputer;
00301   GridUpsamplerPointer          m_GridUpsampler;
00302 
00304   unsigned int m_SplineOrder;
00305   bool m_Cyclic;
00306 
00308   unsigned int InitializeBSplineTransform();
00309 
00310 }; // end class AdvancedBSplineTransform
00311 
00312 
00313 } // end namespace elastix
00314 
00315 #ifndef ITK_MANUAL_INSTANTIATION
00316 #include "elxAdvancedBSplineTransform.hxx"
00317 #endif
00318 
00319 #endif // end #ifndef __elxAdvancedBSplineTransform_h
00320 


Generated on 11-05-2011 for elastix by doxygen 1.7.4 elastix logo