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());
213template <
typename TImage>
255 m_Permutation =
nullptr;
260 operator=(
const Self & it);
266 m_NumberOfSamplesDone = 0L;
267 this->UpdatePosition();
275 m_NumberOfSamplesDone = m_NumberOfSamplesRequested;
276 this->UpdatePosition();
284 return (m_NumberOfSamplesDone == 0L);
291 return (m_NumberOfSamplesDone >= m_NumberOfSamplesRequested);
295 static constexpr unsigned int ImageDimension = TImage::ImageDimension;
313 ++m_NumberOfSamplesDone;
314 this->UpdatePosition();
324 --m_NumberOfSamplesDone;
325 this->UpdatePosition();
334 m_NumberOfSamplesRequested = number;
335 if (number > m_NumberOfPixelsInRegion)
337 m_NumberOfSamplesRequested = m_NumberOfPixelsInRegion;
343 GetNumberOfSamples()
const
345 return m_NumberOfSamplesRequested;
355 ReinitializeSeed(
int);
369#ifndef ITK_MANUAL_INSTANTIATION
370# include "itkImageRandomNonRepeatingConstIteratorWithIndex.hxx"
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
Self & operator=(const Self &it)
typename SizeType::SizeValueType SizeValueType
typename TImage::AccessorType AccessorType
typename TImage::PixelType PixelType
typename PixelContainer::Pointer PixelContainerPointer
typename TImage::OffsetType OffsetType
typename TImage::InternalPixelType InternalPixelType
typename TImage::PixelContainer PixelContainer
A multi-dimensional image iterator that visits a random set of pixels within an image region....
Templated n-dimensional image class.
A node to be used when computing permutations.
bool operator<(const NodeOfPermutation &b) const
Produce a random permutation of a collection.
RandomPermutation & operator=(const RandomPermutation &it)
void SetPriority(SizeValueType i, SizeValueType priority) const
SizeValueType operator[](SizeValueType i) const
RandomPermutation(SizeValueType sz)
typename Statistics::MersenneTwisterRandomVariateGenerator::Pointer GeneratorPointer
void ReinitializeSeed() const
NodeOfPermutation * m_Permutation
GeneratorPointer m_Generator
void ReinitializeSeed(unsigned int seed) const
static Pointer New()
Method for creation through the object factory.
SmartPointer< Self > Pointer
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType