KWStyle - itkImageLinearIteratorWithIndex.h
 
Matrix View
Description

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

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