KWStyle - itkFloodFilledImageFunctionConditionalIterator.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkFloodFilledImageFunctionConditionalIterator.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:35 $
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 __itkFloodFilledImageFunctionConditionalIterator_h
18 #define __itkFloodFilledImageFunctionConditionalIterator_h
19
20 #include "itkFloodFilledImageFunctionConditionalConstIterator.h"
21
22 namespace itk
23 {
24
25 /**
26  * \class FloodFilledImageFunctionConditionalIterator
27  * \brief Iterates over a flood-filled image function. 
28  *
29  * \ingroup ImageIterators
30  *
31  */
32 template<class TImage, class TFunction>
33 LEN class ITK_EXPORT FloodFilledImageFunctionConditionalIterator: public FloodFilledImageFunctionConditionalConstIterator<TImage, TFunction>
34 {
35 public:
36   /** Standard class typedefs. */
37   typedef FloodFilledImageFunctionConditionalIterator Self;
38 LEN,TDA   typedef FloodFilledImageFunctionConditionalConstIterator<TImage, TFunction> Superclass;
39
40   /** Type of function */
41   typedef typename Superclass::FunctionType FunctionType;
42
43   /** Type of vector used to store location info in the spatial function */
44   typedef typename Superclass::FunctionInputType FunctionInputType;
45
46   /** Index typedef support. */
47   typedef typename Superclass::IndexType  IndexType;
48
49   /** Size typedef support. */
50   typedef typename Superclass::SizeType    SizeType;
51
52   /** Region typedef support */
53   typedef typename Superclass::RegionType    RegionType;
54
55   /** Image typedef support. */
56   typedef typename Superclass::ImageType   ImageType;
57
58   /** Internal Pixel Type */
59   typedef typename Superclass::InternalPixelType   InternalPixelType;
60
61   /** External Pixel Type */
62   typedef typename Superclass::PixelType   PixelType;
63
64   /** Dimension of the image the iterator walks.  This constant is needed so
65    * functions that are templated over image iterator type (as opposed to
66    * being templated over pixel type and dimension) can have compile time
67    * access to the dimension of the image that the iterator walks. */
68   itkStaticConstMacro(NDimensions, unsigned int, Superclass::NDimensions);
69
70   /** Constructor establishes an iterator to walk a particular image and a
71    * particular region of that image. This version of the constructor uses
72    * an explicit seed pixel for the flood fill, the "startIndex" */
73   FloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
74                                      FunctionType *fnPtr,
75 LEN                                      IndexType startIndex): Superclass(imagePtr, fnPtr, startIndex) {};
76
77   /** Constructor establishes an iterator to walk a particular image and a
78    * particular region of that image. This version of the constructor uses
79    * an explicit list of seed pixels for the flood fill, the "startIndex" */
80   FloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
81                                      FunctionType *fnPtr,
82 LEN                                      std::vector<IndexType>& startIndex): Superclass(imagePtr, fnPtr, startIndex) {};
83
84   /** Constructor establishes an iterator to walk a particular image and a
85    * particular region of that image. This version of the constructor
86    * should be used when the seed pixel is unknown. */
87   FloodFilledImageFunctionConditionalIterator(ImageType *imagePtr,
88 LEN                                      FunctionType *fnPtr): Superclass(imagePtr, fnPtr) {};
89
90   /** Get the pixel value */
91   const PixelType & Get(void) const
92 LEN     { return const_cast<ImageType *>(this->m_Image.GetPointer())->GetPixel(this->m_IndexStack.front() ); }
93
94   /** Set the pixel value */
95   void Set( const PixelType & value)
96 LEN     { const_cast<ImageType *>(this->m_Image.GetPointer())->GetPixel(this->m_IndexStack.front() ) = value; }
97
98   /** Default Destructor. */
99   virtual ~FloodFilledImageFunctionConditionalIterator() {};
100 };
101
102 // end namespace itk
103
104 #endif 
105

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