18#ifndef itkImageRandomCoordinateSampler_h
19#define itkImageRandomCoordinateSampler_h
22#include "itkInterpolateImageFunction.h"
23#include "itkBSplineInterpolateImageFunction.h"
24#include "itkMersenneTwisterRandomVariateGenerator.h"
39template <
class TInputImage>
58 using typename Superclass::DataObjectPointer;
102 itkGetConstMacro(UseRandomSampleRegion,
bool);
103 itkSetMacro(UseRandomSampleRegion,
bool);
116 PrintSelf(std::ostream & os, Indent indent)
const override;
129 const auto interpolator = DefaultInterpolatorType::New();
130 interpolator->SetSplineOrder(3);
159 std::vector<InputImageContinuousIndexType> m_RandomCoordinates{};
161 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
164 bool m_UseRandomSampleRegion{
false };
169#ifndef ITK_MANUAL_INSTANTIATION
170# include "itkImageRandomCoordinateSampler.hxx"
Samples an image by randomly composing a set of physical coordinates.
typename InterpolatorType::Pointer InterpolatorPointer
BSplineInterpolateImageFunction< InputImageType, CoordRepType, double > DefaultInterpolatorType
typename InterpolatorType::ContinuousIndexType InputImageContinuousIndexType
virtual void GenerateSampleRegion(const InputImageContinuousIndexType &smallestImageContIndex, const InputImageContinuousIndexType &largestImageContIndex, InputImageContinuousIndexType &smallestContIndex, InputImageContinuousIndexType &largestContIndex)
void PrintSelf(std::ostream &os, Indent indent) const override
~ImageRandomCoordinateSampler() override=default
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
typename InputImageType::SpacingType InputImageSpacingType
itkGetModifiableObjectMacro(Interpolator, InterpolatorType)
ITK_DISALLOW_COPY_AND_MOVE(ImageRandomCoordinateSampler)
ImageRandomCoordinateSampler()=default
virtual void GenerateRandomCoordinate(const InputImageContinuousIndexType &smallestContIndex, const InputImageContinuousIndexType &largestContIndex, InputImageContinuousIndexType &randomContIndex)
typename RandomGeneratorType::Pointer RandomGeneratorPointer
InterpolateImageFunction< InputImageType, CoordRepType > InterpolatorType
void GenerateData() override
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreaderCallback(void *arg)
SmartPointer< const Self > ConstPointer
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
This class is a base class for any image sampler that randomly picks samples.
typename InputImageType::ConstPointer InputImageConstPointer
TInputImage InputImageType
typename InputImageType::RegionType InputImageRegionType
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
typename InputImageType::Pointer InputImagePointer
ImageMaskSpatialObject< Self::InputImageDimension > MaskType
typename InputImageType::PixelType InputImagePixelType
A class that defines an image sample, which is the coordinates of a point and its value.
typename InputImageType::PointType InputImagePointType
typename InputImageType::SizeType InputImageSizeType
typename InputImagePointType::ValueType InputImagePointValueType
typename ImageSampleType::RealType ImageSampleValueType
typename InputImageType::IndexType InputImageIndexType
typename OutputVectorContainerType::Pointer OutputVectorContainerPointer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
ITK_DISALLOW_COPY_AND_MOVE(UserData)
const std::vector< InputImageContinuousIndexType > & m_RandomCoordinates
std::vector< ImageSampleType > & m_Samples
const InterpolatorType & m_Interpolator
const InputImageType & m_InputImage