|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
18 #ifndef itkImageRandomNonRepeatingConstIteratorWithIndex_h
19 #define itkImageRandomNonRepeatingConstIteratorWithIndex_h
103 std::ostringstream ostrm;
104 ostrm <<
"Error: RandomPermuation does not have " << i <<
" elements" << std::endl;
105 throw std::runtime_error(ostrm.str());
217 template <
typename TImage>
259 m_Permutation =
nullptr;
264 operator=(
const Self & it);
270 m_NumberOfSamplesDone = 0L;
271 this->UpdatePosition();
279 m_NumberOfSamplesDone = m_NumberOfSamplesRequested;
280 this->UpdatePosition();
288 return (m_NumberOfSamplesDone == 0L);
295 return (m_NumberOfSamplesDone >= m_NumberOfSamplesRequested);
299 static constexpr
unsigned int ImageDimension = TImage::ImageDimension;
317 ++m_NumberOfSamplesDone;
318 this->UpdatePosition();
328 --m_NumberOfSamplesDone;
329 this->UpdatePosition();
338 m_NumberOfSamplesRequested = number;
339 if (number > m_NumberOfPixelsInRegion)
341 m_NumberOfSamplesRequested = m_NumberOfPixelsInRegion;
349 return m_NumberOfSamplesRequested;
359 ReinitializeSeed(
int);
373 #ifndef ITK_MANUAL_INSTANTIATION
374 # include "itkImageRandomNonRepeatingConstIteratorWithIndex.hxx"
SizeValueType operator[](SizeValueType i) const
~ImageRandomNonRepeatingConstIteratorWithIndex() override
Produce a random permutation of a collection.
typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer GeneratorPointer
void SetNumberOfSamples(SizeValueType number)
typename PixelContainer::Pointer PixelContainerPointer
ImageBaseType::SizeType SizeType
void SetPriority(SizeValueType i, SizeValueType priority) const
typename TImage::PixelType PixelType
typename TImage::InternalPixelType InternalPixelType
ImageBaseType::IndexType IndexType
void ReinitializeSeed() const
ImageBaseType::RegionType RegionType
A node to be used when computing permutations.
typename TImage::AccessorType AccessorType
static Pointer New()
Method for creation through the object factory.
bool operator<(const NodeOfPermutation &b) const
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
RandomPermutation & operator=(const RandomPermutation &it)
SizeValueType GetNumberOfSamples() const
NodeOfPermutation * m_Permutation
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
GeneratorPointer m_Generator
A multi-dimensional image iterator that visits a random set of pixels within an image region....
Templated n-dimensional image class.
void ReinitializeSeed(unsigned int seed) const
typename TImage::PixelContainer PixelContainer
typename SizeType::SizeValueType SizeValueType
Self & operator=(const Self &it)
unsigned long SizeValueType
RandomPermutation(SizeValueType sz)
typename TImage::OffsetType OffsetType
ImageRandomNonRepeatingConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > &it)