go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkTransformRigidityPenaltyTerm.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkTransformRigidityPenaltyTerm_h
16 #define __itkTransformRigidityPenaltyTerm_h
17 
19 
23 
25 #include "itkNeighborhood.h"
26 #include "itkImageRegionIterator.h"
27 #include "itkNeighborhoodOperatorImageFilter.h"
28 #include "itkNeighborhoodIterator.h"
29 
31 #include "itkGrayscaleDilateImageFilter.h"
32 #include "itkBinaryBallStructuringElement.h"
33 #include "itkImageRegionIterator.h"
34 
35 
36 namespace itk
37 {
68 template< class TFixedImage, class TScalarType >
70  : public TransformPenaltyTerm< TFixedImage, TScalarType >
71 {
72 public:
73 
76  typedef TransformPenaltyTerm<
77  TFixedImage, TScalarType > Superclass;
78  typedef SmartPointer<Self> Pointer;
79  typedef SmartPointer<const Self> ConstPointer;
80 
82  itkNewMacro( Self );
83 
86 
105  typedef typename Superclass::RealType RealType;
123 
126  typedef typename Superclass
129  typedef typename Superclass
132 
134  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
135  itkStaticConstMacro( MovingImageDimension, unsigned int, FixedImageType::ImageDimension );
136  itkStaticConstMacro( ImageDimension, unsigned int, FixedImageType::ImageDimension );
137 
139  virtual void Initialize( void ) throw ( ExceptionObject );
140 
143  FixedImageDimension, 3 > BSplineTransformType;
145  typedef typename BSplineTransformType::SpacingType GridSpacingType;
146  typedef typename BSplineTransformType::ImageType CoefficientImageType;
147  typedef typename CoefficientImageType::Pointer CoefficientImagePointer;
148  typedef typename CoefficientImageType::SpacingType CoefficientImageSpacingType;
149  typedef AdvancedCombinationTransform< ScalarType,
150  FixedImageDimension > CombinationTransformType;
151 
153  typedef Neighborhood< ScalarType,
154  itkGetStaticConstMacro( FixedImageDimension ) > NeighborhoodType;
155  typedef typename NeighborhoodType::SizeType NeighborhoodSizeType;
156  typedef ImageRegionIterator< CoefficientImageType > CoefficientImageIteratorType;
157  typedef NeighborhoodOperatorImageFilter<
158  CoefficientImageType, CoefficientImageType > NOIFType;
159  typedef NeighborhoodIterator<CoefficientImageType> NeighborhoodIteratorType;
160  typedef typename NeighborhoodIteratorType::RadiusType RadiusType;
161 
163  typedef CoefficientImageType RigidityImageType;
164  typedef typename RigidityImageType::Pointer RigidityImagePointer;
165  typedef typename RigidityImageType::PixelType RigidityPixelType;
166  typedef typename RigidityImageType::RegionType RigidityImageRegionType;
167  typedef typename RigidityImageType::IndexType RigidityImageIndexType;
168  typedef typename RigidityImageType::PointType RigidityImagePointType;
169  typedef ImageRegionIterator< RigidityImageType > RigidityImageIteratorType;
170  typedef BinaryBallStructuringElement<
171  RigidityPixelType,
172  itkGetStaticConstMacro( FixedImageDimension ) > StructuringElementType;
173  typedef typename StructuringElementType::RadiusType SERadiusType;
174  typedef GrayscaleDilateImageFilter<
175  RigidityImageType, RigidityImageType,
176  StructuringElementType > DilateFilterType;
177  typedef typename DilateFilterType::Pointer DilateFilterPointer;
178 
180  void CheckUseAndCalculationBooleans( void );
181 
183  virtual MeasureType GetValue(
184  const ParametersType & parameters ) const;
185 
187  virtual void GetDerivative(
188  const ParametersType & parameters,
189  DerivativeType & derivative ) const;
190 
192  virtual void GetValueAndDerivative(
193  const ParametersType & parameters,
194  MeasureType & value,
195  DerivativeType & derivative ) const;
196 
200  itkSetObjectMacro( BSplineTransform, BSplineTransformType );
201 
203  //itkSetObjectMacro( RigidityCoefficientImage, RigidityImageType );
204 
206  itkSetClampMacro( LinearityConditionWeight, ScalarType,
207  0.0, NumericTraits<ScalarType>::max() );
208  itkGetMacro( LinearityConditionWeight, ScalarType );
209 
211  itkSetClampMacro( OrthonormalityConditionWeight, ScalarType,
212  0.0, NumericTraits<ScalarType>::max() );
213  itkGetMacro( OrthonormalityConditionWeight, ScalarType );
214 
216  itkSetClampMacro( PropernessConditionWeight, ScalarType,
217  0.0, NumericTraits<ScalarType>::max() );
218  itkGetMacro( PropernessConditionWeight, ScalarType );
219 
221  itkSetMacro( UseLinearityCondition, bool );
222 
224  itkSetMacro( UseOrthonormalityCondition, bool );
225 
227  itkSetMacro( UsePropernessCondition, bool );
228 
232  itkSetMacro( CalculateLinearityCondition, bool );
233 
237  itkSetMacro( CalculateOrthonormalityCondition, bool );
238 
242  itkSetMacro( CalculatePropernessCondition, bool );
243 
245  itkGetConstReferenceMacro( LinearityConditionValue, MeasureType );
246 
248  itkGetConstReferenceMacro( OrthonormalityConditionValue, MeasureType );
249 
251  itkGetConstReferenceMacro( PropernessConditionValue, MeasureType );
252 
254  itkGetConstReferenceMacro( LinearityConditionGradientMagnitude, MeasureType );
255 
257  itkGetConstReferenceMacro( OrthonormalityConditionGradientMagnitude, MeasureType );
258 
260  itkGetConstReferenceMacro( PropernessConditionGradientMagnitude, MeasureType );
261 
263  //itkGetConstReferenceMacro( RigidityPenaltyTermValue, MeasureType );
264 
266  itkSetMacro( DilateRigidityImages, bool );
267 
269  itkSetClampMacro( DilationRadiusMultiplier, CoordinateRepresentationType,
270  0.1, NumericTraits<CoordinateRepresentationType>::max() );
271 
273  itkSetObjectMacro( FixedRigidityImage, RigidityImageType );
274 
276  itkSetObjectMacro( MovingRigidityImage, RigidityImageType );
277 
279  itkSetMacro( UseFixedRigidityImage, bool );
280 
282  itkSetMacro( UseMovingRigidityImage, bool );
283 
285  void FillRigidityCoefficientImage( const ParametersType & parameters ) const;
286 
287 protected:
288 
292  virtual ~TransformRigidityPenaltyTerm() {};
293 
295  void PrintSelf( std::ostream& os, Indent indent ) const;
296 
297 private:
298 
300  TransformRigidityPenaltyTerm( const Self& ); // purposely not implemented
302  void operator=( const Self& ); // purposely not implemented
303 
305  virtual void DilateRigidityImages( void );
306 
308  void Create1DOperator( NeighborhoodType & F, const std::string WhichF,
309  const unsigned int WhichDimension, const CoefficientImageSpacingType & spacing ) const;
310 
312  void CreateNDOperator( NeighborhoodType & F, const std::string WhichF,
313  const CoefficientImageSpacingType & spacing ) const;
314 
317  const std::vector< NeighborhoodType > &Operators ) const;
318 
324 
332 
339 
347  std::vector< DilateFilterPointer > m_FixedRigidityImageDilation;
348  std::vector< DilateFilterPointer > m_MovingRigidityImageDilation;
353 
354 }; // end class TransformRigidityPenaltyTerm
355 
356 
357 } // end namespace itk
358 
359 #ifndef ITK_MANUAL_INSTANTIATION
360 #include "itkTransformRigidityPenaltyTerm.txx"
361 #endif
362 
363 #endif // #ifndef __itkTransformRigidityPenaltyTerm_h
364 
A cost function that calculates a penalty term on a transformation.
Superclass::MovingImageMaskType MovingImageMaskType
This class combines two transforms: an &#39;initial transform&#39; with a &#39;current transform&#39;.
Superclass::DerivativeValueType DerivativeValueType
Superclass::MovingImageConstPointer MovingImageConstPointer
std::vector< DilateFilterPointer > m_MovingRigidityImageDilation
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Deformable transform using a B-spline representation.
Superclass::FixedImagePixelType FixedImagePixelType
Superclass::TransformParametersType TransformParametersType
Superclass::SpatialHessianType SpatialHessianType
Neighborhood< ScalarType, itkGetStaticConstMacro(FixedImageDimension) > NeighborhoodType
CoefficientImagePointer FilterSeparable(const CoefficientImageType *, const std::vector< NeighborhoodType > &Operators) const
Superclass::GradientImageType GradientImageType
void Create1DOperator(NeighborhoodType &F, const std::string WhichF, const unsigned int WhichDimension, const CoefficientImageSpacingType &spacing) const
Superclass::MeasureType MeasureType
void PrintSelf(std::ostream &os, Indent indent) const
virtual void DilateRigidityImages(void)
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
Superclass::MovingImageType MovingImageType
A cost function that calculates a rigidity penalty term.
Superclass::TransformJacobianType TransformJacobianType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Superclass::TransformParametersType TransformParametersType
Superclass::DerivativeValueType DerivativeValueType
Superclass::InterpolatorType InterpolatorType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::FixedImageRegionType FixedImageRegionType
Superclass::MovingImagePointer MovingImagePointer
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Superclass::GradientImagePointer GradientImagePointer
virtual void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const
BinaryBallStructuringElement< RigidityPixelType, itkGetStaticConstMacro(FixedImageDimension) > StructuringElementType
Superclass::SpatialJacobianType SpatialJacobianType
Superclass::InternalMatrixType InternalMatrixType
NeighborhoodOperatorImageFilter< CoefficientImageType, CoefficientImageType > NOIFType
Superclass::InputPointType InputPointType
Superclass::FixedImageRegionType FixedImageRegionType
CoordinateRepresentationType m_DilationRadiusMultiplier
TransformType::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
void FillRigidityCoefficientImage(const ParametersType &parameters) const
Superclass::TransformJacobianType TransformJacobianType
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::FixedImageMaskType FixedImageMaskType
int max(int a, int b)
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::FixedImageType FixedImageType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::GradientImagePointer GradientImagePointer
Superclass::MovingImagePixelType MovingImagePixelType
TransformType::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::MovingImagePixelType MovingImagePixelType
std::vector< DilateFilterPointer > m_FixedRigidityImageDilation
Superclass::InterpolatorPointer InterpolatorPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
virtual MeasureType GetValue(const ParametersType &parameters) const
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::ParametersType ParametersType
TransformPenaltyTerm< TFixedImage, TScalarType > Superclass
Superclass::OutputPointType OutputPointType
Superclass::InterpolatorPointer InterpolatorPointer
virtual void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const
TransformType::SpatialJacobianType SpatialJacobianType
TransformType::InternalMatrixType InternalMatrixType
Superclass::FixedImagePointer FixedImagePointer
Superclass::FixedImagePointer FixedImagePointer
Superclass::DerivativeType DerivativeType
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
TransformType::SpatialHessianType SpatialHessianType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::GradientPixelType GradientPixelType
Superclass::FixedImageMaskType FixedImageMaskType
Superclass::MovingImagePointer MovingImagePointer
Superclass::AdvancedTransformType TransformType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::FixedImagePixelType FixedImagePixelType
void CreateNDOperator(NeighborhoodType &F, const std::string WhichF, const CoefficientImageSpacingType &spacing) const
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::FixedImageConstPointer FixedImageConstPointer
GrayscaleDilateImageFilter< RigidityImageType, RigidityImageType, StructuringElementType > DilateFilterType


Generated on 05-12-2013 for elastix by doxygen 1.8.5 elastix logo