ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 00078 typedef typename Transform<TScalar,NDimensions,NDimensions>::Pointer 00079 TransformPointer; 00080 00085 typedef typename DisplacementFieldType::PixelType DisplacementVectorType; 00086 typedef PointSet<DisplacementVectorType, Dimension> PointSetType; 00087 typedef unsigned int SplineOrderType; 00088 typedef BSplineScatteredDataPointSetToImageFilter<PointSetType, DisplacementFieldType> BSplineFilterType; 00089 typedef typename BSplineFilterType::WeightsContainerType WeightsContainerType; 00090 typedef typename BSplineFilterType::PointDataImageType DisplacementFieldControlPointLatticeType; 00091 typedef typename BSplineFilterType::ArrayType ArrayType; 00092 typedef typename ArrayType::ValueType ArrayValueType; 00093 00104 virtual void UpdateTransformParameters( DerivativeType & update, ScalarType factor = 1.0 ); 00105 00109 itkSetMacro( SplineOrder, SplineOrderType ); 00110 00114 itkGetConstMacro( SplineOrder, SplineOrderType ); 00115 00123 itkSetMacro( NumberOfControlPointsForTheUpdateField, ArrayType ); 00124 00132 itkGetConstMacro( NumberOfControlPointsForTheUpdateField, ArrayType ); 00133 00140 void SetMeshSizeForTheUpdateField( const ArrayType & ); 00141 00149 itkSetMacro( NumberOfControlPointsForTheTotalField, ArrayType ); 00150 00158 itkGetConstMacro( NumberOfControlPointsForTheTotalField, ArrayType ); 00159 00166 void SetMeshSizeForTheTotalField( const ArrayType & ); 00167 00168 protected: 00169 BSplineSmoothingOnUpdateDisplacementFieldTransform(); 00170 virtual ~BSplineSmoothingOnUpdateDisplacementFieldTransform(); 00171 00172 void PrintSelf( std::ostream& os, Indent indent ) const; 00173 00175 virtual typename LightObject::Pointer InternalClone() const; 00176 00180 DisplacementFieldPointer BSplineSmoothDisplacementField( const DisplacementFieldType *, const ArrayType & ); 00181 00182 private: 00183 BSplineSmoothingOnUpdateDisplacementFieldTransform( const Self& ); //purposely not implemented 00184 void operator=( const Self& ); //purposely not implemented 00185 00186 SplineOrderType m_SplineOrder; 00187 ArrayType m_NumberOfControlPointsForTheUpdateField; 00188 ArrayType m_NumberOfControlPointsForTheTotalField; 00189 }; 00190 00191 } // end namespace itk 00192 00193 #if ITK_TEMPLATE_EXPLICIT 00194 # include "Templates/itkBSplineSmoothingOnUpdateDisplacementFieldTransform+-.h" 00195 #endif 00196 00197 #if ITK_TEMPLATE_TXX 00198 # include "itkBSplineSmoothingOnUpdateDisplacementFieldTransform.hxx" 00199 #endif 00200 00201 #endif // __itkBSplineSmoothingOnUpdateDisplacementFieldTransform_h 00202