18 #ifndef itkImageRandomNonRepeatingConstIteratorWithIndex_h
19 #define itkImageRandomNonRepeatingConstIteratorWithIndex_h
96 #if !defined(ITK_LEGACY_REMOVE)
103 std::cout << std::endl;
112 std::ostringstream ostrm;
113 ostrm <<
"Error: RandomPermuation does not have " << i <<
" elements" << std::endl;
114 throw std::runtime_error(ostrm.str());
226 template<
typename TImage >
253 delete m_Permutation;
271 m_Permutation = ITK_NULLPTR;
275 Self & operator=(
const Self & it);
280 m_NumberOfSamplesDone = 0L;
281 this->UpdatePosition();
288 m_NumberOfSamplesDone = m_NumberOfSamplesRequested;
289 this->UpdatePosition();
296 return ( m_NumberOfSamplesDone == 0L );
302 return ( m_NumberOfSamplesDone >= m_NumberOfSamplesRequested );
306 itkStaticConstMacro(ImageDimension,
unsigned int, TImage::ImageDimension);
322 m_NumberOfSamplesDone++;
323 this->UpdatePosition();
332 m_NumberOfSamplesDone--;
333 this->UpdatePosition();
344 void ReinitializeSeed();
348 void ReinitializeSeed(
int);
351 void UpdatePosition();
360 #ifndef ITK_MANUAL_INSTANTIATION
361 #include "itkImageRandomNonRepeatingConstIteratorWithIndex.hxx"
void SetPriority(SizeValueType i, SizeValueType priority)
itk::Image< SizeValueType, itkGetStaticConstMacro(ImageDimension) > PriorityImageType
~ImageRandomNonRepeatingConstIteratorWithIndex()
TImage::InternalPixelType InternalPixelType
Superclass::PixelContainerPointer PixelContainerPointer
TImage::SizeType SizeType
Superclass::PixelContainer PixelContainer
ImageConstIteratorWithIndex< TImage > Superclass
TImage::AccessorType AccessorType
NodeOfPermutation * m_Permutation
A multi-dimensional image iterator that visits a random set of pixels within an image region...
Statistics::MersenneTwisterRandomVariateGenerator::Pointer GeneratorPointer
Superclass::IndexValueType IndexValueType
ImageRandomNonRepeatingConstIteratorWithIndex(const ImageConstIteratorWithIndex< TImage > &it)
Superclass::OffsetValueType OffsetValueType
Superclass::IndexType IndexType
RandomPermutation(SizeValueType sz)
RandomPermutation * m_Permutation
A node to be used when computing permutations.
OffsetType::OffsetValueType OffsetValueType
Superclass::OffsetType OffsetType
TImage::PixelContainer PixelContainer
unsigned long SizeValueType
static Pointer New()
Method for creation through the object factory.
Superclass::InternalPixelType InternalPixelType
bool operator<(const NodeOfPermutation &b) const
bool IsAtBegin(void) const
TImage::OffsetType OffsetType
A base class for multi-dimensional iterators templated over image type that are designed to efficient...
TImage::IndexType IndexType
ImageRandomNonRepeatingConstIteratorWithIndex Self
TImage::RegionType RegionType
TImage::PixelType PixelType
IndexType::IndexValueType IndexValueType
Superclass::SizeValueType SizeValueType
Superclass::RegionType RegionType
PixelContainer::Pointer PixelContainerPointer
SizeValueType operator[](SizeValueType i)
Superclass::PixelType PixelType
Produce a random permutation of a collection.
Superclass::ImageType ImageType
RandomPermutation & operator=(const RandomPermutation &it)
SizeValueType m_NumberOfSamplesRequested
Superclass::SizeType SizeType
GeneratorPointer m_Generator
void ReinitializeSeed(unsigned int seed)
Self & operator=(const Self &it)
Superclass::AccessorType AccessorType
SizeValueType m_NumberOfPixelsInRegion
SizeValueType m_NumberOfSamplesDone
Templated n-dimensional image class.
SizeType::SizeValueType SizeValueType