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 
15 #ifndef __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
16 #define __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
17 
20 
22 #include "itkArray.h"
23 #include "itkListSampleCArray.h"
24 #include "itkBinaryTreeBase.h"
26 
28 #include "itkANNkDTree.h"
29 #include "itkANNbdTree.h"
30 #include "itkANNBruteForceTree.h"
31 
36 
38 #include "itkArray2D.h"
39 
40 
41 namespace itk
42 {
71 template < class TFixedImage, class TMovingImage>
73  public MultiInputImageToImageMetricBase< TFixedImage, TMovingImage>
74 {
75 public:
76 
80  TFixedImage, TMovingImage > Superclass;
81  typedef SmartPointer<Self> Pointer;
82  typedef SmartPointer<const Self> ConstPointer;
83 
85  itkNewMacro( Self );
86 
90 
92  typedef typename
108  typedef typename Superclass::RealType RealType;
126  typedef typename
130  typedef typename
132  typedef typename
135 
144 
146  itkStaticConstMacro( FixedImageDimension, unsigned int, FixedImageType::ImageDimension );
147  itkStaticConstMacro( MovingImageDimension, unsigned int, MovingImageType::ImageDimension );
148 
150  typedef Array< double > MeasurementVectorType;
151  typedef typename MeasurementVectorType::ValueType MeasurementVectorValueType;
152  typedef typename Statistics::ListSampleCArray<
155 
161 
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  KNNGraphAlphaMutualInformationImageToImageMetric(const Self&); //purposely not implemented
271  void operator=(const Self&); //purposely not implemented
272 
278  typedef std::vector<TransformJacobianType> TransformJacobianContainerType;
279  //typedef std::vector<ParameterIndexArrayType> TransformJacobianIndicesContainerType;
280  typedef std::vector<NonZeroJacobianIndicesType> TransformJacobianIndicesContainerType;
281  typedef Array2D<double> SpatialDerivativeType;
282  typedef std::vector<SpatialDerivativeType> SpatialDerivativeContainerType;
283 
296  const ListSamplePointer & listSampleFixed,
297  const ListSamplePointer & listSampleMoving,
298  const ListSamplePointer & listSampleJoint,
299  const bool & doDerivative,
300  TransformJacobianContainerType & jacobians,
301  TransformJacobianIndicesContainerType & jacobiansIndices,
302  SpatialDerivativeContainerType & spatialDerivatives ) const;
303 
309  const MovingImagePointType & mappedPoint,
310  SpatialDerivativeType & featureGradients ) const;
311 
316  virtual void UpdateDerivativeOfGammas(
317  const SpatialDerivativeType & D1sparse,
318  const SpatialDerivativeType & D2sparse_M,
319  const SpatialDerivativeType & D2sparse_J,
320  //const ParameterIndexArrayType & D1indices,
321  //const ParameterIndexArrayType & D2indices_M,
322  //const ParameterIndexArrayType & D2indices_J,
323  const NonZeroJacobianIndicesType & D1indices,
324  const NonZeroJacobianIndicesType & D2indices_M,
325  const NonZeroJacobianIndicesType & D2indices_J,
326  const MeasurementVectorType & diff_M,
327  const MeasurementVectorType & diff_J,
328  const MeasureType & distance_M,
329  const MeasureType & distance_J,
330  DerivativeType & dGamma_M,
331  DerivativeType & dGamma_J ) const;
332 
333  }; // end class KNNGraphAlphaMutualInformationImageToImageMetric
334 
335 } // end namespace itk
336 
337 #ifndef ITK_MANUAL_INSTANTIATION
338 #include "itkKNNGraphAlphaMutualInformationImageToImageMetric.txx"
339 #endif
340 
341 #endif // end #ifndef __itkKNNGraphAlphaMutualInformationImageToImageMetric_h
342 
Superclass::FixedImageConstPointer FixedImageConstPointer
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, FixedImageDimension > FixedImageLimiterType
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
LimiterFunctionBase< RealType, MovingImageDimension > MovingImageLimiterType
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 05-01-2014 for elastix by doxygen 1.8.5 elastix logo