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 * 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 __itkTransformRigidityPenaltyTerm_h
19#define __itkTransformRigidityPenaltyTerm_h
20
22
26
28#include "itkNeighborhood.h"
29#include "itkImageRegionIterator.h"
30#include "itkNeighborhoodOperatorImageFilter.h"
31#include "itkNeighborhoodIterator.h"
32
34#include "itkGrayscaleDilateImageFilter.h"
35#include "itkBinaryBallStructuringElement.h"
36#include "itkImageRegionIterator.h"
37
38namespace itk
39{
70template< class TFixedImage, class TScalarType >
72 public TransformPenaltyTerm< TFixedImage, TScalarType >
73{
74public:
75
79 TFixedImage, TScalarType > Superclass;
81 typedef SmartPointer< const Self > ConstPointer;
82
84 itkNewMacro( Self );
85
88
125
134
141
143 itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
144 itkStaticConstMacro( MovingImageDimension, unsigned int, FixedImageType::ImageDimension );
145 itkStaticConstMacro( ImageDimension, unsigned int, FixedImageType::ImageDimension );
146
148 void Initialize( void ) override;
149
153 typedef typename BSplineTransformType::SpacingType GridSpacingType;
155 typedef typename CoefficientImageType::Pointer CoefficientImagePointer;
156 typedef typename CoefficientImageType::SpacingType CoefficientImageSpacingType;
157
159 typedef Neighborhood< ScalarType,
160 itkGetStaticConstMacro( FixedImageDimension ) > NeighborhoodType;
161 typedef typename NeighborhoodType::SizeType NeighborhoodSizeType;
162 typedef ImageRegionIterator< CoefficientImageType > CoefficientImageIteratorType;
163 typedef NeighborhoodOperatorImageFilter<
165 typedef NeighborhoodIterator< CoefficientImageType > NeighborhoodIteratorType;
166 typedef typename NeighborhoodIteratorType::RadiusType RadiusType;
167
170 typedef typename RigidityImageType::Pointer RigidityImagePointer;
171 typedef typename RigidityImageType::PixelType RigidityPixelType;
172 typedef typename RigidityImageType::RegionType RigidityImageRegionType;
173 typedef typename RigidityImageType::IndexType RigidityImageIndexType;
174 typedef typename RigidityImageType::PointType RigidityImagePointType;
175 typedef ImageRegionIterator< RigidityImageType > RigidityImageIteratorType;
176 typedef BinaryBallStructuringElement<
178 itkGetStaticConstMacro( FixedImageDimension ) > StructuringElementType;
179 typedef typename StructuringElementType::RadiusType SERadiusType;
180 typedef GrayscaleDilateImageFilter<
183 typedef typename DilateFilterType::Pointer DilateFilterPointer;
184
187
190 const ParametersType & parameters ) const override;
191
194 const ParametersType & parameters,
195 DerivativeType & derivative ) const override;
196
199 const TransformParametersType & parameters ) const override;
200
203 const ParametersType & parameters,
204 MeasureType & value,
205 DerivativeType & derivative ) const override;
206
211
213 //itkSetObjectMacro( RigidityCoefficientImage, RigidityImageType );
214
216 itkSetClampMacro( LinearityConditionWeight, ScalarType,
217 0.0, NumericTraits< ScalarType >::max() );
218 itkGetMacro( LinearityConditionWeight, ScalarType );
219
221 itkSetClampMacro( OrthonormalityConditionWeight, ScalarType,
222 0.0, NumericTraits< ScalarType >::max() );
223 itkGetMacro( OrthonormalityConditionWeight, ScalarType );
224
226 itkSetClampMacro( PropernessConditionWeight, ScalarType,
227 0.0, NumericTraits< ScalarType >::max() );
228 itkGetMacro( PropernessConditionWeight, ScalarType );
229
231 itkSetMacro( UseLinearityCondition, bool );
232
234 itkSetMacro( UseOrthonormalityCondition, bool );
235
237 itkSetMacro( UsePropernessCondition, bool );
238
242 itkSetMacro( CalculateLinearityCondition, bool );
243
247 itkSetMacro( CalculateOrthonormalityCondition, bool );
248
252 itkSetMacro( CalculatePropernessCondition, bool );
253
255 itkGetConstReferenceMacro( LinearityConditionValue, MeasureType );
256
258 itkGetConstReferenceMacro( OrthonormalityConditionValue, MeasureType );
259
261 itkGetConstReferenceMacro( PropernessConditionValue, MeasureType );
262
264 itkGetConstReferenceMacro( LinearityConditionGradientMagnitude, MeasureType );
265
267 itkGetConstReferenceMacro( OrthonormalityConditionGradientMagnitude, MeasureType );
268
270 itkGetConstReferenceMacro( PropernessConditionGradientMagnitude, MeasureType );
271
273 //itkGetConstReferenceMacro( RigidityPenaltyTermValue, MeasureType );
274
276 itkSetMacro( DilateRigidityImages, bool );
277
279 itkSetClampMacro( DilationRadiusMultiplier, CoordinateRepresentationType,
280 0.1, NumericTraits< CoordinateRepresentationType >::max() );
281
283 itkSetObjectMacro( FixedRigidityImage, RigidityImageType );
284
286 itkSetObjectMacro( MovingRigidityImage, RigidityImageType );
287
289 itkSetMacro( UseFixedRigidityImage, bool );
290
292 itkSetMacro( UseMovingRigidityImage, bool );
293
295 void FillRigidityCoefficientImage( const ParametersType & parameters ) const;
296
297protected:
298
303
305 void PrintSelf( std::ostream & os, Indent indent ) const override;
306
307private:
308
310 TransformRigidityPenaltyTerm( const Self & ); // purposely not implemented
312 void operator=( const Self & ); // purposely not implemented
313
315 virtual void DilateRigidityImages( void );
316
318 void Create1DOperator( NeighborhoodType & F, const std::string & whichF,
319 const unsigned int WhichDimension, const CoefficientImageSpacingType & spacing ) const;
320
322 void CreateNDOperator( NeighborhoodType & F, const std::string & whichF,
323 const CoefficientImageSpacingType & spacing ) const;
324
327 const std::vector< NeighborhoodType > & Operators ) const;
328
334
342
349
357 std::vector< DilateFilterPointer > m_FixedRigidityImageDilation;
358 std::vector< DilateFilterPointer > m_MovingRigidityImageDilation;
363
364};
365
366} // end namespace itk
367
368#ifndef ITK_MANUAL_INSTANTIATION
369#include "itkTransformRigidityPenaltyTerm.hxx"
370#endif
371
372#endif // #ifndef __itkTransformRigidityPenaltyTerm_h
A cost function that calculates a penalty term on a transformation.
Superclass::TransformParametersType TransformParametersType
Superclass::ImageSampleContainerType ImageSampleContainerType
Superclass::MeasureType MeasureType
Superclass::BSplineOrder2TransformType BSplineOrder2TransformType
Superclass::BSplineOrder3TransformType BSplineOrder3TransformType
Superclass::BSplineOrder1TransformPointer BSplineOrder1TransformPointer
TransformType::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
Superclass::BSplineOrder3TransformPointer BSplineOrder3TransformPointer
Superclass::BSplineOrder2TransformPointer BSplineOrder2TransformPointer
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::MovingImageConstPointer MovingImageConstPointer
TransformType::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
Superclass::BSplineOrder1TransformType BSplineOrder1TransformType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::CombinationTransformType CombinationTransformType
A cost function that calculates a rigidity penalty term.
Superclass::FixedImagePixelType FixedImagePixelType
std::vector< DilateFilterPointer > m_FixedRigidityImageDilation
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::ImageSampleContainerPointer ImageSampleContainerPointer
ImageRegionIterator< RigidityImageType > RigidityImageIteratorType
void FillRigidityCoefficientImage(const ParametersType &parameters) const
Neighborhood< ScalarType, itkGetStaticConstMacro(FixedImageDimension) > NeighborhoodType
CoordinateRepresentationType m_DilationRadiusMultiplier
BinaryBallStructuringElement< RigidityPixelType, itkGetStaticConstMacro(FixedImageDimension) > StructuringElementType
Superclass::FixedImagePointer FixedImagePointer
TransformPenaltyTerm< TFixedImage, TScalarType > Superclass
Superclass::BSplineOrder1TransformPointer BSplineOrder1TransformPointer
CoefficientImagePointer FilterSeparable(const CoefficientImageType *, const std::vector< NeighborhoodType > &Operators) const
MeasureType GetValue(const ParametersType &parameters) const override
void BeforeThreadedGetValueAndDerivative(const TransformParametersType &parameters) const override
Superclass::BSplineOrder1TransformType BSplineOrder1TransformType
RigidityImageType::IndexType RigidityImageIndexType
itkStaticConstMacro(ImageDimension, unsigned int, FixedImageType::ImageDimension)
itkStaticConstMacro(MovingImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::InterpolatorPointer InterpolatorPointer
BSplineTransformType::SpacingType GridSpacingType
Superclass::MovingImagePixelType MovingImagePixelType
virtual void DilateRigidityImages(void)
Superclass::BSplineOrder3TransformPointer BSplineOrder3TransformPointer
Superclass::SpatialJacobianType SpatialJacobianType
void Create1DOperator(NeighborhoodType &F, const std::string &whichF, const unsigned int WhichDimension, const CoefficientImageSpacingType &spacing) const
Superclass::CoordinateRepresentationType CoordinateRepresentationType
void CreateNDOperator(NeighborhoodType &F, const std::string &whichF, const CoefficientImageSpacingType &spacing) const
Superclass::InternalMatrixType InternalMatrixType
RigidityImageType::RegionType RigidityImageRegionType
Superclass::MovingImageMaskType MovingImageMaskType
Superclass::GradientImagePointer GradientImagePointer
void GetDerivative(const ParametersType &parameters, DerivativeType &derivative) const override
Superclass::SpatialHessianType SpatialHessianType
Superclass::DerivativeValueType DerivativeValueType
TransformRigidityPenaltyTerm(const Self &)
Superclass::BSplineOrder2TransformPointer BSplineOrder2TransformPointer
StructuringElementType::RadiusType SERadiusType
void Initialize(void) override
ImageRegionIterator< CoefficientImageType > CoefficientImageIteratorType
Superclass::ImageSampleContainerType ImageSampleContainerType
BSplineTransformType::Pointer BSplineTransformPointer
void GetValueAndDerivative(const ParametersType &parameters, MeasureType &value, DerivativeType &derivative) const override
Superclass::JacobianOfSpatialJacobianType JacobianOfSpatialJacobianType
NeighborhoodIteratorType::RadiusType RadiusType
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::FixedImageMaskPointer FixedImageMaskPointer
Superclass::TransformParametersType TransformParametersType
BSplineTransformType::ImageType CoefficientImageType
Superclass::CombinationTransformType CombinationTransformType
NeighborhoodIterator< CoefficientImageType > NeighborhoodIteratorType
Superclass::BSplineOrder3TransformType BSplineOrder3TransformType
NeighborhoodOperatorImageFilter< CoefficientImageType, CoefficientImageType > NOIFType
GrayscaleDilateImageFilter< RigidityImageType, RigidityImageType, StructuringElementType > DilateFilterType
Superclass::FixedImageRegionType FixedImageRegionType
Superclass::BSplineOrder2TransformType BSplineOrder2TransformType
Superclass::MovingImageConstPointer MovingImageConstPointer
void PrintSelf(std::ostream &os, Indent indent) const override
std::vector< DilateFilterPointer > m_MovingRigidityImageDilation
Superclass::MovingImageMaskPointer MovingImageMaskPointer
Superclass::MovingImagePointer MovingImagePointer
CoefficientImageType::Pointer CoefficientImagePointer
Superclass::FixedImageConstPointer FixedImageConstPointer
CoefficientImageType::SpacingType CoefficientImageSpacingType
Superclass::JacobianOfSpatialHessianType JacobianOfSpatialHessianType
Superclass::TransformJacobianType TransformJacobianType
RigidityImageType::PointType RigidityImagePointType
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::FixedImageMaskType FixedImageMaskType


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo