00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freRigidRegistrationProcessorBase_h
00023 #define __freRigidRegistrationProcessorBase_h
00024
00025 #include "freImageRegistrationProcessorBase.h"
00026 #include "freControllerCentral.h"
00027 #include "freRegistrationObserver.h"
00028 #include "freTransformFunctionMedia.h"
00029 #include "freTransformBasedRegistrationProcessorInterface.h"
00030
00031 namespace FREE
00032 {
00033
00034
00044 template <class TRegistrationMethod, class TTransformBase, class TInterpolateBase,
00045 class TMetricBase, class TOptimizerBase, unsigned int VImageDimension>
00046 class RigidRegistrationProcessorBase
00047 : public ImageRegistrationProcessorBase<VImageDimension>,
00048 public TransformBasedRegistrationProcessorInterface< TTransformBase, VImageDimension >
00049 {
00050 public:
00052 typedef RigidRegistrationProcessorBase<TRegistrationMethod, TTransformBase, TInterpolateBase, TMetricBase, TOptimizerBase, VImageDimension> Self;
00053 typedef ImageRegistrationProcessorBase<VImageDimension> Superclass;
00054 typedef TransformBasedRegistrationProcessorInterface< TTransformBase, VImageDimension > TransformInterface;
00055 typedef itk::SmartPointer<Self> Pointer;
00056 typedef itk::SmartPointer<const Self> ConstPointer;
00057
00059 itkTypeMacro( RigidRegistrationProcessorBase, ImageRegistrationProcessorBase );
00060 itkNewMacro(Self);
00061
00063 typedef TRegistrationMethod RegistrationType;
00065 typedef typename RegistrationType::Pointer RegistrationPointer;
00066
00068 typedef TTransformBase TransformType;
00069 typedef typename TransformType::Pointer TransformPointer;
00071 typedef TInterpolateBase InterpolatorType;
00072 typedef typename InterpolatorType::Pointer InterpolatorPointer;
00074 typedef TMetricBase MetricType;
00075 typedef typename MetricType::Pointer MetricPointer;
00077 typedef TOptimizerBase OptimizerType;
00078 typedef typename OptimizerType::Pointer OptimizerPointer;
00079
00080 typedef typename Superclass::ImageType ImageType;
00081 typedef typename Superclass::RegionType RegionType;
00082 typedef typename Superclass::SpacingType SpacingType;
00083 typedef typename Superclass::ImagePointer ImagePointer;
00084 typedef typename Superclass::PointType PointType;
00085
00086 typedef typename TransformInterface::TransformFieldType TransformFieldType;
00087 typedef typename TransformInterface::TransformFieldPointer TransformFieldPointer;
00088 typedef typename TransformInterface::TransformParametersType TransformParametersType;
00089 typedef typename TransformInterface::TransformFunctionMediaType TransformFunctionMediaType;
00090 typedef typename TransformInterface::TransformFunctionMediaPointer TransformFunctionMediaPointer;
00091
00092 virtual void SetTransform(TransformType* pTransform);
00093
00094 virtual void SetInterpolator(InterpolatorType* pInterpolator);
00095 itkGetObjectMacro(Interpolator, InterpolatorType);
00096
00097 virtual void SetMetric(MetricType* pMetric);
00098 itkGetObjectMacro(Metric, MetricType);
00099
00100 virtual void SetOptimizer(OptimizerType* pOptimizer);
00101 itkGetObjectMacro(Optimizer, OptimizerType);
00102
00103 itkGetObjectMacro(Registration, RegistrationType);
00104
00107 IterationObserver::Pointer m_IterationObserver;
00108 typename NotificationEvent<RigidRegistrationProcessorBase>::Pointer m_IterationNotificationEvent;
00109
00114 virtual const long GetMaxIterationCount() const;
00115
00116 using TransformInterface::GetTransformationFunction;
00118 virtual TransformFunctionMediaPointer GetTransformationFunction();
00119
00120 using TransformInterface::GetInverseTransformationFunction;
00122 virtual TransformFunctionMediaPointer GetInverseTransformationFunction();
00123
00124 protected:
00125 RigidRegistrationProcessorBase();
00126
00127 virtual ~RigidRegistrationProcessorBase();
00128
00129 virtual void ResetInternals();
00130
00134 virtual void ComputeRegistration();
00135
00142 virtual TransformFieldPointer ComputeTransformationField(const PointType& origin,
00143 const RegionType& region,
00144 const SpacingType& spacing);
00145
00152 void OnNewIteration(void* pSender, long threadID);
00153
00155 virtual bool TransformationIsValid () const;
00156
00158 virtual void NotifyProgress(const RegistrationStatusType status, const std::string& sComment);
00159
00161 SessionComponentCache* m_pOptimizerCache;
00162
00163
00164
00165
00166
00170 InterpolatorPointer m_Interpolator;
00171
00175 MetricPointer m_Metric;
00176
00180 OptimizerPointer m_Optimizer;
00181
00183 RegistrationPointer m_Registration;
00184 };
00185
00186 }
00187
00188 #ifndef ITK_MANUAL_INSTANTIATION
00189 #include "freRigidRegistrationProcessorBase.txx"
00190 #endif
00191
00192 #endif