ITK  6.0.0
Insight Toolkit
itkImageToImageMetric.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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  * https://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 itkImageToImageMetric_h
19 #define itkImageToImageMetric_h
20 
25 #include "itkSpatialObject.h"
27 #include "itkMultiThreaderBase.h"
28 
29 #include <memory> // For unique_ptr.
30 
31 namespace itk
32 {
53 template <typename TFixedImage, typename TMovingImage>
54 class ITK_TEMPLATE_EXPORT ImageToImageMetric : public SingleValuedCostFunction
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(ImageToImageMetric);
58 
64 
66  using CoordinateRepresentationType = typename Superclass::ParametersValueType;
67 
69  itkOverrideGetNameOfClassMacro(ImageToImageMetric);
70 
72  using MovingImageType = TMovingImage;
73  using MovingImagePixelType = typename TMovingImage::PixelType;
75 
77  using FixedImageType = TFixedImage;
78  using FixedImagePixelType = typename TFixedImage::PixelType;
81 
83  static constexpr unsigned int MovingImageDimension = TMovingImage::ImageDimension;
84  static constexpr unsigned int FixedImageDimension = TFixedImage::ImageDimension;
85 
88 
92  using TransformParametersType = typename TransformType::ParametersType;
94 
101 
102  using FixedImageIndexContainer = std::vector<FixedImageIndexType>;
103 
106 
114 
116 
122 
128 
130  using typename Superclass::MeasureType;
131 
133  using typename Superclass::DerivativeType;
134 
136  using typename Superclass::ParametersType;
137 
139  itkSetConstObjectMacro(FixedImage, FixedImageType);
140  itkGetConstObjectMacro(FixedImage, FixedImageType);
144  itkSetConstObjectMacro(MovingImage, MovingImageType);
145  itkGetConstObjectMacro(MovingImage, MovingImageType);
149  itkSetObjectMacro(Transform, TransformType);
150 
152  itkGetModifiableObjectMacro(Transform, TransformType);
153 
155  itkSetObjectMacro(Interpolator, InterpolatorType);
156 
158  itkGetModifiableObjectMacro(Interpolator, InterpolatorType);
159 
163  {
164  return this->GetNumberOfPixelsCounted();
165  }
166 
167  itkGetConstReferenceMacro(NumberOfPixelsCounted, SizeValueType);
168 
170  virtual void
171  SetFixedImageRegion(const FixedImageRegionType reg);
172 
174  itkGetConstReferenceMacro(FixedImageRegion, FixedImageRegionType);
175 
177 #ifndef ITK_FUTURE_LEGACY_REMOVE
178  virtual void
179  SetMovingImageMask(MovingImageMaskType * const arg)
180  {
181  const auto * const constArg = arg;
182  // Call the overload defined by itkSetConstObjectMacro, or an override.
183  this->SetMovingImageMask(constArg);
184  }
185 #endif
186  itkSetConstObjectMacro(MovingImageMask, MovingImageMaskType);
187  itkGetConstObjectMacro(MovingImageMask, MovingImageMaskType);
191 #ifndef ITK_FUTURE_LEGACY_REMOVE
192  virtual void
193  SetFixedImageMask(FixedImageMaskType * const arg)
194  {
195  const auto * const constArg = arg;
196  // Call the overload defined by itkSetConstObjectMacro, or an override.
197  this->SetFixedImageMask(constArg);
198  }
199 #endif
200  itkSetConstObjectMacro(FixedImageMask, FixedImageMaskType);
201  itkGetConstObjectMacro(FixedImageMask, FixedImageMaskType);
206  void
207  SetFixedImageIndexes(const FixedImageIndexContainer & indexes);
208 
209  void
210  SetUseFixedImageIndexes(bool useIndexes);
211 
212  itkGetConstReferenceMacro(UseFixedImageIndexes, bool);
213 
215  void
216  SetNumberOfWorkUnits(ThreadIdType numberOfWorkUnits);
217  itkGetConstReferenceMacro(NumberOfWorkUnits, ThreadIdType);
221  itkSetMacro(ComputeGradient, bool);
222  itkGetConstReferenceMacro(ComputeGradient, bool);
223  itkBooleanMacro(ComputeGradient);
227  virtual void
228  ComputeGradient();
229 
231  itkGetModifiableObjectMacro(GradientImage, GradientImageType);
232 
234  void
235  SetTransformParameters(const ParametersType & parameters) const;
236 
238  unsigned int
239  GetNumberOfParameters() const override
240  {
241  return m_Transform->GetNumberOfParameters();
242  }
243 
245  virtual void
246  Initialize();
247 
249  virtual void
250  MultiThreadingInitialize();
251 
256  virtual void
257  SetNumberOfFixedImageSamples(SizeValueType numSamples);
258  itkGetConstReferenceMacro(NumberOfFixedImageSamples, SizeValueType);
263  void
265  {
266  this->SetNumberOfFixedImageSamples(num);
267  }
268 
271  {
272  return this->GetNumberOfFixedImageSamples();
273  }
274 
277  void
278  SetFixedImageSamplesIntensityThreshold(const FixedImagePixelType & thresh);
279 
280  itkGetConstReferenceMacro(FixedImageSamplesIntensityThreshold, FixedImagePixelType);
281 
282  void
283  SetUseFixedImageSamplesIntensityThreshold(bool useThresh);
284 
285  itkGetConstReferenceMacro(UseFixedImageSamplesIntensityThreshold, bool);
286 
290  void
291  SetUseAllPixels(bool useAllPixels);
292 
293  void
295  {
296  this->SetUseAllPixels(true);
297  }
298 
299  void
301  {
302  this->SetUseAllPixels(false);
303  }
304 
305  itkGetConstReferenceMacro(UseAllPixels, bool);
306 
311  void
312  SetUseSequentialSampling(bool useSequential);
313 
314  itkGetConstReferenceMacro(UseSequentialSampling, bool);
315 
325  void
326  ReinitializeSeed();
327  void
328  ReinitializeSeed(int seed);
347  itkSetMacro(UseCachingOfBSplineWeights, bool);
348  itkGetConstReferenceMacro(UseCachingOfBSplineWeights, bool);
349  itkBooleanMacro(UseCachingOfBSplineWeights);
354  itkGetModifiableObjectMacro(Threader, MultiThreaderType);
355  const TransformPointer *
357  {
358  return m_ThreaderTransform.get();
359  }
362 protected:
364  ~ImageToImageMetric() override = default;
365 
366  void
367  PrintSelf(std::ostream & os, Indent indent) const override;
368 
375  {
376  public:
378  {
379  point.Fill(0.0);
380  value = 0;
381  valueIndex = 0;
382  }
383 
384  ~FixedImageSamplePoint() = default;
385 
386  friend inline std::ostream &
387  operator<<(std::ostream & os, const FixedImageSamplePoint & val)
388  {
389  os << "point: " << static_cast<typename NumericTraits<FixedImagePointType>::PrintType>(val.point) << std::endl;
390  os << "value: " << val.value << std::endl;
391  os << "valueIndex: " << val.valueIndex << std::endl;
392 
393  return os;
394  }
395 
396  public:
398  double value;
399  unsigned int valueIndex;
400  };
401 
402  bool m_UseFixedImageIndexes{ false };
403  FixedImageIndexContainer m_FixedImageIndexes{};
404 
405  bool m_UseFixedImageSamplesIntensityThreshold{ false };
406  FixedImagePixelType m_FixedImageSamplesIntensityThreshold{};
407 
409  using FixedImageSampleContainer = std::vector<FixedImageSamplePoint>;
410 
415  virtual void
416  SampleFixedImageRegion(FixedImageSampleContainer & samples) const;
417 
419  virtual void
420  SampleFixedImageIndexes(FixedImageSampleContainer & samples) const;
421 
426  virtual void
427  SampleFullFixedImageRegion(FixedImageSampleContainer & samples) const;
428 
430  FixedImageSampleContainer m_FixedImageSamples{};
431 
432  SizeValueType m_NumberOfParameters{ 0 };
433 
434  SizeValueType m_NumberOfFixedImageSamples{ 50000 };
435  // m_NumberOfPixelsCounted must be mutable because the const
436  // thread consolidation functions merge each work unit's values
437  // onto this accumulator variable.
438  mutable SizeValueType m_NumberOfPixelsCounted{ 0 };
439 
440  FixedImageConstPointer m_FixedImage{};
441  MovingImageConstPointer m_MovingImage{};
442 
444  TransformPointer m_Transform{};
445 
448  std::unique_ptr<TransformPointer[]> m_ThreaderTransform;
449 
450  InterpolatorPointer m_Interpolator{};
451 
452  bool m_ComputeGradient{ true };
453  GradientImagePointer m_GradientImage{};
454 
455  FixedImageMaskConstPointer m_FixedImageMask{};
456  MovingImageMaskConstPointer m_MovingImageMask{};
457 
458  ThreadIdType m_NumberOfWorkUnits{ 1 };
459 
460  bool m_UseAllPixels{ false };
461  bool m_UseSequentialSampling{ false };
462 
463  bool m_ReseedIterator{ false };
464 
465  mutable int m_RandomSeed{};
466 
473 #ifndef ITK_FUTURE_LEGACY_REMOVE
474 
477  bool m_TransformIsBSpline{ false };
478 #endif
479 
482  SizeValueType m_NumBSplineWeights{ 0 };
483 
484  static constexpr unsigned int DeformationSplineOrder = 3;
485 
486  using BSplineTransformType =
488 
490  using WeightsValueType = typename BSplineTransformWeightsType::ValueType;
492 
494  using IndexValueType = typename BSplineTransformIndexArrayType::ValueType;
496 
497  using MovingImagePointArrayType = std::vector<MovingImagePointType>;
498  using BooleanArrayType = std::vector<bool>;
506 
510 
511  typename BSplineTransformType::Pointer m_BSplineTransform{};
512 
513  BSplineTransformWeightsArrayType m_BSplineTransformWeightsArray{};
514  BSplineTransformIndicesArrayType m_BSplineTransformIndicesArray{};
515  MovingImagePointArrayType m_BSplinePreTransformPointsArray{};
516  BooleanArrayType m_WithinBSplineSupportRegionArray{};
517 
518  BSplineParametersOffsetType m_BSplineParametersOffset{};
519 
520  // Variables needed for optionally caching values when using a BSpline
521  // transform.
522  bool m_UseCachingOfBSplineWeights{ true };
523  mutable BSplineTransformWeightsType m_BSplineTransformWeights{};
524  mutable BSplineTransformIndexArrayType m_BSplineTransformIndices{};
525 
526  mutable std::unique_ptr<BSplineTransformWeightsType[]> m_ThreaderBSplineTransformWeights;
527  mutable std::unique_ptr<BSplineTransformIndexArrayType[]> m_ThreaderBSplineTransformIndices;
528 
530  virtual void
531  PreComputeTransformValues();
532 
537  virtual void
538  TransformPoint(unsigned int sampleNumber,
539  MovingImagePointType & mappedPoint,
540  bool & sampleOk,
541  double & movingImageValue,
542  ThreadIdType threadId) const;
543 
548  virtual void
549  TransformPointWithDerivatives(unsigned int sampleNumber,
550  MovingImagePointType & mappedPoint,
551  bool & sampleOk,
552  double & movingImageValue,
553  ImageDerivativesType & movingImageGradient,
554  ThreadIdType threadId) const;
555 
556 #ifndef ITK_FUTURE_LEGACY_REMOVE
557 
560  bool m_InterpolatorIsBSpline{ false };
561 #endif
562 
564  typename BSplineInterpolatorType::Pointer m_BSplineInterpolator{};
565 
567  typename DerivativeFunctionType::Pointer m_DerivativeCalculator{};
568 
572  virtual void
573  ComputeImageDerivatives(const MovingImagePointType & mappedPoint,
574  ImageDerivativesType & gradient,
575  ThreadIdType threadId) const;
576 
590  {
591  public:
593  : m_ConstMetricPointer{ i2i_metricPointer }
594  {}
595  const ImageToImageMetric *
597  {
598  return m_ConstMetricPointer;
599  }
602  private:
604  };
605 
614  {
615  public:
616  MultiThreaderWorkUnitInfoImageToImageMetricWrapper(const void * workunitInfoAsVoid)
617  : m_WorkUnitInfo(static_cast<const typename MultiThreaderType::WorkUnitInfo *>(workunitInfoAsVoid))
618  {}
620  GetThreadId() const
621  {
622  return m_WorkUnitInfo->WorkUnitID;
623  }
624  const ImageToImageMetric *
626  {
627  return (static_cast<ConstantPointerWrapper *>(m_WorkUnitInfo->UserData))->GetConstMetricPointer();
628  }
631  private:
633  };
634 
636  std::unique_ptr<ConstantPointerWrapper> m_ConstSelfWrapper;
637  mutable std::unique_ptr<unsigned int[]> m_ThreaderNumberOfMovingImageSamples;
638  bool m_WithinThreadPreProcess{ false };
639  bool m_WithinThreadPostProcess{ false };
640 
641  void
642  GetValueMultiThreadedInitiate() const;
643 
644  void
645  GetValueMultiThreadedPostProcessInitiate() const;
646 
649  GetValueMultiThreaded(void * workunitInfoAsVoid);
650 
653  GetValueMultiThreadedPostProcess(void * workunitInfoAsVoid);
654 
656  virtual inline void
657  GetValueThread(ThreadIdType threadId) const;
658 
660  virtual inline void
661  GetValueThreadPreProcess(ThreadIdType itkNotUsed(threadId), bool itkNotUsed(withinSampleThread)) const
662  {}
663  virtual inline bool
665  SizeValueType itkNotUsed(fixedImageSample),
666  const MovingImagePointType & itkNotUsed(mappedPoint),
667  double itkNotUsed(movingImageValue)) const
668  {
669  return false;
670  }
671  virtual inline void
672  GetValueThreadPostProcess(ThreadIdType itkNotUsed(threadId), bool itkNotUsed(withinSampleThread)) const
673  {}
676  void
677  GetValueAndDerivativeMultiThreadedInitiate() const;
678 
679  void
680  GetValueAndDerivativeMultiThreadedPostProcessInitiate() const;
681 
683  GetValueAndDerivativeMultiThreaded(void * workunitInfoAsVoid);
684 
686  GetValueAndDerivativeMultiThreadedPostProcess(void * workunitInfoAsVoid);
687 
688  virtual inline void
689  GetValueAndDerivativeThread(ThreadIdType threadId) const;
690 
691  virtual inline void
692  GetValueAndDerivativeThreadPreProcess(ThreadIdType itkNotUsed(threadId), bool itkNotUsed(withinSampleThread)) const
693  {}
694  virtual inline bool
696  SizeValueType itkNotUsed(fixedImageSample),
697  const MovingImagePointType & itkNotUsed(mappedPoint),
698  double itkNotUsed(movingImageValue),
699  const ImageDerivativesType & itkNotUsed(movingImageGradientValue)) const
700  {
701  return false;
702  }
703  virtual inline void
704  GetValueAndDerivativeThreadPostProcess(ThreadIdType itkNotUsed(threadId), bool itkNotUsed(withinSampleThread)) const
705  {}
706 
712  virtual void
713  SynchronizeTransforms() const;
714 
715 private:
716  FixedImageRegionType m_FixedImageRegion{};
717 };
718 } // end namespace itk
719 
720 #ifndef ITK_MANUAL_INSTANTIATION
721 # include "itkImageToImageMetric.hxx"
722 #endif
723 
724 #endif
itk::ImageToImageMetric::FixedImageConstPointer
typename FixedImageType::ConstPointer FixedImageConstPointer
Definition: itkImageToImageMetric.h:79
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::MultiThreaderBase
A class for performing multithreaded execution.
Definition: itkMultiThreaderBase.h:107
itk::ImageToImageMetric
Computes similarity between regions of two images.
Definition: itkImageToImageMetric.h:54
itk::ImageToImageMetric::MultiThreaderWorkUnitInfoImageToImageMetricWrapper::m_WorkUnitInfo
const MultiThreaderType::WorkUnitInfo * m_WorkUnitInfo
Definition: itkImageToImageMetric.h:632
itk::ImageToImageMetric::MovingImageMaskConstPointer
typename MovingImageMaskType::ConstPointer MovingImageMaskConstPointer
Definition: itkImageToImageMetric.h:127
itk::ImageToImageMetric::WeightsValueType
typename BSplineTransformWeightsType::ValueType WeightsValueType
Definition: itkImageToImageMetric.h:490
itk::ImageToImageMetric::MovingImageIndexType
typename MovingImageType::IndexType MovingImageIndexType
Definition: itkImageToImageMetric.h:98
ConstPointer
SmartPointer< const Self > ConstPointer
Definition: itkAddImageFilter.h:94
itk::ImageToImageMetric::MovingImagePointArrayType
std::vector< MovingImagePointType > MovingImagePointArrayType
Definition: itkImageToImageMetric.h:497
itk::ImageToImageMetric::GetValueAndDerivativeThreadPreProcess
virtual void GetValueAndDerivativeThreadPreProcess(ThreadIdType, bool) const
Definition: itkImageToImageMetric.h:692
itk::ImageToImageMetric::FixedImageSamplePoint::valueIndex
unsigned int valueIndex
Definition: itkImageToImageMetric.h:399
itk::ImageToImageMetric::GetValueAndDerivativeThreadPostProcess
virtual void GetValueAndDerivativeThreadPostProcess(ThreadIdType, bool) const
Definition: itkImageToImageMetric.h:704
itk::ImageToImageMetric::m_ConstSelfWrapper
std::unique_ptr< ConstantPointerWrapper > m_ConstSelfWrapper
Definition: itkImageToImageMetric.h:636
itk::MultiThreaderBase::WorkUnitInfo
Definition: itkMultiThreaderBase.h:288
itk::ImageToImageMetric::FixedImagePointType
typename TransformType::InputPointType FixedImagePointType
Definition: itkImageToImageMetric.h:99
itk::ImageToImageMetric::GetNumberOfMovingImageSamples
SizeValueType GetNumberOfMovingImageSamples()
Definition: itkImageToImageMetric.h:162
itk::ImageToImageMetric::FixedImageIndexValueType
typename FixedImageIndexType::IndexValueType FixedImageIndexValueType
Definition: itkImageToImageMetric.h:97
itk::ImageToImageMetric::MultiThreaderWorkUnitInfoImageToImageMetricWrapper::MultiThreaderWorkUnitInfoImageToImageMetricWrapper
MultiThreaderWorkUnitInfoImageToImageMetricWrapper(const void *workunitInfoAsVoid)
Definition: itkImageToImageMetric.h:616
itk::BSplineInterpolateImageFunction
Evaluates the B-Spline interpolation of an image. Spline order may be from 0 to 5.
Definition: itkBSplineInterpolateImageFunction.h:83
itk::ImageToImageMetric::TransformParametersType
typename TransformType::ParametersType TransformParametersType
Definition: itkImageToImageMetric.h:92
itk::BSplineBaseTransform::WeightsType
typename WeightsFunctionType::WeightsType WeightsType
Definition: itkBSplineBaseTransform.h:235
itk::ImageToImageMetric::ConstantPointerWrapper::ConstantPointerWrapper
ConstantPointerWrapper(ImageToImageMetric *i2i_metricPointer)
Definition: itkImageToImageMetric.h:592
itkSpatialObject.h
itk::ImageToImageMetric::GetValueThreadProcessSample
virtual bool GetValueThreadProcessSample(ThreadIdType, SizeValueType, const MovingImagePointType &, double) const
Definition: itkImageToImageMetric.h:664
itk::ImageToImageMetric::GetNumberOfParameters
unsigned int GetNumberOfParameters() const override
Definition: itkImageToImageMetric.h:239
itk::ImageToImageMetric::FixedImageIndexContainer
std::vector< FixedImageIndexType > FixedImageIndexContainer
Definition: itkImageToImageMetric.h:102
itk::ImageToImageMetric::RealType
typename NumericTraits< MovingImagePixelType >::RealType RealType
Definition: itkImageToImageMetric.h:108
itk::ImageToImageMetric::TransformJacobianType
typename TransformType::JacobianType TransformJacobianType
Definition: itkImageToImageMetric.h:93
itk::ImageToImageMetric::UseAllPixelsOff
void UseAllPixelsOff()
Definition: itkImageToImageMetric.h:300
itk::ImageToImageMetric::ConstantPointerWrapper
Definition: itkImageToImageMetric.h:589
itk::CentralDifferenceImageFunction
Calculate the derivative by central differencing.
Definition: itkCentralDifferenceImageFunction.h:76
itk::ImageToImageMetric::MovingImagePointType
typename TransformType::OutputPointType MovingImagePointType
Definition: itkImageToImageMetric.h:100
itk::ImageToImageMetric::m_ThreaderNumberOfMovingImageSamples
std::unique_ptr< unsigned int[]> m_ThreaderNumberOfMovingImageSamples
Definition: itkImageToImageMetric.h:637
itk::ImageToImageMetric::FixedImageType
TFixedImage FixedImageType
Definition: itkImageToImageMetric.h:77
itk::ImageToImageMetric::m_ThreaderBSplineTransformWeights
std::unique_ptr< BSplineTransformWeightsType[]> m_ThreaderBSplineTransformWeights
Definition: itkImageToImageMetric.h:526
itk::ImageToImageMetric::OutputPointType
typename TransformType::OutputPointType OutputPointType
Definition: itkImageToImageMetric.h:91
itk::operator<<
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ImageToImageMetric::IndexValueType
typename BSplineTransformIndexArrayType::ValueType IndexValueType
Definition: itkImageToImageMetric.h:494
itk::ImageToImageMetric::InputPointType
typename TransformType::InputPointType InputPointType
Definition: itkImageToImageMetric.h:90
itk::ImageToImageMetric::GetValueAndDerivativeThreadProcessSample
virtual bool GetValueAndDerivativeThreadProcessSample(ThreadIdType, SizeValueType, const MovingImagePointType &, double, const ImageDerivativesType &) const
Definition: itkImageToImageMetric.h:695
itk::IndexValueType
long IndexValueType
Definition: itkIntTypes.h:93
itk::ImageToImageMetric::FixedImageMaskPointer
typename FixedImageMaskType::Pointer FixedImageMaskPointer
Definition: itkImageToImageMetric.h:120
itk::ImageToImageMetric::BooleanArrayType
std::vector< bool > BooleanArrayType
Definition: itkImageToImageMetric.h:498
itk::ThreadIdType
unsigned int ThreadIdType
Definition: itkIntTypes.h:102
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itkBSplineInterpolateImageFunction.h
itkGradientRecursiveGaussianImageFilter.h
itk::ImageToImageMetric::GetValueThreadPreProcess
virtual void GetValueThreadPreProcess(ThreadIdType, bool) const
Definition: itkImageToImageMetric.h:661
itk::ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
itk::ITK_THREAD_RETURN_TYPE ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
Definition: itkThreadSupport.h:79
itk::ImageToImageMetric::FixedImageSamplePoint::FixedImageSamplePoint
FixedImageSamplePoint()
Definition: itkImageToImageMetric.h:377
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkCentralDifferenceImageFunction.h
itk::ImageToImageMetric::MovingImageConstPointer
typename MovingImageType::ConstPointer MovingImageConstPointer
Definition: itkImageToImageMetric.h:74
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itk::ImageToImageMetric::SetNumberOfSpatialSamples
void SetNumberOfSpatialSamples(SizeValueType num)
Definition: itkImageToImageMetric.h:264
itk::ImageToImageMetric::m_ThreaderBSplineTransformIndices
std::unique_ptr< BSplineTransformIndexArrayType[]> m_ThreaderBSplineTransformIndices
Definition: itkImageToImageMetric.h:527
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itk::NumericTraits::PrintType
T PrintType
Definition: itkNumericTraits.h:70
itk::GradientRecursiveGaussianImageFilter
Computes the gradient of an image by convolution with the first derivative of a Gaussian.
Definition: itkGradientRecursiveGaussianImageFilter.h:59
itk::SingleValuedCostFunction
This class is a base for the CostFunctions returning a single value.
Definition: itkSingleValuedCostFunction.h:34
itk::ImageToImageMetric::FixedImageMaskConstPointer
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
Definition: itkImageToImageMetric.h:121
itk::ImageToImageMetric::m_ThreaderTransform
std::unique_ptr< TransformPointer[]> m_ThreaderTransform
Definition: itkImageToImageMetric.h:448
itk::ImageToImageMetric::FixedImagePixelType
typename TFixedImage::PixelType FixedImagePixelType
Definition: itkImageToImageMetric.h:78
itk::ImageToImageMetric::FixedImageSamplePoint::point
FixedImagePointType point
Definition: itkImageToImageMetric.h:397
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::ImageToImageMetric::GetThreaderTransform
const TransformPointer * GetThreaderTransform()
Definition: itkImageToImageMetric.h:356
itk::ImageToImageMetric::MultiThreaderWorkUnitInfoImageToImageMetricWrapper
Definition: itkImageToImageMetric.h:613
itk::ImageToImageMetric::FixedImageSampleContainer
std::vector< FixedImageSamplePoint > FixedImageSampleContainer
Definition: itkImageToImageMetric.h:409
itk::FixedArray
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:53
itk::ImageToImageMetric::UseAllPixelsOn
void UseAllPixelsOn()
Definition: itkImageToImageMetric.h:294
itk::ImageToImageMetric::MovingImagePixelType
typename TMovingImage::PixelType MovingImagePixelType
Definition: itkImageToImageMetric.h:73
itk::CovariantVector
A templated class holding a n-Dimensional covariant vector.
Definition: itkCovariantVector.h:70
itk::ImageToImageMetric::MultiThreaderWorkUnitInfoImageToImageMetricWrapper::GetThreadId
ThreadIdType GetThreadId() const
Definition: itkImageToImageMetric.h:620
itk::ImageToImageMetric::TransformPointer
typename TransformType::Pointer TransformPointer
Definition: itkImageToImageMetric.h:89
itk::ImageToImageMetric::ConstantPointerWrapper::m_ConstMetricPointer
const ImageToImageMetric * m_ConstMetricPointer
Definition: itkImageToImageMetric.h:603
itk::ImageToImageMetric::FixedImageSamplePoint
Definition: itkImageToImageMetric.h:374
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::ImageToImageMetric::MovingImageType
TMovingImage MovingImageType
Definition: itkImageToImageMetric.h:72
itkMultiThreaderBase.h
itk::ImageToImageMetric::FixedImageSamplePoint::value
double value
Definition: itkImageToImageMetric.h:398
itkBSplineBaseTransform.h
itk::BSplineBaseTransform
A base class with common elements of BSplineTransform and BSplineDeformableTransform.
Definition: itkBSplineBaseTransform.h:34
itk::ImageToImageMetric::GradientImageFilterPointer
typename GradientImageFilterType::Pointer GradientImageFilterPointer
Definition: itkImageToImageMetric.h:113
itk::ImageToImageMetric::GetValueThreadPostProcess
virtual void GetValueThreadPostProcess(ThreadIdType, bool) const
Definition: itkImageToImageMetric.h:672
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::Image
Templated n-dimensional image class.
Definition: itkImage.h:88
itk::ImageToImageMetric::InterpolatorPointer
typename InterpolatorType::Pointer InterpolatorPointer
Definition: itkImageToImageMetric.h:115
itk::ImageToImageMetric::MultiThreaderWorkUnitInfoImageToImageMetricWrapper::GetConstImageToImageMetricPointer
const ImageToImageMetric * GetConstImageToImageMetricPointer() const
Definition: itkImageToImageMetric.h:625
itk::NumericTraits::RealType
double RealType
Definition: itkNumericTraits.h:86
itk::Transform
Transform points and vectors from an input space to an output space.
Definition: itkTransform.h:83
itk::ImageToImageMetric::FixedImageIndexType
typename FixedImageType::IndexType FixedImageIndexType
Definition: itkImageToImageMetric.h:96
itk::Array2D
Array2D class representing a 2D array.
Definition: itkArray2D.h:42
itkSingleValuedCostFunction.h
itk::ImageToImageMetric::CoordinateRepresentationType
typename Superclass::ParametersValueType CoordinateRepresentationType
Definition: itkImageToImageMetric.h:66
itk::ImageToImageMetric::ConstantPointerWrapper::GetConstMetricPointer
const ImageToImageMetric * GetConstMetricPointer() const
Definition: itkImageToImageMetric.h:596
itk::ImageToImageMetric::GetNumberOfSpatialSamples
SizeValueType GetNumberOfSpatialSamples()
Definition: itkImageToImageMetric.h:270
itk::ImageToImageMetric::BSplineTransformWeightsType
typename BSplineTransformType::WeightsType BSplineTransformWeightsType
Definition: itkImageToImageMetric.h:489
itk::ImageToImageMetric::BSplineTransformIndexArrayType
typename BSplineTransformType::ParameterIndexArrayType BSplineTransformIndexArrayType
Definition: itkImageToImageMetric.h:493
itk::InterpolateImageFunction
Base class for all image interpolators.
Definition: itkInterpolateImageFunction.h:45
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:86
itk::ImageToImageMetric::MovingImageMaskPointer
typename MovingImageMaskType::Pointer MovingImageMaskPointer
Definition: itkImageToImageMetric.h:126
itk::ImageToImageMetric::FixedImageRegionType
typename FixedImageType::RegionType FixedImageRegionType
Definition: itkImageToImageMetric.h:80