18 #ifndef itkMattesMutualInformationImageToImageMetricv4_h
19 #define itkMattesMutualInformationImageToImageMetricv4_h
97 template <
typename TFixedImage,
typename TMovingImage,
typename TVirtualImage = TFixedImage,
98 typename TInternalComputationValueType = double,
99 typename TMetricTraits = DefaultImageToImageMetricTraitsv4<TFixedImage,TMovingImage,TVirtualImage,TInternalComputationValueType>
102 public ImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualImage, TInternalComputationValueType, TMetricTraits>
119 typedef typename Superclass::MeasureType
MeasureType;
144 itkStaticConstMacro(VirtualImageDimension,
typename TVirtualImage::ImageDimensionType, TVirtualImage::ImageDimension);
145 itkStaticConstMacro(FixedImageDimension,
typename TFixedImage::ImageDimensionType, TFixedImage::ImageDimension);
146 itkStaticConstMacro(MovingImageDimension,
typename TMovingImage::ImageDimensionType, TMovingImage::ImageDimension);
154 itkGetConstReferenceMacro(NumberOfHistogramBins,
SizeValueType);
157 virtual void Initialize(
void) throw ( itk::
ExceptionObject ) ITK_OVERRIDE;
172 const typename JointPDFType::
Pointer GetJointPDF ()
const
174 if( this->m_ThreaderJointPDF.size() == 0 )
178 return this->m_ThreaderJointPDF[0];
190 return this->m_JointPDFDerivatives;
193 virtual void FinalizeThread(
const ThreadIdType threadId ) ITK_OVERRIDE;
206 void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE;
223 virtual void GetValueCommonAfterThreadedExecution();
225 OffsetValueType ComputeSingleFixedImageParzenWindowIndex( const FixedImagePixelType & value ) const;
250 mutable std::vector<OffsetValueType> m_JointPdfIndex1DArray;
253 mutable std::vector<PDFValueType> m_MovingImageMarginalPDF;
254 mutable std::vector<std::vector<PDFValueType> > m_ThreaderFixedImageMarginalPDF;
257 typename std::vector<typename JointPDFType::Pointer> m_ThreaderJointPDF;
277 void Initialize(
size_t maxBufferLength,
const size_t cachedNumberOfLocalParameters,
281 void DoubleBufferSize();
284 m_CurrentFillSize(0),
295 return this->m_CachedNumberOfLocalParameters;
302 void CheckAndReduceIfNecessary();
307 void BlockAndReduce();
312 m_BufferOffsetContainer[m_CurrentFillSize] = offset;
313 PDFValueType * PDFBufferForWriting = m_BufferPDFValuesContainer[m_CurrentFillSize];
315 return PDFBufferForWriting;
355 virtual void ComputeResults()
const;
361 #ifndef ITK_MANUAL_INSTANTIATION
362 #include "itkMattesMutualInformationImageToImageMetricv4.hxx"
Critical section locking class that can be allocated on the stack.
Superclass::RegionType RegionType
Light weight base class for most itk classes.
Represent the size (bounds) of a n-dimensional image.
signed long OffsetValueType
Class for partitioning of an ImageRegion.
unsigned long SizeValueType
Derivative of a BSpline kernel used for density estimation and nonparameteric regression.
BSpline kernel used for density estimation and nonparameteric regression.
Superclass::IndexType IndexType
Standard exception handling object.
unsigned int ThreadIdType
Define additional traits for native types such as int or float.
Templated n-dimensional image class.