KWStyle - itkImageSliceIteratorWithIndex.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkImageSliceIteratorWithIndex.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 __itkImageSliceIteratorWithIndex_h
18 #define __itkImageSliceIteratorWithIndex_h
19
20 #include "itkImageSliceConstIteratorWithIndex.h"
21 #include "itkImageIteratorWithIndex.h"
22
23 namespace itk
24 {
25
26 /** \class ImageSliceIteratorWithIndex
27  * \brief A multi-dimensional image iterator that extends the
28  * ImageLinearIteratorWithIndex from iteration along lines in an image to
29  * iteration along both lines and planes (slices) within an image.  A slice is
30  * defined as a 2D plane spanned by two vectors pointing along orthogonal
31  * coordinate axes.
32  *
33 LEN  * Most of the functionality is inherited from the ImageSliceConstIteratorWithIndex.
34  * The current class only adds write access to image pixels.  See
35  * ImageSliceConstIteratorWithIndex for details.
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  **/
67 template<typename TImage>
68 LEN class ITK_EXPORT ImageSliceIteratorWithIndex : public ImageSliceConstIteratorWithIndex<TImage>
69 {
70 public:
71   /** Standard class typedefs. */
72   typedef ImageSliceIteratorWithIndex Self;
73 TDA   typedef ImageSliceConstIteratorWithIndex<TImage>  Superclass;
74   
75 IND ***/** Types inherited from the Superclass */
76   typedef typename Superclass::IndexType              IndexType;
77   typedef typename Superclass::IndexValueType         IndexValueType;
78   typedef typename Superclass::SizeType               SizeType;
79   typedef typename Superclass::SizeValueType          SizeValueType;
80   typedef typename Superclass::OffsetType             OffsetType;
81   typedef typename Superclass::OffsetValueType        OffsetValueType;
82   typedef typename Superclass::RegionType             RegionType;
83   typedef typename Superclass::ImageType              ImageType;
84   typedef typename Superclass::PixelContainer         PixelContainer;
85   typedef typename Superclass::PixelContainerPointer  PixelContainerPointer;
86   typedef typename Superclass::InternalPixelType      InternalPixelType;
87   typedef typename Superclass::PixelType              PixelType;
88   typedef typename Superclass::AccessorType           AccessorType;
89
90
91   /** Default constructor. Needed since we provide a cast constructor. */
92   ImageSliceIteratorWithIndex();
93   
94   /** Constructor establishes an iterator to walk a particular image and a
95    * particular region of that image. */
96   ImageSliceIteratorWithIndex(ImageType *ptr, const RegionType& region);
97
98   /** Constructor that can be used to cast from an ImageIterator to an
99 LEN    * ImageSliceIteratorWithIndex. Many routines return an ImageIterator but for a
100    * particular task, you may want an ImageSliceIteratorWithIndex.  Rather than
101    * provide overloaded APIs that return different types of Iterators, itk
102    * returns ImageIterators and uses constructors to cast from an
103    * ImageIterator to a ImageSliceIteratorWithIndex. */
104   ImageSliceIteratorWithIndex( const ImageIteratorWithIndex<TImage> &it);
105   
106   /** Set the pixel value */
107   void Set( const PixelType & value) const  
108 LEN     { this->m_PixelAccessor.Set(*(const_cast<InternalPixelType *>(this->m_Position)),value); }
109
110   /** Return a reference to the pixel 
111    * This method will provide the fastest access to pixel
112    * data, but it will NOT support ImageAdaptors. */
113   PixelType & Value(void) 
114     { return *(const_cast<InternalPixelType *>(this->m_Position)); }
115  
116 protected:
117   /** the construction from a const iterator is declared protected
118 IND ******in order to enforce const correctness. */
119 LEN   ImageSliceIteratorWithIndex( const ImageSliceConstIteratorWithIndex<TImage> &it);
120   Self & operator=(const ImageSliceConstIteratorWithIndex<TImage> & it);
121  
122
123 };
124
125 // end namespace itk
126
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkImageSliceIteratorWithIndex.txx"
129 #endif
130
131 #endif 
132
133 EOF
134 EOF,EML
135 EOF,EML

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