go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkKNNGraphAlphaMutualInformationImageToImageMetric.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 __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
19#define __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
20
23
25#include "itkArray.h"
26#include "itkListSampleCArray.h"
27#include "itkBinaryTreeBase.h"
29
31#include "itkANNkDTree.h"
32#include "itkANNbdTree.h"
34
39
41#include "itkArray2D.h"
42
43namespace itk
44{
73template< class TFixedImage, class TMovingImage >
75 public MultiInputImageToImageMetricBase< TFixedImage, TMovingImage >
76{
77public:
78
82 TFixedImage, TMovingImage > Superclass;
84 typedef SmartPointer< const Self > ConstPointer;
85
87 itkNewMacro( Self );
88
92
94 typedef typename
128 typedef typename
132 typedef typename
134 typedef typename
137
146
148 itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
149 itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
150
152 typedef Array< double > MeasurementVectorType;
153 typedef typename MeasurementVectorType::ValueType MeasurementVectorValueType;
154 typedef typename Statistics::ListSampleCArray<
157
164
171
174
175 typedef typename DerivativeType::ValueType DerivativeValueType;
176 typedef typename TransformJacobianType::ValueType TransformJacobianValueType;
177
184 void SetANNkDTree( unsigned int bucketSize, std::string splittingRule );
185
187 void SetANNkDTree( unsigned int bucketSize, std::string splittingRuleFixed,
188 std::string splittingRuleMoving, std::string splittingRuleJoint );
189
191 void SetANNbdTree( unsigned int bucketSize, std::string splittingRule,
192 std::string shrinkingRule );
193
195 void SetANNbdTree( unsigned int bucketSize, std::string splittingRuleFixed,
196 std::string splittingRuleMoving, std::string splittingRuleJoint,
197 std::string shrinkingRuleFixed, std::string shrinkingRuleMoving,
198 std::string shrinkingRuleJoint );
199
202
209 void SetANNStandardTreeSearch( unsigned int kNearestNeighbors,
210 double errorBound );
211
213 void SetANNFixedRadiusTreeSearch( unsigned int kNearestNeighbors,
214 double errorBound, double squaredRadius );
215
217 void SetANNPriorityTreeSearch( unsigned int kNearestNeighbors,
218 double errorBound );
219
225 void Initialize( void ) override;
226
228 void GetDerivative( const TransformParametersType & parameters,
229 DerivativeType & Derivative ) const override;
230
232 MeasureType GetValue( const TransformParametersType & parameters ) const override;
233
236 MeasureType & Value, DerivativeType & Derivative ) const override;
237
239 itkSetClampMacro( Alpha, double, 0.0, 1.0 );
240
242 itkGetConstReferenceMacro( Alpha, double );
243
245 itkSetClampMacro( AvoidDivisionBy, double, 0.0, 1.0 );
246
248 itkGetConstReferenceMacro( AvoidDivisionBy, double );
249
250protected:
251
254
257
259 void PrintSelf( std::ostream & os, Indent indent ) const override;
260
265
269
270 double m_Alpha;
272
273private:
274
275 KNNGraphAlphaMutualInformationImageToImageMetric( const Self & ); // purposely not implemented
276 void operator=( const Self & ); // purposely not implemented
277
283 typedef std::vector< TransformJacobianType > TransformJacobianContainerType;
284 //typedef std::vector<ParameterIndexArrayType> TransformJacobianIndicesContainerType;
285 typedef std::vector< NonZeroJacobianIndicesType > TransformJacobianIndicesContainerType;
286 typedef Array2D< double > SpatialDerivativeType;
287 typedef std::vector< SpatialDerivativeType > SpatialDerivativeContainerType;
288
301 const ListSamplePointer & listSampleFixed,
302 const ListSamplePointer & listSampleMoving,
303 const ListSamplePointer & listSampleJoint,
304 const bool & doDerivative,
306 TransformJacobianIndicesContainerType & jacobiansIndices,
307 SpatialDerivativeContainerType & spatialDerivatives ) const;
308
314 const MovingImagePointType & mappedPoint,
315 SpatialDerivativeType & featureGradients ) const;
316
322 const SpatialDerivativeType & D1sparse,
323 const SpatialDerivativeType & D2sparse_M,
324 const SpatialDerivativeType & D2sparse_J,
325 //const ParameterIndexArrayType & D1indices,
326 //const ParameterIndexArrayType & D2indices_M,
327 //const ParameterIndexArrayType & D2indices_J,
328 const NonZeroJacobianIndicesType & D1indices,
329 const NonZeroJacobianIndicesType & D2indices_M,
330 const NonZeroJacobianIndicesType & D2indices_J,
331 const MeasurementVectorType & diff_M,
332 const MeasurementVectorType & diff_J,
333 const MeasureType & distance_M,
334 const MeasureType & distance_J,
335 DerivativeType & dGamma_M,
336 DerivativeType & dGamma_J ) const;
337
338};
339
340} // end namespace itk
341
342#ifndef ITK_MANUAL_INSTANTIATION
343#include "itkKNNGraphAlphaMutualInformationImageToImageMetric.hxx"
344#endif
345
346#endif // end #ifndef __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics.
Superclass::TransformParametersType TransformParametersType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
ImageSamplerBase< FixedImageType > ImageSamplerType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
TransformType::InputPointType FixedImagePointType
MovingImageType::RegionType MovingImageRegionType
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
TransformType::OutputPointType MovingImagePointType
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
SmartPointer< Self > Pointer
void SetANNPriorityTreeSearch(unsigned int kNearestNeighbors, double errorBound)
void SetANNbdTree(unsigned int bucketSize, std::string splittingRuleFixed, std::string splittingRuleMoving, std::string splittingRuleJoint, std::string shrinkingRuleFixed, std::string shrinkingRuleMoving, std::string shrinkingRuleJoint)
MultiInputImageToImageMetricBase< TFixedImage, TMovingImage > Superclass
virtual void UpdateDerivativeOfGammas(const SpatialDerivativeType &D1sparse, const SpatialDerivativeType &D2sparse_M, const SpatialDerivativeType &D2sparse_J, const NonZeroJacobianIndicesType &D1indices, const NonZeroJacobianIndicesType &D2indices_M, const NonZeroJacobianIndicesType &D2indices_J, const MeasurementVectorType &diff_M, const MeasurementVectorType &diff_J, const MeasureType &distance_M, const MeasureType &distance_J, DerivativeType &dGamma_M, DerivativeType &dGamma_J) const
void SetANNkDTree(unsigned int bucketSize, std::string splittingRule)
void SetANNbdTree(unsigned int bucketSize, std::string splittingRule, std::string shrinkingRule)
void PrintSelf(std::ostream &os, Indent indent) const override
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const override
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const override
virtual void ComputeListSampleValuesAndDerivativePlusJacobian(const ListSamplePointer &listSampleFixed, const ListSamplePointer &listSampleMoving, const ListSamplePointer &listSampleJoint, const bool &doDerivative, TransformJacobianContainerType &jacobians, TransformJacobianIndicesContainerType &jacobiansIndices, SpatialDerivativeContainerType &spatialDerivatives) const
void SetANNFixedRadiusTreeSearch(unsigned int kNearestNeighbors, double errorBound, double squaredRadius)
itkStaticConstMacro(MovingImageDimension, unsigned int, MovingImageType::ImageDimension)
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Statistics::ListSampleCArray< MeasurementVectorType, double > ListSampleType
void SetANNkDTree(unsigned int bucketSize, std::string splittingRuleFixed, std::string splittingRuleMoving, std::string splittingRuleJoint)
void SetANNStandardTreeSearch(unsigned int kNearestNeighbors, double errorBound)
MeasureType GetValue(const TransformParametersType &parameters) const override
virtual void EvaluateMovingFeatureImageDerivatives(const MovingImagePointType &mappedPoint, SpatialDerivativeType &featureGradients) const
Implements a metric base class that takes multiple inputs.
Superclass::MovingImageDerivativeType MovingImageDerivativeType
Superclass::TransformParametersType TransformParametersType
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
std::vector< MovingImageConstPointer > MovingImageVectorType
std::vector< MovingImageMaskPointer > MovingImageMaskVectorType
Superclass::FixedImageConstPointer FixedImageConstPointer
Superclass::GradientImageFilterType GradientImageFilterType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
std::vector< FixedImageRegionType > FixedImageRegionVectorType
std::vector< FixedImageConstPointer > FixedImageVectorType
Superclass::MovingImageConstPointer MovingImageConstPointer
Superclass::GradientImageFilterPointer GradientImageFilterPointer
Superclass::TransformJacobianType TransformJacobianType
std::vector< FixedImageMaskPointer > FixedImageMaskVectorType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
std::vector< FixedImageInterpolatorPointer > FixedImageInterpolatorVectorType
std::vector< InterpolatorPointer > InterpolatorVectorType
A ListSampleBase that internally uses a CArray, which can be accessed.


Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo