|
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());
213 template <
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;
345 return m_NumberOfSamplesRequested;
355 ReinitializeSeed(
int);
369 #ifndef ITK_MANUAL_INSTANTIATION
370 # 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)