KWStyle - itkImageReverseIterator.h
 
Matrix View
Description

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

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