18 #ifndef itkMattesMutualInformationImageToImageMetricv4_h
19 #define itkMattesMutualInformationImageToImageMetricv4_h
97 template <
typename TFixedImage,
98 typename TMovingImage,
99 typename TVirtualImage = TFixedImage,
100 typename TInternalComputationValueType = double,
101 typename TMetricTraits =
102 DefaultImageToImageMetricTraitsv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType>>
104 :
public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
123 using typename Superclass::MeasureType;
124 using typename Superclass::DerivativeType;
127 using typename Superclass::FixedImageType;
128 using typename Superclass::FixedImagePointType;
129 using typename Superclass::FixedImageIndexType;
130 using typename Superclass::FixedImagePixelType;
131 using typename Superclass::FixedImageGradientType;
133 using typename Superclass::MovingImagePointType;
134 using typename Superclass::MovingImagePixelType;
135 using typename Superclass::MovingImageGradientType;
137 using typename Superclass::MovingTransformType;
138 using typename Superclass::JacobianType;
140 using typename Superclass::VirtualIndexType;
141 using typename Superclass::VirtualPointType;
142 using typename Superclass::VirtualPointSetType;
145 using typename Superclass::FixedSampledPointSetPointer;
148 static constexpr
typename TVirtualImage::ImageDimensionType VirtualImageDimension = TVirtualImage::ImageDimension;
149 static constexpr
typename TFixedImage::ImageDimensionType FixedImageDimension = TFixedImage::ImageDimension;
150 static constexpr
typename TMovingImage::ImageDimensionType MovingImageDimension = TMovingImage::ImageDimension;
158 itkGetConstReferenceMacro(NumberOfHistogramBins,
SizeValueType);
162 Initialize()
override;
180 if (this->m_ThreaderJointPDF.empty())
184 return this->m_ThreaderJointPDF[0];
197 return this->m_JointPDFDerivatives;
212 ThreadedIndexedContainerPartitioner,
217 ThreadedImageRegionPartitioner<Superclass::VirtualImageDimension>,
226 PrintSelf(std::ostream & os, Indent indent) const override;
244 GetValueCommonAfterThreadedExecution();
247 ComputeSingleFixedImageParzenWindowIndex(const FixedImagePixelType & value) const;
268 mutable std::vector<OffsetValueType> m_JointPdfIndex1DArray{};
271 mutable std::vector<PDFValueType> m_MovingImageMarginalPDF{};
272 mutable std::vector<std::vector<PDFValueType>> m_ThreaderFixedImageMarginalPDF{};
275 typename std::vector<typename JointPDFType::Pointer> m_ThreaderJointPDF{};
297 Initialize(
size_t maxBufferLength,
298 const size_t cachedNumberOfLocalParameters,
299 std::mutex * parentDerivativeMutexPtr,
314 return this->m_CachedNumberOfLocalParameters;
322 CheckAndReduceIfNecessary();
334 m_BufferOffsetContainer[m_CurrentFillSize] = offset;
335 PDFValueType * PDFBufferForWriting = m_BufferPDFValuesContainer[m_CurrentFillSize];
337 return PDFBufferForWriting;
349 size_t m_CurrentFillSize{ 0 };
364 std::vector<DerivativeBufferManager> m_ThreaderDerivativeManager{};
365 std::mutex m_JointPDFDerivativesLock{};
372 mutable std::vector<DerivativeType> m_LocalDerivativeByParzenBin{};
377 ComputeResults()
const;
382 #ifndef ITK_MANUAL_INSTANTIATION
383 # include "itkMattesMutualInformationImageToImageMetricv4.hxx"