go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkDistancePreservingRigidityPenaltyTerm.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkDistancePreservingRigidityPenaltyTerm_h
19 #define __itkDistancePreservingRigidityPenaltyTerm_h
20 
22 
26 
28 #include "itkNeighborhood.h"
29 #include "itkImageRegionIterator.h"
30 #include "itkNeighborhoodOperatorImageFilter.h"
31 #include "itkNeighborhoodIterator.h"
32 
33 #include "itkImageRegionIterator.h"
34 #include "itkMultiResolutionPyramidImageFilter.h"
35 
36 namespace itk
37 {
75 template< class TFixedImage, class TScalarType >
77  public TransformPenaltyTerm< TFixedImage, TScalarType >
78 {
79 public:
80 
85  typedef SmartPointer< const Self > ConstPointer;
86 
88  itkNewMacro( Self );
89 
92 
111  typedef typename Superclass::RealType RealType;
129 
136 
138  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
139  itkStaticConstMacro( MovingImageDimension, unsigned int, FixedImageType::ImageDimension );
140  itkStaticConstMacro( ImageDimension, unsigned int, FixedImageType::ImageDimension );
141 
143  virtual void Initialize( void ) throw ( ExceptionObject );
144 
146  typedef AdvancedBSplineDeformableTransform< ScalarType, FixedImageDimension, 3 > BSplineTransformType;
147  typedef typename BSplineTransformType::Pointer BSplineTransformPointer;
148  typedef typename BSplineTransformType::SpacingType GridSpacingType;
149  typedef typename BSplineTransformType::ImageType CoefficientImageType;
150  typedef typename CoefficientImageType::Pointer CoefficientImagePointer;
151  typedef typename CoefficientImageType::SpacingType CoefficientImageSpacingType;
152  typedef AdvancedCombinationTransform< ScalarType, FixedImageDimension > CombinationTransformType;
153 
155  virtual MeasureType GetValue( const ParametersType & parameters ) const;
156 
158  virtual void GetDerivative( const ParametersType & parameters, DerivativeType & derivative ) const;
159 
161  virtual void GetValueAndDerivative( const ParametersType & parameters, MeasureType & value, DerivativeType & derivative ) const;
162 
166  itkSetObjectMacro( BSplineTransform, BSplineTransformType );
167 
169  typedef Image< signed short, itkGetStaticConstMacro( MovingImageDimension ) > BSplineKnotImageType;
170  typedef typename BSplineKnotImageType::Pointer BSplineKnotImagePointer;
171  typedef typename BSplineKnotImageType::RegionType BSplineKnotImageRegionType;
172 
174  typedef Image< signed short, itkGetStaticConstMacro( MovingImageDimension ) > PenaltyGridImageType;
175  typedef typename PenaltyGridImageType::Pointer PenaltyGridImagePointer;
176  typedef typename PenaltyGridImageType::RegionType PenaltyGridImageRegionType;
177 
179  typedef Image< signed short, itkGetStaticConstMacro( MovingImageDimension ) > SegmentedImageType;
180  typedef typename SegmentedImageType::Pointer SegmentedImagePointer;
181  typedef typename SegmentedImageType::RegionType SegmentedImageRegionType;
182 
184  itkSetObjectMacro( SegmentedImage, SegmentedImageType );
185 
187  itkGetObjectMacro( SegmentedImage, SegmentedImageType );
188 
190  itkSetObjectMacro( SampledSegmentedImage, SegmentedImageType );
191 
193  itkGetObjectMacro( SampledSegmentedImage, SegmentedImageType );
194 
195  itkGetMacro( NumberOfRigidGrids, unsigned int );
196 
197 protected:
198 
201 
203  virtual ~DistancePreservingRigidityPenaltyTerm() {}
204 
206  void PrintSelf( std::ostream & os, Indent indent ) const;
207 
208 private:
209 
211  DistancePreservingRigidityPenaltyTerm( const Self & ); // purposely not implemented
212 
214  void operator=( const Self & ); // purposely not implemented
215 
218 
219  mutable MeasureType m_RigidityPenaltyTermValue;
220 
225 
226  unsigned int m_NumberOfRigidGrids;
227 
228 };
229 
230 // end class DistancePreservingRigidityPenaltyTerm
231 
232 } // end namespace itk
233 
234 #ifndef ITK_MANUAL_INSTANTIATION
235 #include "itkDistancePreservingRigidityPenaltyTerm.hxx"
236 #endif
237 
238 #endif // #ifndef __itkDistancePreservingRigidityPenaltyTerm_h
A cost function that calculates a penalty term on a transformation.
This class combines two transforms: an 'initial transform' with a 'current transform'.
Superclass::DerivativeValueType DerivativeValueType
TransformPenaltyTerm< TFixedImage, TScalarType > Superclass
Deformable transform using a B-spline representation.
Superclass::FixedImagePixelType FixedImagePixelType
Superclass::TransformParametersType TransformParametersType
Superclass::GradientImageType GradientImageType
Superclass::MeasureType MeasureType
Superclass::MovingImageType MovingImageType
Superclass::InterpolatorType InterpolatorType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::InputPointType InputPointType
Superclass::FixedImageRegionType FixedImageRegionType
TransformType::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
virtual void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Superclass::TransformJacobianType TransformJacobianType
virtual MeasureType GetValue(const ParametersType &parameters) const
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::FixedImageType FixedImageType
Superclass::GradientImagePointer GradientImagePointer
Superclass::MovingImagePixelType MovingImagePixelType
TransformType::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
virtual void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::ParametersType ParametersType
Superclass::OutputPointType OutputPointType
TransformType::SpatialJacobianType SpatialJacobianType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
TransformType::InternalMatrixType InternalMatrixType
Superclass::FixedImagePointer FixedImagePointer
Superclass::DerivativeType DerivativeType
TransformType::SpatialHessianType SpatialHessianType
Superclass::GradientPixelType GradientPixelType
Superclass::MovingImagePointer MovingImagePointer
Superclass::AdvancedTransformType TransformType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
void PrintSelf(std::ostream &os, Indent indent) const
Superclass::FixedImageConstPointer FixedImageConstPointer


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo