ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkBSplineSmoothingOnUpdateDisplacementFieldTransform.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 __itkBSplineSmoothingOnUpdateDisplacementFieldTransform_h
00019 #define __itkBSplineSmoothingOnUpdateDisplacementFieldTransform_h
00020 
00021 #include "itkDisplacementFieldTransform.h"
00022 
00023 #include "itkBSplineScatteredDataPointSetToImageFilter.h"
00024 #include "itkPointSet.h"
00025 
00026 namespace itk
00027 {
00028 
00051 template<class TScalar, unsigned int NDimensions>
00052 class ITK_EXPORT BSplineSmoothingOnUpdateDisplacementFieldTransform :
00053   public DisplacementFieldTransform<TScalar, NDimensions>
00054 {
00055 public:
00057   typedef BSplineSmoothingOnUpdateDisplacementFieldTransform    Self;
00058   typedef DisplacementFieldTransform<TScalar, NDimensions>      Superclass;
00059   typedef SmartPointer<Self>                                    Pointer;
00060   typedef SmartPointer<const Self>                              ConstPointer;
00061 
00063   itkTypeMacro( BSplineSmoothingOnUpdateDisplacementFieldTransform, DisplacementFieldTransform );
00064 
00066   itkNewMacro( Self );
00067 
00069   itkStaticConstMacro( Dimension, unsigned int, NDimensions );
00070 
00072   typedef typename Superclass::ScalarType               ScalarType;
00073   typedef typename Superclass::DerivativeType           DerivativeType;
00074   typedef typename DerivativeType::ValueType            DerivativeValueType;
00075   typedef typename Superclass::DisplacementFieldType    DisplacementFieldType;
00076   typedef typename Superclass::DisplacementFieldPointer DisplacementFieldPointer;
00077 
00082   typedef typename DisplacementFieldType::PixelType                                         DisplacementVectorType;
00083   typedef PointSet<DisplacementVectorType, Dimension>                                       PointSetType;
00084   typedef unsigned int                                                                      SplineOrderType;
00085   typedef BSplineScatteredDataPointSetToImageFilter<PointSetType, DisplacementFieldType>    BSplineFilterType;
00086   typedef typename BSplineFilterType::WeightsContainerType                                  WeightsContainerType;
00087   typedef typename BSplineFilterType::PointDataImageType                                    DisplacementFieldControlPointLatticeType;
00088   typedef typename BSplineFilterType::ArrayType                                             ArrayType;
00089   typedef typename ArrayType::ValueType                                                     ArrayValueType;
00090 
00101   virtual void UpdateTransformParameters( DerivativeType & update, ScalarType factor = 1.0 );
00102 
00106   itkSetMacro( SplineOrder, SplineOrderType );
00107 
00111   itkGetConstMacro( SplineOrder, SplineOrderType );
00112 
00120   itkSetMacro( NumberOfControlPointsForTheUpdateField, ArrayType );
00121 
00129   itkGetConstMacro( NumberOfControlPointsForTheUpdateField, ArrayType );
00130 
00137   void SetMeshSizeForTheUpdateField( const ArrayType & );
00138 
00146   itkSetMacro( NumberOfControlPointsForTheTotalField, ArrayType );
00147 
00155   itkGetConstMacro( NumberOfControlPointsForTheTotalField, ArrayType );
00156 
00163   void SetMeshSizeForTheTotalField( const ArrayType & );
00164 
00165 protected:
00166   BSplineSmoothingOnUpdateDisplacementFieldTransform();
00167   virtual ~BSplineSmoothingOnUpdateDisplacementFieldTransform();
00168 
00169   void PrintSelf( std::ostream& os, Indent indent ) const;
00170 
00174    DisplacementFieldPointer BSplineSmoothDisplacementField( const DisplacementFieldType *, const ArrayType & );
00175 
00176 private:
00177   BSplineSmoothingOnUpdateDisplacementFieldTransform( const Self& ); //purposely not implemented
00178   void operator=( const Self& ); //purposely not implemented
00179 
00180   SplineOrderType             m_SplineOrder;
00181   ArrayType                   m_NumberOfControlPointsForTheUpdateField;
00182   ArrayType                   m_NumberOfControlPointsForTheTotalField;
00183 };
00184 
00185 } // end namespace itk
00186 
00187 #if ITK_TEMPLATE_EXPLICIT
00188 # include "Templates/itkBSplineSmoothingOnUpdateDisplacementFieldTransform+-.h"
00189 #endif
00190 
00191 #if ITK_TEMPLATE_TXX
00192 # include "itkBSplineSmoothingOnUpdateDisplacementFieldTransform.hxx"
00193 #endif
00194 
00195 #endif // __itkBSplineSmoothingOnUpdateDisplacementFieldTransform_h
00196