18 #ifndef itkImageRandomNonRepeatingConstIteratorWithIndex_h 19 #define itkImageRandomNonRepeatingConstIteratorWithIndex_h 89 delete[] m_Permutation;
96 #if !defined(ITK_LEGACY_REMOVE) 102 <<
" " << m_Permutation[i].
m_Index <<
";";
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());
126 m_Permutation[i].
m_Value = m_Generator->GetVariateWithClosedRange (1.0);
129 std::sort(m_Permutation, m_Permutation + m_Size);
134 return m_Permutation[i].
m_Index;
139 delete[] m_Permutation;
145 m_Generator->Initialize();
150 m_Generator->SetSeed (seed);
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);
316 void SetPriorityImage(
const PriorityImageType *priorityImage);
322 m_NumberOfSamplesDone++;
323 this->UpdatePosition();
332 m_NumberOfSamplesDone--;
333 this->UpdatePosition();
339 void SetNumberOfSamples(SizeValueType number);
341 SizeValueType GetNumberOfSamples()
const;
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
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
Superclass::OffsetType OffsetType
TImage::PixelContainer PixelContainer
unsigned long SizeValueType
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
static Pointer GetInstance()
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