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;
136 const auto interpolator = DefaultInterpolatorType::New();
137 interpolator->SetSplineOrder(3);
156 bool m_UseRandomSampleRegion{
false };
161#ifndef ITK_MANUAL_INSTANTIATION
162# 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
void ThreadedGenerateData(const InputImageRegionType &inputRegionForThread, ThreadIdType threadId) override
~ImageRandomCoordinateSampler() override=default
itk::Statistics::MersenneTwisterRandomVariateGenerator RandomGeneratorType
void BeforeThreadedGenerateData() override
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
SmartPointer< const Self > ConstPointer
itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension)
This class is a base class for any image sampler that randomly picks samples.
SpatialObject< Self::InputImageDimension > MaskType
typename ImageSampleContainerType::Pointer ImageSampleContainerPointer
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
TInputImage InputImageType
typename InputImageType::PixelType InputImagePixelType
typename InputImageType::ConstPointer InputImageConstPointer
typename InputImageType::RegionType InputImageRegionType
typename InputImageType::Pointer InputImagePointer
TOutputVectorContainer OutputVectorContainerType
typename OutputVectorContainerType::Pointer OutputVectorContainerPointer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.