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 {
00104 template < class TElastix >
00105 class AdvancedBSplineTransform
00106   : public
00107   itk::AdvancedCombinationTransform<
00108   ITK_TYPENAME elx::TransformBase<TElastix>::CoordRepType,
00109   elx::TransformBase<TElastix>::FixedImageDimension > ,
00110   public
00111   TransformBase<TElastix>
00112 {
00113 public:
00114 
00116   typedef AdvancedBSplineTransform                Self;
00117   typedef itk::AdvancedCombinationTransform<
00118     typename elx::TransformBase<TElastix>::CoordRepType,
00119     elx::TransformBase<TElastix>::FixedImageDimension > Superclass1;
00120   typedef elx::TransformBase<TElastix>            Superclass2;
00121   typedef SmartPointer<Self>                      Pointer;
00122   typedef SmartPointer<const Self>                ConstPointer;
00123 
00125   itkNewMacro( Self );
00126 
00128   itkTypeMacro( AdvancedBSplineTransform, AdvancedCombinationTransform );
00129 
00134   elxClassNameMacro( "BSplineTransform" );
00135 
00137   itkStaticConstMacro( SpaceDimension, unsigned int, Superclass2::FixedImageDimension );
00138 
00142   typedef itk::AdvancedBSplineDeformableTransformBase<
00143     typename elx::TransformBase<TElastix>::CoordRepType,
00144     itkGetStaticConstMacro( SpaceDimension )>             BSplineTransformBaseType;
00145   typedef typename BSplineTransformBaseType::Pointer      BSplineTransformBasePointer;
00146 
00148   typedef itk::AdvancedBSplineDeformableTransform<
00149     typename elx::TransformBase<TElastix>::CoordRepType,
00150     itkGetStaticConstMacro( SpaceDimension ),
00151     1 >                                                   BSplineTransformLinearType;
00152   typedef itk::AdvancedBSplineDeformableTransform<
00153     typename elx::TransformBase<TElastix>::CoordRepType,
00154     itkGetStaticConstMacro( SpaceDimension ),
00155     2 >                                                   BSplineTransformQuadraticType;
00156   typedef itk::AdvancedBSplineDeformableTransform<
00157     typename elx::TransformBase<TElastix>::CoordRepType,
00158     itkGetStaticConstMacro( SpaceDimension ),
00159     3 >                                                   BSplineTransformCubicType;
00160   typedef itk::CyclicBSplineDeformableTransform<
00161     typename elx::TransformBase<TElastix>::CoordRepType,
00162     itkGetStaticConstMacro( SpaceDimension ),
00163     1 >                                                   CyclicBSplineTransformLinearType;
00164   typedef itk::CyclicBSplineDeformableTransform<
00165     typename elx::TransformBase<TElastix>::CoordRepType,
00166     itkGetStaticConstMacro( SpaceDimension ),
00167     2 >                                                   CyclicBSplineTransformQuadraticType;
00168   typedef itk::CyclicBSplineDeformableTransform<
00169     typename elx::TransformBase<TElastix>::CoordRepType,
00170     itkGetStaticConstMacro( SpaceDimension ),
00171     3 >                                                   CyclicBSplineTransformCubicType;
00172 
00174   typedef typename Superclass1::ScalarType                ScalarType;
00175   typedef typename Superclass1::ParametersType            ParametersType;
00176   typedef typename Superclass1::JacobianType              JacobianType;
00177   typedef typename Superclass1::InputVectorType           InputVectorType;
00178   typedef typename Superclass1::OutputVectorType          OutputVectorType;
00179   typedef typename Superclass1::InputCovariantVectorType  InputCovariantVectorType;
00180   typedef typename Superclass1::OutputCovariantVectorType OutputCovariantVectorType;
00181   typedef typename Superclass1::InputVnlVectorType        InputVnlVectorType;
00182   typedef typename Superclass1::OutputVnlVectorType       OutputVnlVectorType;
00183   typedef typename Superclass1::InputPointType            InputPointType;
00184   typedef typename Superclass1::OutputPointType           OutputPointType;
00185 
00187   typedef typename BSplineTransformBaseType::PixelType        PixelType;
00188   typedef typename BSplineTransformBaseType::ImageType        ImageType;
00189   typedef typename BSplineTransformBaseType::ImagePointer     ImagePointer;
00190   typedef typename BSplineTransformBaseType::RegionType       RegionType;
00191   typedef typename BSplineTransformBaseType::IndexType        IndexType;
00192   typedef typename BSplineTransformBaseType::SizeType         SizeType;
00193   typedef typename BSplineTransformBaseType::SpacingType      SpacingType;
00194   typedef typename BSplineTransformBaseType::OriginType       OriginType;
00195   typedef typename BSplineTransformBaseType::DirectionType    DirectionType;
00196   typedef typename
00197     BSplineTransformBaseType::ContinuousIndexType             ContinuousIndexType;
00198   typedef typename
00199     BSplineTransformBaseType::ParameterIndexArrayType         ParameterIndexArrayType;
00200 
00202   typedef typename Superclass2::ElastixType               ElastixType;
00203   typedef typename Superclass2::ElastixPointer            ElastixPointer;
00204   typedef typename Superclass2::ConfigurationType         ConfigurationType;
00205   typedef typename Superclass2::ConfigurationPointer      ConfigurationPointer;
00206   typedef typename Superclass2::RegistrationType          RegistrationType;
00207   typedef typename Superclass2::RegistrationPointer       RegistrationPointer;
00208   typedef typename Superclass2::CoordRepType              CoordRepType;
00209   typedef typename Superclass2::FixedImageType            FixedImageType;
00210   typedef typename Superclass2::MovingImageType           MovingImageType;
00211   typedef typename Superclass2::ITKBaseType               ITKBaseType;
00212   typedef typename Superclass2::CombinationTransformType  CombinationTransformType;
00213 
00215   typedef GridScheduleComputer<
00216     CoordRepType, SpaceDimension >                        GridScheduleComputerType;
00217   typedef CyclicGridScheduleComputer<
00218     CoordRepType, SpaceDimension >                        CyclicGridScheduleComputerType;
00219   typedef typename GridScheduleComputerType::Pointer      GridScheduleComputerPointer;
00220   typedef typename GridScheduleComputerType
00221     ::VectorGridSpacingFactorType                         GridScheduleType;
00222   typedef UpsampleBSplineParametersFilter<
00223     ParametersType, ImageType >                           GridUpsamplerType;
00224   typedef typename GridUpsamplerType::Pointer             GridUpsamplerPointer;
00225 
00230   virtual int BeforeAll( void );
00231 
00243   virtual void BeforeRegistration( void );
00244 
00249   virtual void BeforeEachResolution( void );
00250 
00256   virtual void InitializeTransform( void );
00257 
00263   virtual void IncreaseScale( void );
00264 
00266   virtual void ReadFromFile( void );
00267 
00269   virtual void WriteToFile( const ParametersType & param ) const;
00270 
00272   virtual void SetOptimizerScales( const unsigned int edgeWidth );
00273 
00274 protected:
00275 
00277   AdvancedBSplineTransform();
00278 
00280   virtual ~AdvancedBSplineTransform() {}
00281 
00283   virtual void PreComputeGridInformation( void );
00284 
00285 private:
00286 
00288   AdvancedBSplineTransform( const Self& );  // purposely not implemented
00290   void operator=( const Self& );    // purposely not implemented
00291 
00293   BSplineTransformBasePointer   m_BSplineTransform;
00294   GridScheduleComputerPointer   m_GridScheduleComputer;
00295   GridUpsamplerPointer          m_GridUpsampler;
00296 
00298   unsigned int m_SplineOrder;
00299   bool m_Cyclic;
00300 
00302   unsigned int InitializeBSplineTransform();
00303 
00304 }; // end class AdvancedBSplineTransform
00305 
00306 
00307 } // end namespace elastix
00308 
00309 #ifndef ITK_MANUAL_INSTANTIATION
00310 #include "elxAdvancedBSplineTransform.hxx"
00311 #endif
00312 
00313 #endif // end #ifndef __elxAdvancedBSplineTransform_h
00314 


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