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  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 #ifndef __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
15 #define __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
16 
19 
21 #include "itkArray.h"
22 #include "itkListSampleCArray.h"
23 #include "itkBinaryTreeBase.h"
25 
27 #include "itkANNkDTree.h"
28 #include "itkANNbdTree.h"
29 #include "itkANNBruteForceTree.h"
30 
35 
37 #include "itkArray2D.h"
38 
39 namespace itk
40 {
69 template< class TFixedImage, class TMovingImage >
71  public MultiInputImageToImageMetricBase< TFixedImage, TMovingImage >
72 {
73 public:
74 
78  TFixedImage, TMovingImage > Superclass;
79  typedef SmartPointer< Self > Pointer;
80  typedef SmartPointer< const Self > ConstPointer;
81 
83  itkNewMacro( Self );
84 
88 
90  typedef typename
106  typedef typename Superclass::RealType RealType;
124  typedef typename
128  typedef typename
130  typedef typename
133 
142 
144  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
145  itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
146 
148  typedef Array< double > MeasurementVectorType;
149  typedef typename MeasurementVectorType::ValueType MeasurementVectorValueType;
150  typedef typename Statistics::ListSampleCArray<
153 
160 
167 
170 
171  typedef typename DerivativeType::ValueType DerivativeValueType;
172  typedef typename TransformJacobianType::ValueType TransformJacobianValueType;
173 
180  void SetANNkDTree( unsigned int bucketSize, std::string splittingRule );
181 
183  void SetANNkDTree( unsigned int bucketSize, std::string splittingRuleFixed,
184  std::string splittingRuleMoving, std::string splittingRuleJoint );
185 
187  void SetANNbdTree( unsigned int bucketSize, std::string splittingRule,
188  std::string shrinkingRule );
189 
191  void SetANNbdTree( unsigned int bucketSize, std::string splittingRuleFixed,
192  std::string splittingRuleMoving, std::string splittingRuleJoint,
193  std::string shrinkingRuleFixed, std::string shrinkingRuleMoving,
194  std::string shrinkingRuleJoint );
195 
197  void SetANNBruteForceTree( void );
198 
205  void SetANNStandardTreeSearch( unsigned int kNearestNeighbors,
206  double errorBound );
207 
209  void SetANNFixedRadiusTreeSearch( unsigned int kNearestNeighbors,
210  double errorBound, double squaredRadius );
211 
213  void SetANNPriorityTreeSearch( unsigned int kNearestNeighbors,
214  double errorBound );
215 
221  virtual void Initialize( void ) throw ( ExceptionObject );
222 
224  void GetDerivative( const TransformParametersType & parameters,
225  DerivativeType & Derivative ) const;
226 
228  MeasureType GetValue( const TransformParametersType & parameters ) const;
229 
231  void GetValueAndDerivative( const TransformParametersType & parameters,
232  MeasureType & Value, DerivativeType & Derivative ) const;
233 
235  itkSetClampMacro( Alpha, double, 0.0, 1.0 );
236 
238  itkGetConstReferenceMacro( Alpha, double );
239 
241  itkSetClampMacro( AvoidDivisionBy, double, 0.0, 1.0 );
242 
244  itkGetConstReferenceMacro( AvoidDivisionBy, double );
245 
246 protected:
247 
250 
252  virtual ~KNNGraphAlphaMutualInformationImageToImageMetric() {}
253 
255  virtual void PrintSelf( std::ostream & os, Indent indent ) const;
256 
261 
265 
266  double m_Alpha;
268 
269 private:
270 
271  KNNGraphAlphaMutualInformationImageToImageMetric( const Self & ); // purposely not implemented
272  void operator=( const Self & ); // purposely not implemented
273 
279  typedef std::vector< TransformJacobianType > TransformJacobianContainerType;
280  //typedef std::vector<ParameterIndexArrayType> TransformJacobianIndicesContainerType;
281  typedef std::vector< NonZeroJacobianIndicesType > TransformJacobianIndicesContainerType;
282  typedef Array2D< double > SpatialDerivativeType;
283  typedef std::vector< SpatialDerivativeType > SpatialDerivativeContainerType;
284 
297  const ListSamplePointer & listSampleFixed,
298  const ListSamplePointer & listSampleMoving,
299  const ListSamplePointer & listSampleJoint,
300  const bool & doDerivative,
301  TransformJacobianContainerType & jacobians,
302  TransformJacobianIndicesContainerType & jacobiansIndices,
303  SpatialDerivativeContainerType & spatialDerivatives ) const;
304 
310  const MovingImagePointType & mappedPoint,
311  SpatialDerivativeType & featureGradients ) const;
312 
317  virtual void UpdateDerivativeOfGammas(
318  const SpatialDerivativeType & D1sparse,
319  const SpatialDerivativeType & D2sparse_M,
320  const SpatialDerivativeType & D2sparse_J,
321  //const ParameterIndexArrayType & D1indices,
322  //const ParameterIndexArrayType & D2indices_M,
323  //const ParameterIndexArrayType & D2indices_J,
324  const NonZeroJacobianIndicesType & D1indices,
325  const NonZeroJacobianIndicesType & D2indices_M,
326  const NonZeroJacobianIndicesType & D2indices_J,
327  const MeasurementVectorType & diff_M,
328  const MeasurementVectorType & diff_J,
329  const MeasureType & distance_M,
330  const MeasureType & distance_J,
331  DerivativeType & dGamma_M,
332  DerivativeType & dGamma_J ) const;
333 
334 };
335 
336 } // end namespace itk
337 
338 #ifndef ITK_MANUAL_INSTANTIATION
339 #include "itkKNNGraphAlphaMutualInformationImageToImageMetric.hxx"
340 #endif
341 
342 #endif // end #ifndef __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
Superclass::FixedImageConstPointer FixedImageConstPointer
LimiterFunctionBase< RealType, FixedImageDimension > FixedImageLimiterType
std::vector< InterpolatorPointer > InterpolatorVectorType
itkStaticConstMacro(FixedImageDimension, unsigned int, FixedImageType::ImageDimension)
Superclass::MovingImageContinuousIndexType MovingImageContinuousIndexType
Superclass::MovingImageConstPointer MovingImageConstPointer
An extension of the ITK ImageToImageMetric. It is the intended base class for all elastix metrics...
void GetDerivative(const TransformParametersType &parameters, DerivativeType &Derivative) const
void GetValueAndDerivative(const TransformParametersType &parameters, MeasureType &Value, DerivativeType &Derivative) const
FixedImageLimiterType::OutputType FixedImageLimiterOutputType
void SetANNStandardTreeSearch(unsigned int kNearestNeighbors, double errorBound)
Implements a metric base class that takes multiple inputs.
std::vector< FixedImageConstPointer > FixedImageVectorType
Superclass::TransformJacobianType TransformJacobianType
ImageSamplerType::OutputVectorContainerType ImageSampleContainerType
virtual void EvaluateMovingFeatureImageDerivatives(const MovingImagePointType &mappedPoint, SpatialDerivativeType &featureGradients) const
MeasureType GetValue(const TransformParametersType &parameters) const
virtual void ComputeListSampleValuesAndDerivativePlusJacobian(const ListSamplePointer &listSampleFixed, const ListSamplePointer &listSampleMoving, const ListSamplePointer &listSampleJoint, const bool &doDerivative, TransformJacobianContainerType &jacobians, TransformJacobianIndicesContainerType &jacobiansIndices, SpatialDerivativeContainerType &spatialDerivatives) const
TransformType::InputPointType FixedImagePointType
Superclass::MovingImageMaskPointer MovingImageMaskPointer
ImageSamplerBase< FixedImageType > ImageSamplerType
AdvancedTransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
Superclass::CoordinateRepresentationType CoordinateRepresentationType
void SetANNkDTree(unsigned int bucketSize, std::string splittingRule)
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
A ListSampleBase that internally uses a CArray, which can be accessed.
Superclass::GradientImageFilterType GradientImageFilterType
std::vector< FixedImageRegionType > FixedImageRegionVectorType
Superclass::MovingImageDerivativeType MovingImageDerivativeType
std::vector< FixedImageInterpolatorPointer > FixedImageInterpolatorVectorType
Superclass::FixedImageMaskPointer FixedImageMaskPointer
MultiInputImageToImageMetricBase< TFixedImage, TMovingImage > Superclass
MovingImageType::RegionType MovingImageRegionType
std::vector< MovingImageConstPointer > MovingImageVectorType
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 SetANNbdTree(unsigned int bucketSize, std::string splittingRule, std::string shrinkingRule)
SmartPointer< Self > Pointer
Statistics::ListSampleCArray< MeasurementVectorType, double > ListSampleType
Superclass::TransformParametersType TransformParametersType
std::vector< MovingImageMaskPointer > MovingImageMaskVectorType
MovingImageLimiterType::OutputType MovingImageLimiterOutputType
std::vector< FixedImageMaskPointer > FixedImageMaskVectorType
ImageSamplerType::OutputVectorContainerPointer ImageSampleContainerPointer
void SetANNFixedRadiusTreeSearch(unsigned int kNearestNeighbors, double errorBound, double squaredRadius)
virtual void PrintSelf(std::ostream &os, Indent indent) const
Superclass::GradientImageFilterPointer GradientImageFilterPointer
void SetANNPriorityTreeSearch(unsigned int kNearestNeighbors, double errorBound)


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo