KWStyle - itkImageRandomNonRepeatingIteratorWithIndex.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkImageRandomNonRepeatingIteratorWithIndex.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:39 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16   Contributed by Rupert Brooks
17
18 =========================================================================*/
19 #ifndef __itkImageRandomNonRepeatingIteratorWithIndex_h
20 #define __itkImageRandomNonRepeatingIteratorWithIndex_h
21
22 #include "itkImageRandomNonRepeatingConstIteratorWithIndex.h"
23 #include "itkImageIteratorWithIndex.h"
24
25 namespace itk
26 {
27
28 /** \class ImageRandomNonRepeatingIteratorWithIndex
29  * \brief A multi-dimensional image iterator that visits image pixels within a
30  * region in a random order, without repeating.
31  *
32  *  This class was contributed by Rupert Brooks, McGill Centre for Intelligent
33  *  Machines, Montreal, Canada.  It is heavily based on the
34  *  ImageRandomIterator class. 
35  *
36  *  This iterator is a subclass of 
37  *  itk::ImageRandomNonRepeatingConstIteratorWithIndex that
38  *  adds write-access functionality.  Please see
39  *  itk::ImageRandomNonRepeatingConstIteratorWithIndex for more information.
40  *
41  * \par MORE INFORMATION
42  * For a complete description of the ITK Image Iterators and their API, please
43  * see the Iterators chapter in the ITK Software Guide.  The ITK Software Guide
44  * is available in print and as a free .pdf download from http://www.itk.org.
45  *
46  * \author Rupert Brooks, McGill Centre for Intelligent Machines. Canada
47  *
48  * \ingroup ImageIterators
49  *
50  * \sa ImageConstIterator \sa ConditionalConstIterator
51  * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator
52  * \sa ConstSliceIterator  \sa CorrespondenceDataStructureIterator 
53  * \sa FloodFilledFunctionConditionalConstIterator 
54  * \sa FloodFilledImageFunctionConditionalConstIterator 
55  * \sa FloodFilledImageFunctionConditionalIterator 
56  * \sa FloodFilledSpatialFunctionConditionalConstIterator 
57  * \sa FloodFilledSpatialFunctionConditionalIterator 
58  * \sa ImageConstIterator \sa ImageConstIteratorWithIndex 
59  * \sa ImageIterator \sa ImageIteratorWithIndex
60 LEN  * \sa ImageRandomNonRepeatingConstIteratorWithIndex  \sa ImageRandomNonRepeatingIteratorWithIndex 
61  * \sa ImageRandomConstIteratorWithIndex  \sa ImageRandomIteratorWithIndex 
62  * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex 
63  * \sa ImageRegionExclusionConstIteratorWithIndex 
64  * \sa ImageRegionExclusionIteratorWithIndex 
65  * \sa ImageRegionIterator  \sa ImageRegionIteratorWithIndex 
66  * \sa ImageRegionReverseConstIterator  \sa ImageRegionReverseIterator 
67  * \sa ImageReverseConstIterator  \sa ImageReverseIterator 
68  * \sa ImageSliceConstIteratorWithIndex  \sa ImageSliceIteratorWithIndex 
69  * \sa NeighborhoodIterator \sa PathConstIterator  \sa PathIterator 
70  * \sa ShapedNeighborhoodIterator  \sa SliceIterator 
71  * \sa ImageConstIteratorWithIndex
72  *
73  */
74 template<typename TImage>
75 LEN class ITK_EXPORT ImageRandomNonRepeatingIteratorWithIndex : public ImageRandomNonRepeatingConstIteratorWithIndex<TImage>
76 {
77 public:
78   /** Standard class typedefs. */
79   typedef ImageRandomNonRepeatingIteratorWithIndex Self;
80 TDA   typedef ImageRandomNonRepeatingConstIteratorWithIndex<TImage>  Superclass;
81   
82 IND ***/** Types inherited from the Superclass */
83   typedef typename Superclass::IndexType              IndexType;
84   typedef typename Superclass::IndexValueType         IndexValueType;
85   typedef typename Superclass::SizeType               SizeType;
86   typedef typename Superclass::SizeValueType          SizeValueType;
87   typedef typename Superclass::OffsetType             OffsetType;
88   typedef typename Superclass::OffsetValueType        OffsetValueType;
89   typedef typename Superclass::RegionType             RegionType;
90   typedef typename Superclass::ImageType              ImageType;
91   typedef typename Superclass::PixelContainer         PixelContainer;
92   typedef typename Superclass::PixelContainerPointer  PixelContainerPointer;
93   typedef typename Superclass::InternalPixelType      InternalPixelType;
94   typedef typename Superclass::PixelType              PixelType;
95   typedef typename Superclass::AccessorType           AccessorType;
96
97
98   /** Default constructor. Needed since we provide a cast constructor. */
99   ImageRandomNonRepeatingIteratorWithIndex();
100   
101   /** Constructor establishes an iterator to walk a particular image and a
102    * particular region of that image. */
103 LEN   ImageRandomNonRepeatingIteratorWithIndex(ImageType *ptr, const RegionType& region);
104
105   /** Constructor that can be used to cast from an ImageIterator to an
106 LEN    * ImageRandomNonRepeatingIteratorWithIndex. Many routines return an ImageIterator but for a
107 LEN    * particular task, you may want an ImageRandomNonRepeatingIteratorWithIndex.  Rather than
108    * provide overloaded APIs that return different types of Iterators, itk
109    * returns ImageIterators and uses constructors to cast from an
110    * ImageIterator to a ImageRandomNonRepeatingIteratorWithIndex. */
111 LEN   ImageRandomNonRepeatingIteratorWithIndex( const ImageIteratorWithIndex<TImage> &it);
112   
113   /** Set the pixel value */
114   void Set( const PixelType & value) const  
115 LEN     { this->m_PixelAccessorFunctor.Set(*(const_cast<InternalPixelType *>(this->m_Position)),value); }
116
117   /** Return a reference to the pixel 
118    * This method will provide the fastest access to pixel
119    * data, but it will NOT support ImageAdaptors. */
120   PixelType & Value(void) 
121     { return *(const_cast<InternalPixelType *>(this->m_Position)); }
122  
123 protected:
124   /** the construction from a const iterator is declared protected
125 IND ******in order to enforce const correctness. */
126 LEN   ImageRandomNonRepeatingIteratorWithIndex( const ImageRandomNonRepeatingConstIteratorWithIndex<TImage> &it);
127 LEN   Self & operator=(const ImageRandomNonRepeatingConstIteratorWithIndex<TImage> & it);
128  
129
130 };
131
132 // end namespace itk
133
134 #ifndef ITK_MANUAL_INSTANTIATION
135 #include "itkImageRandomNonRepeatingIteratorWithIndex.txx"
136 #endif
137
138 #endif 
139

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:13PM
© Kitware Inc.