<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ITK: itkNeighborhoodIterator.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a> </div> <div class="contents"> <h1>itkNeighborhoodIterator.h</h1><a href="itkNeighborhoodIterator_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*=========================================================================</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> Program: Insight Segmentation & Registration Toolkit</span> <a name="l00004"></a>00004 <span class="comment"> Module: $RCSfile: itkNeighborhoodIterator.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2009-02-06 20:53:13 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.50 $</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> Copyright (c) Insight Software Consortium. All rights reserved.</span> <a name="l00010"></a>00010 <span class="comment"> See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.</span> <a name="l00011"></a>00011 <span class="comment"></span> <a name="l00012"></a>00012 <span class="comment"> This software is distributed WITHOUT ANY WARRANTY; without even </span> <a name="l00013"></a>00013 <span class="comment"> the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR </span> <a name="l00014"></a>00014 <span class="comment"> PURPOSE. See the above copyright notices for more information.</span> <a name="l00015"></a>00015 <span class="comment"></span> <a name="l00016"></a>00016 <span class="comment">=========================================================================*/</span> <a name="l00017"></a>00017 <span class="preprocessor">#ifndef __itkNeighborhoodIterator_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkNeighborhoodIterator_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <vector></span> <a name="l00021"></a>00021 <span class="preprocessor">#include <string.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <iostream></span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="itkConstNeighborhoodIterator_8h.html">itkConstNeighborhoodIterator.h</a>"</span> <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keyword">namespace </span>itk { <a name="l00026"></a>00026 <a name="l00097"></a>00097 <a name="l00210"></a>00210 <span class="keyword">template</span><<span class="keyword">class </span>TImage, <span class="keyword">class </span>TBoundaryCondition <a name="l00211"></a>00211 = ZeroFluxNeumannBoundaryCondition<TImage> > <a name="l00212"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html">00212</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1NeighborhoodIterator.html" title="Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image...">NeighborhoodIterator</a> <a name="l00213"></a>00213 : <span class="keyword">public</span> <a class="code" href="classitk_1_1ConstNeighborhoodIterator.html" title="Const version of NeighborhoodIterator, defining iteration of a local N-dimensional...">ConstNeighborhoodIterator</a><TImage,TBoundaryCondition> <a name="l00214"></a>00214 { <a name="l00215"></a>00215 <span class="keyword">public</span>: <a name="l00217"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#752fb821e96698e4d31f89009721c7ee">00217</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1NeighborhoodIterator.html" title="Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image...">NeighborhoodIterator</a> <a class="code" href="classitk_1_1ConstNeighborhoodIterator.html" title="Const version of NeighborhoodIterator, defining iteration of a local N-dimensional...">Self</a>; <a name="l00218"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#0006554b837c2d564d3181b81f067a7f">00218</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ConstNeighborhoodIterator.html">ConstNeighborhoodIterator<TImage,TBoundaryCondition></a> <a class="code" href="classitk_1_1Neighborhood.html" title="A light-weight container object for storing an N-dimensional neighborhood of values...">Superclass</a>; <a name="l00219"></a>00219 <a name="l00221"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#1b1e5ee904159f32b59cc6e90b73f65d">00221</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::InternalPixelType InternalPixelType; <a name="l00222"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#9ded4cc7d6615245cfdf61ca08047b2b">00222</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::PixelType PixelType; <a name="l00223"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#e5ba0437892f2e98ac79b7156c4affb3">00223</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">Superclass::SizeType</a> <a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">SizeType</a>; <a name="l00224"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#739c92fa655f7dea0ac29d9be365f4ed">00224</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::ImageType ImageType; <a name="l00225"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#e8443e2e36508424eb92d10e0b560208">00225</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">Superclass::RegionType</a> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a>; <a name="l00226"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#43e6da9a04f4aca917afd0de748673f0">00226</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">Superclass::IndexType</a> <a class="code" href="classitk_1_1Index.html">IndexType</a>; <a name="l00227"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#c989cb7514fe7601ba0f1873eeb017ea">00227</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1Offset.html">Superclass::OffsetType</a> <a class="code" href="classitk_1_1Offset.html">OffsetType</a>; <a name="l00228"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#0c1171100e701bf381c766fa8662bb91">00228</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> OffsetType::OffsetValueType OffsetValueType; <a name="l00229"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#07513aa6c53daf258ecefb2434a78bc1">00229</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">Superclass::RadiusType</a> <a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">RadiusType</a>; <a name="l00230"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#8c61c4a0cf805ab3577f5744ae0dfbf1">00230</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::NeighborhoodType <a class="code" href="classitk_1_1Neighborhood.html" title="A light-weight container object for storing an N-dimensional neighborhood of values...">NeighborhoodType</a>; <a name="l00231"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#0972d9abf241ce4546cac592fbbfdf4d">00231</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::Iterator Iterator; <a name="l00232"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#ef643708990e9918c60eac089d479407">00232</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::ConstIterator ConstIterator; <a name="l00233"></a>00233 <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::ImageBoundaryConditionPointerType <a name="l00234"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#82be03219ccae9b94630d73ed46cc548">00234</a> <a class="code" href="classitk_1_1ImageBoundaryCondition.html">ImageBoundaryConditionPointerType</a>; <a name="l00235"></a>00235 <a name="l00237"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#b5f686cde14de356b5b978319339fed5">00237</a> <a class="code" href="classitk_1_1NeighborhoodIterator.html#b5f686cde14de356b5b978319339fed5">NeighborhoodIterator</a>(): <a class="code" href="classitk_1_1Neighborhood.html" title="A light-weight container object for storing an N-dimensional neighborhood of values...">Superclass</a>() {} <a name="l00238"></a>00238 <a name="l00240"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#34bb5bc031343fe47e8d02d9a17fbb05">00240</a> <a class="code" href="classitk_1_1NeighborhoodIterator.html#34bb5bc031343fe47e8d02d9a17fbb05">NeighborhoodIterator</a>( <span class="keyword">const</span> <a class="code" href="classitk_1_1NeighborhoodIterator.html" title="Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image...">NeighborhoodIterator</a> &n ) : <a class="code" href="classitk_1_1Neighborhood.html" title="A light-weight container object for storing an N-dimensional neighborhood of values...">Superclass</a>(n) {} <a name="l00241"></a>00241 <a name="l00243"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#dea3a3ec4e61c28e77c5c879d9ee00d3">00243</a> <a class="code" href="classitk_1_1ConstNeighborhoodIterator.html" title="Const version of NeighborhoodIterator, defining iteration of a local N-dimensional...">Self</a> &operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1ConstNeighborhoodIterator.html" title="Const version of NeighborhoodIterator, defining iteration of a local N-dimensional...">Self</a>& orig) <a name="l00244"></a>00244 { <a name="l00245"></a>00245 Superclass::operator=(orig); <a name="l00246"></a>00246 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00247"></a>00247 } <a name="l00249"></a>00249 <a name="l00252"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#baebd17b71f174016920c6616ad2beac">00252</a> <a class="code" href="classitk_1_1NeighborhoodIterator.html" title="Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image...">NeighborhoodIterator</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">SizeType</a> &radius, ImageType * ptr, <a name="l00253"></a>00253 <span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a> &region) <a name="l00254"></a>00254 : <a class="code" href="classitk_1_1Neighborhood.html" title="A light-weight container object for storing an N-dimensional neighborhood of values...">Superclass</a>(radius, ptr, region) { } <a name="l00255"></a>00255 <a name="l00257"></a>00257 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#920ae03048a5ad715d803ca2e92b52de">PrintSelf</a>(std::ostream &, <a class="code" href="classitk_1_1Indent.html" title="Control indentation during Print() invocation.">Indent</a>) <span class="keyword">const</span>; <a name="l00258"></a>00258 <a name="l00260"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#06800a9c958e647200c6ff444b535d65">00260</a> InternalPixelType *GetCenterPointer() <a name="l00261"></a>00261 { <span class="keywordflow">return</span> (this-><span class="keyword">operator</span>[]((this-><a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">Size</a>())>>1)); } <a name="l00262"></a>00262 <a name="l00264"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#98756ed6ac792bf4c38f7fdfe87cf837">00264</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetCenterPixel(<span class="keyword">const</span> PixelType &p) <a name="l00265"></a>00265 { this->m_NeighborhoodAccessorFunctor.Set(this-><span class="keyword">operator</span>[]((this-><a class="code" href="classitk_1_1Size.html" title="Represent the size (bounds) of a n-dimensional image.">Size</a>())>>1), p); } <a name="l00266"></a>00266 <a name="l00270"></a>00270 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetNeighborhood(<span class="keyword">const</span> NeighborhoodType &); <a name="l00271"></a>00271 <a name="l00274"></a>00274 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPixel(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> i, <span class="keyword">const</span> PixelType &v, <a name="l00275"></a>00275 <span class="keywordtype">bool</span> &status); <a name="l00276"></a>00276 <a name="l00278"></a>00278 <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPixel(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> i, <span class="keyword">const</span> PixelType &v); <a name="l00279"></a>00279 <span class="comment">// { *(this->operator[](i)) = v; }</span> <a name="l00281"></a>00281 <span class="comment"></span> <a name="l00283"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#ca5d615f82915cdf27793237d3139b74">00283</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPixel(<span class="keyword">const</span> <a class="code" href="classitk_1_1Offset.html">OffsetType</a> o, <span class="keyword">const</span> PixelType &v) <a name="l00284"></a>00284 { this-><a class="code" href="classitk_1_1NeighborhoodIterator.html#ca5d615f82915cdf27793237d3139b74">SetPixel</a>(this->GetNeighborhoodIndex(o), v); } <a name="l00285"></a>00285 <span class="comment">// { *(this->operator[](o)) = v; }</span> <a name="l00287"></a>00287 <span class="comment"></span> <a name="l00291"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#9f463d92dcffb97859c87bcd1f2e9b11">00291</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetNext(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> axis, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> i, <a name="l00292"></a>00292 <span class="keyword">const</span> PixelType &v) <a name="l00293"></a>00293 { this->SetPixel(this->GetCenterNeighborhoodIndex() <a name="l00294"></a>00294 + (i * this->GetStride(axis)), v); } <a name="l00295"></a>00295 <a name="l00296"></a>00296 <a name="l00300"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#5c49e404546be5da07e9872ac33a0ee4">00300</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetNext(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> axis, <span class="keyword">const</span> PixelType &v) <a name="l00301"></a>00301 { this->SetPixel(this->GetCenterNeighborhoodIndex() <a name="l00302"></a>00302 + this->GetStride(axis), v); } <a name="l00303"></a>00303 <a name="l00307"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#4baa7e8744777c7b427d7aed4916f53c">00307</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPrevious(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> axis, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> i, <a name="l00308"></a>00308 <span class="keyword">const</span> PixelType &v) <a name="l00309"></a>00309 { this->SetPixel(this->GetCenterNeighborhoodIndex() <a name="l00310"></a>00310 - (i * this->GetStride(axis)), v); } <a name="l00311"></a>00311 <a name="l00312"></a>00312 <a name="l00316"></a><a class="code" href="classitk_1_1NeighborhoodIterator.html#261e3afe530a2365a41892eaa774dca6">00316</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetPrevious(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> axis, <a name="l00317"></a>00317 <span class="keyword">const</span> PixelType &v) <a name="l00318"></a>00318 { this->SetPixel(this->GetCenterNeighborhoodIndex() <a name="l00319"></a>00319 - this->GetStride(axis), v); } <a name="l00320"></a>00320 <a name="l00321"></a>00321 }; <a name="l00322"></a>00322 <a name="l00323"></a>00323 } <span class="comment">// namespace itk</span> <a name="l00324"></a>00324 <a name="l00325"></a>00325 <a name="l00326"></a>00326 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION</span> <a name="l00327"></a>00327 <span class="preprocessor"></span><span class="preprocessor">#include "itkNeighborhoodIterator.txx"</span> <a name="l00328"></a>00328 <span class="preprocessor">#endif</span> <a name="l00329"></a>00329 <span class="preprocessor"></span> <a name="l00330"></a>00330 <span class="preprocessor">#endif</span> <a name="l00331"></a>00331 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 23:41:02 2009 for ITK by <a href="http://www.stack.nl/~dimitri/doxygen/index.html"> <img src="http://www.stack.nl/~dimitri/doxygen/doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53> </a> 1.5.9 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2000</small></address> </body> </html>