18#ifndef itkComputeDisplacementDistribution_h
19#define itkComputeDisplacementDistribution_h
27#include "itkMultiThreaderBase.h"
47template <
class TFixedImage,
class TTransform>
71 using Superclass::ParametersType;
72 using Superclass::DerivativeType;
96 itkSetMacro(NumberOfJacobianMeasurements, SizeValueType);
102 if (region != this->m_FixedImageRegion)
104 this->m_FixedImageRegion = region;
114 Compute(
const ParametersType & mu,
double & jacg,
double & maxJJ, std::string method);
127 this->m_Threader->SetNumberOfWorkUnits(numberOfThreads);
144 typename FixedImageType::ConstPointer m_FixedImage{};
149 SizeValueType m_NumberOfJacobianMeasurements{};
150 DerivativeType m_ExactGradient{};
151 SizeValueType m_NumberOfParameters{};
152 MultiThreaderBase::Pointer m_Threader{};
190 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
215 itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedComputePerThreadStruct, AlignedComputePerThreadStruct);
220 mutable std::vector<AlignedComputePerThreadStruct> m_ComputePerThreadVariables{};
222 SizeValueType m_NumberOfPixelsCounted{};
223 bool m_UseMultiThread{};
229#ifndef ITK_MANUAL_INSTANTIATION
230# include "itkComputeDisplacementDistribution.hxx"
This is a helper class for the automatic parameter estimation of the ASGD optimizer.
typename ImageFullSamplerType::Pointer ImageFullSamplerPointer
typename FixedImageType::PointType FixedImagePointType
typename FixedImageType::PixelType FixedImagePixelType
virtual void Compute(const ParametersType &mu, double &jacg, double &maxJJ, std::string method)
typename FixedImageMaskType::Pointer FixedImageMaskPointer
virtual void ComputeSingleThreaded(const ParametersType &mu, double &jacg, double &maxJJ, std::string method)
typename ImageGridSamplerType::Pointer ImageGridSamplerPointer
itkPadStruct(ITK_CACHE_LINE_ALIGNMENT, ComputePerThreadStruct, PaddedComputePerThreadStruct)
virtual void ThreadedCompute(ThreadIdType threadID)
typename FixedImageType::IndexType FixedImageIndexType
itkStaticConstMacro(FixedImageDimension, unsigned int, TFixedImage::ImageDimension)
ComputeDisplacementDistribution()
typename TransformType::JacobianType JacobianType
virtual void SampleFixedImageForJacobianTerms(ImageSampleContainerPointer &sampleContainer)
virtual void ComputeUsingSearchDirection(const ParametersType &mu, double &jacg, double &maxJJ, std::string methods)
virtual void InitializeThreadingParameters()
itkAlignedTypedef(ITK_CACHE_LINE_ALIGNMENT, PaddedComputePerThreadStruct, AlignedComputePerThreadStruct)
typename ImageRandomSamplerBaseType::Pointer ImageRandomSamplerBasePointer
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputeThreaderCallback(void *arg)
virtual void AfterThreadedCompute(double &jacg, double &maxJJ)
void SetFixedImageRegion(const FixedImageRegionType ®ion)
typename FixedImageType::RegionType FixedImageRegionType
MultiThreaderBase::WorkUnitInfo ThreadInfoType
ITK_DISALLOW_COPY_AND_MOVE(ComputeDisplacementDistribution)
ImageMaskSpatialObject< Self::FixedImageDimension > FixedImageMaskType
~ComputeDisplacementDistribution() override=default
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
void LaunchComputeThreaderCallback() const
typename TransformType::NumberOfParametersType NumberOfParametersType
typename TransformType::NonZeroJacobianIndicesType NonZeroJacobianIndicesType
void SetNumberOfWorkUnits(ThreadIdType numberOfThreads)
typename ImageGridSamplerType ::ImageSampleContainerType ImageSampleContainerType
TFixedImage FixedImageType
typename TransformType::Pointer TransformPointer
typename TransformType::ScalarType CoordinateRepresentationType
SmartPointer< const Self > ConstPointer
typename JacobianType::ValueType JacobianValueType
JacobianType TransformJacobianType
typename ImageSamplerBaseType::Pointer ImageSamplerBasePointer
typename FixedImageMaskType::ConstPointer FixedImageMaskConstPointer
virtual void BeforeThreadedCompute(const ParametersType &mu)
Samples all voxels in the InputImageRegion.
Samples image voxels on a regular grid.
This class is a base class for any image sampler that randomly picks samples.
This class is a base class for any image sampler.
NonLinearOptimizer::ScalesType ScalesType
double st_DisplacementSquared
SizeValueType st_NumberOfPixelsCounted