KWStyle - itkImageRegionReverseIterator.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkImageRegionReverseIterator.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 =========================================================================*/
17 #ifndef __itkImageRegionReverseIterator_h
18 #define __itkImageRegionReverseIterator_h
19
20 #include "itkImageRegionReverseConstIterator.h"
21 #include "itkImageConstIterator.h"
22
23 namespace itk
24 {
25
26 /** \class ImageRegionReverseIterator
27  * \brief Multi-dimensional image iterator which only walks a region.
28  * 
29 LEN  * ImageRegionReverseIterator is a templated class to represent a multi-dimensional
30  * iterator. ImageRegionReverseIterator is templated over the image type
31  * ImageRegionReverseIterator is constrained to walk only within the 
32  * specified region and along a line parallel to one of the coordinate axis.
33  *
34 LEN  * Most of the functionality is inherited from the ImageRegionReverseConstIterator.
35  * The current class only adds write access to image pixels.
36  *
37  * \par MORE INFORMATION
38  * For a complete description of the ITK Image Iterators and their API, please
39  * see the Iterators chapter in the ITK Software Guide.  The ITK Software Guide
40  * is available in print and as a free .pdf download from http://www.itk.org.
41  *
42  * \ingroup ImageIterators
43  *
44  * \sa ImageConstIterator \sa ConditionalConstIterator
45  * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator
46  * \sa ConstSliceIterator  \sa CorrespondenceDataStructureIterator 
47  * \sa FloodFilledFunctionConditionalConstIterator 
48  * \sa FloodFilledImageFunctionConditionalConstIterator 
49  * \sa FloodFilledImageFunctionConditionalIterator 
50  * \sa FloodFilledSpatialFunctionConditionalConstIterator 
51  * \sa FloodFilledSpatialFunctionConditionalIterator 
52  * \sa ImageConstIterator \sa ImageConstIteratorWithIndex 
53  * \sa ImageIterator \sa ImageIteratorWithIndex
54  * \sa ImageLinearConstIteratorWithIndex  \sa ImageLinearIteratorWithIndex 
55  * \sa ImageRandomConstIteratorWithIndex  \sa ImageRandomIteratorWithIndex 
56  * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex 
57  * \sa ImageRegionExclusionConstIteratorWithIndex 
58  * \sa ImageRegionExclusionIteratorWithIndex 
59  * \sa ImageRegionIterator  \sa ImageRegionIteratorWithIndex 
60  * \sa ImageRegionReverseConstIterator  \sa ImageRegionReverseIterator 
61  * \sa ImageReverseConstIterator  \sa ImageReverseIterator 
62  * \sa ImageSliceConstIteratorWithIndex  \sa ImageSliceIteratorWithIndex 
63  * \sa NeighborhoodIterator \sa PathConstIterator  \sa PathIterator 
64  * \sa ShapedNeighborhoodIterator  \sa SliceIterator 
65  * \sa ImageConstIteratorWithIndex */
66 template<typename TImage>
67 LEN class ITK_EXPORT ImageRegionReverseIterator : public ImageRegionReverseConstIterator<TImage>
68 {
69 public:
70   /** Standard class typedefs. */
71   typedef ImageRegionReverseIterator Self;
72 TDA   typedef ImageRegionReverseConstIterator<TImage>  Superclass;
73   
74 IND ***/** Types inherited from the Superclass */
75   typedef typename Superclass::IndexType              IndexType;
76   typedef typename Superclass::IndexValueType         IndexValueType;
77   typedef typename Superclass::SizeType               SizeType;
78   typedef typename Superclass::SizeValueType          SizeValueType;
79   typedef typename Superclass::OffsetType             OffsetType;
80   typedef typename Superclass::OffsetValueType        OffsetValueType;
81   typedef typename Superclass::RegionType             RegionType;
82   typedef typename Superclass::ImageType              ImageType;
83   typedef typename Superclass::PixelContainer         PixelContainer;
84   typedef typename Superclass::PixelContainerPointer  PixelContainerPointer;
85   typedef typename Superclass::InternalPixelType      InternalPixelType;
86   typedef typename Superclass::PixelType              PixelType;
87   typedef typename Superclass::AccessorType           AccessorType;
88
89
90   /** Default constructor. Needed since we provide a cast constructor. */
91   ImageRegionReverseIterator();
92   
93   /** Constructor establishes an iterator to walk a particular image and a
94    * particular region of that image. */
95   ImageRegionReverseIterator(ImageType *ptr, const RegionType& region);
96
97   /** Constructor that can be used to cast from an ImageConstIterator to an
98 LEN    * ImageRegionReverseIterator. Many routines return an ImageConstIterator but for a
99    * particular task, you may want an ImageRegionReverseIterator.  Rather than
100    * provide overloaded APIs that return different types of Iterators, itk
101    * returns ImageConstIterators and uses constructors to cast from an
102    * ImageConstIterator to a ImageRegionReverseIterator. */
103   ImageRegionReverseIterator( const ImageConstIterator<TImage> &it);
104   
105   /** Set the pixel value */
106   void Set( const PixelType & value) const  
107 LEN     { this->m_PixelAccessor.Set(*const_cast<InternalPixelType  *>((this->m_Buffer+this->m_Offset)),value); }
108
109   /** Return a reference to the pixel 
110    * This method will provide the fastest access to pixel
111    * data, but it will NOT support ImageAdaptors. */
112   PixelType & Value(void) 
113 LEN     { return *const_cast<InternalPixelType  *>((this->m_Buffer+this->m_Offset)); }
114   
115   /** Return an iterator for the beginning of the region. "Begin"
116    * is defined as the first pixel in the region.
117    * \deprecated Use GoToBegin() instead */
118   Self Begin(void) const;
119
120 IND ***/** Return an iterator for the end of the region. "End" is defined
121    * as one pixel past the last pixel of the region. 
122    * \deprecated Use GoToEnd() instead */
123   Self End(void) const;
124
125
126 protected:
127   /** the construction from a const iterator is declared protected
128 IND ******in order to enforce const correctness. */
129 LEN   ImageRegionReverseIterator( const ImageRegionReverseConstIterator<TImage> &it);
130   Self & operator=(const ImageRegionReverseConstIterator<TImage> & it);
131  
132
133 };
134
135 // end namespace itk
136
137 #ifndef ITK_MANUAL_INSTANTIATION
138 #include "itkImageRegionReverseIterator.txx"
139 #endif
140
141 #endif 
142
143 EOF
144 EOF,EML
145 EOF,EML

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