Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __cmtkImagePairNonrigidRegistration_h_included_
00034 #define __cmtkImagePairNonrigidRegistration_h_included_
00035
00036 #include <cmtkconfig.h>
00037
00038 #include <Base/cmtkSplineWarpXform.h>
00039 #include <Registration/cmtkImagePairRegistration.h>
00040
00041 #include <string.h>
00042
00043 namespace
00044 cmtk
00045 {
00046
00049
00056 class ImagePairNonrigidRegistration :
00058 public ImagePairRegistration
00059 {
00060 public:
00062 typedef ImagePairNonrigidRegistration Self;
00063
00065 typedef ImagePairRegistration Superclass;
00066
00067 protected:
00069 SplineWarpXform::SmartPtr InitialWarpXform;
00070
00072 SplineWarpXform::SmartPtr InverseWarpXform;
00073
00075 cmtkGetSetMacro(bool,MatchFltToRefHistogram);
00076
00082 cmtkGetSetMacroDefault(bool,RepeatMatchFltToRefHistogram,true);
00083
00085 cmtkGetSetMacro(int,RefineGrid);
00086
00091 cmtkGetSetMacro(bool,DelayRefineGrid);
00092
00094 cmtkGetSetMacro(Types::Coordinate,GridSpacing);
00095
00102 cmtkGetSetMacro(bool,ExactGridSpacing);
00103
00105 unsigned int IgnoreEdge;
00106
00109 const char* RestrictToAxes;
00110
00112 cmtkGetSetMacro(bool,FastMode);
00113
00115 cmtkGetSetMacro(bool,AdaptiveFixParameters);
00116
00124 cmtkGetSetMacro(float,AdaptiveFixThreshFactor);
00125
00127 cmtkGetSetMacro(float,JacobianConstraintWeight);
00128
00130 cmtkGetSetMacro(float,GridEnergyWeight);
00131
00133 cmtkGetSetMacro(float,RelaxWeight);
00134
00140 cmtkGetSetMacro(float,InverseConsistencyWeight);
00141
00143 cmtkGetSetMacro(float,LandmarkErrorWeight);
00144
00146 bool m_RelaxToUnfold;
00147
00151 ImagePairNonrigidRegistration();
00152
00156 virtual ~ImagePairNonrigidRegistration() {};
00157
00167 virtual CallbackResult InitRegistration ();
00168
00171 virtual void EnterResolution( CoordinateVector::SmartPtr&, Functional::SmartPtr&, const int, const int );
00172
00179 virtual int DoneResolution( CoordinateVector::SmartPtr&, Functional::SmartPtr&, const int, const int );
00181
00183 SplineWarpXform::SmartPtr GetTransformation() const
00184 {
00185 return SplineWarpXform::SmartPtr::DynamicCastFrom( this->m_Xform );
00186 }
00187
00189 const UniformVolume::SmartPtr GetReformattedFloatingImage( Interpolators::InterpolationEnum interpolator = Interpolators::LINEAR ) const;
00190
00191 private:
00193 MatchedLandmarkList::SmartPtr m_MatchedLandmarks;
00194
00196 int RefinedGridAtLevel;
00197
00199 int RefineGridCount;
00200
00202 bool RelaxationStep;
00203
00205 bool RefineDelayed;
00206
00214 SplineWarpXform::SmartPtr MakeWarpXform( const UniformVolume::CoordinateVectorType& size, const AffineXform* initialAffine ) const;
00215
00217 class LevelParameters
00219 : public Superclass::LevelParameters
00220 {
00221 public:
00223 LevelParameters( const Types::Coordinate resolution ) : m_Resolution( resolution ) {}
00224
00226 Types::Coordinate m_Resolution;
00227 };
00228
00231 virtual Functional* MakeFunctional( const int level, const Superclass::LevelParameters* levelParameters );
00232 };
00233
00235
00236 }
00237
00238 #endif // __cmtkImagePairNonrigidRegistration_h_included_