ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkPointSetToPointSetRegistrationMethod.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkPointSetToPointSetRegistrationMethod_h
00019 #define __itkPointSetToPointSetRegistrationMethod_h
00020 
00021 #include "itkProcessObject.h"
00022 #include "itkPointSetToPointSetMetric.h"
00023 #include "itkMultipleValuedNonLinearOptimizer.h"
00024 #include "itkDataObjectDecorator.h"
00025 
00026 namespace itk
00027 {
00062 template< typename TFixedPointSet, typename TMovingPointSet >
00063 class ITK_EXPORT PointSetToPointSetRegistrationMethod:public ProcessObject
00064 {
00065 public:
00067   typedef PointSetToPointSetRegistrationMethod Self;
00068   typedef ProcessObject                        Superclass;
00069   typedef SmartPointer< Self >                 Pointer;
00070   typedef SmartPointer< const Self >           ConstPointer;
00071 
00073   itkNewMacro(Self);
00074 
00076   itkTypeMacro(PointSetToPointSetRegistrationMethod, ProcessObject);
00077 
00079   typedef          TFixedPointSet                  FixedPointSetType;
00080   typedef typename FixedPointSetType::ConstPointer FixedPointSetConstPointer;
00081 
00083   typedef          TMovingPointSet                  MovingPointSetType;
00084   typedef typename MovingPointSetType::ConstPointer MovingPointSetConstPointer;
00085 
00087   typedef PointSetToPointSetMetric< FixedPointSetType, MovingPointSetType > MetricType;
00088   typedef typename MetricType::Pointer                                      MetricPointer;
00089 
00091   typedef  typename MetricType::TransformType TransformType;
00092   typedef  typename TransformType::Pointer    TransformPointer;
00093 
00096   typedef  DataObjectDecorator< TransformType >      TransformOutputType;
00097   typedef typename TransformOutputType::Pointer      TransformOutputPointer;
00098   typedef typename TransformOutputType::ConstPointer TransformOutputConstPointer;
00099 
00101   typedef   MultipleValuedNonLinearOptimizer OptimizerType;
00102 
00105   typedef  typename MetricType::TransformParametersType ParametersType;
00106 
00108   typedef typename DataObject::Pointer DataObjectPointer;
00109 
00111   void StartRegistration(void);
00112 
00114   itkSetConstObjectMacro(FixedPointSet, FixedPointSetType);
00115   itkGetConstObjectMacro(FixedPointSet, FixedPointSetType);
00117 
00119   itkSetConstObjectMacro(MovingPointSet, MovingPointSetType);
00120   itkGetConstObjectMacro(MovingPointSet, MovingPointSetType);
00122 
00124   itkSetObjectMacro(Optimizer,  OptimizerType);
00125   itkGetObjectMacro(Optimizer,  OptimizerType);
00127 
00129   itkSetObjectMacro(Metric, MetricType);
00130   itkGetObjectMacro(Metric, MetricType);
00132 
00134   itkSetObjectMacro(Transform, TransformType);
00135   itkGetObjectMacro(Transform, TransformType);
00137 
00139   virtual void SetInitialTransformParameters(const ParametersType & param);
00140 
00141   itkGetConstReferenceMacro(InitialTransformParameters, ParametersType);
00142 
00145   itkGetConstReferenceMacro(LastTransformParameters, ParametersType);
00146 
00148   void Initialize()
00149   throw ( ExceptionObject );
00150 
00152   const TransformOutputType * GetOutput() const;
00153 
00156   typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
00157   using Superclass::MakeOutput;
00158   virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx);
00159 
00162   unsigned long GetMTime() const;
00163 
00164 protected:
00165   PointSetToPointSetRegistrationMethod();
00166   virtual ~PointSetToPointSetRegistrationMethod() {}
00167   void PrintSelf(std::ostream & os, Indent indent) const;
00168 
00171   void  GenerateData();
00172 
00173 private:
00174   PointSetToPointSetRegistrationMethod(const Self &); //purposely not
00175                                                       // implemented
00176   void operator=(const Self &);                       //purposely not
00177 
00178   // implemented
00179 
00180   MetricPointer          m_Metric;
00181   OptimizerType::Pointer m_Optimizer;
00182 
00183   MovingPointSetConstPointer m_MovingPointSet;
00184   FixedPointSetConstPointer  m_FixedPointSet;
00185 
00186   TransformPointer m_Transform;
00187 
00188   ParametersType m_InitialTransformParameters;
00189   ParametersType m_LastTransformParameters;
00190 };
00191 } // end namespace itk
00192 
00193 #ifndef ITK_MANUAL_INSTANTIATION
00194 #include "itkPointSetToPointSetRegistrationMethod.hxx"
00195 #endif
00196 
00197 #endif
00198