Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > d5e74628f0e673bb8680aebce32b2c04 > files > 16137

itk-doc-3.12.0-1mdv2010.0.i586.rpm

<!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: itkImageReverseConstIterator.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>&nbsp;&nbsp; 
<a href="modules.html" class="qindex">Groups</a>&nbsp;&nbsp;
<a href="namespaces.html" class="qindex">Namespace List</a>&nbsp;&nbsp;
<a href="hierarchy.html" class="qindex">Class Hierarchy</a>&nbsp;&nbsp;
<a href="classes.html" class="qindex">Alphabetical List</a>&nbsp;&nbsp;
<a href="annotated.html" class="qindex">Compound List</a>&nbsp;&nbsp; 
<a href="files.html" class="qindex">File
List</a>&nbsp;&nbsp; 
<a href="namespacemembers.html" class="qindex">Namespace Members</a>&nbsp;&nbsp; 
<a href="functions.html" class="qindex">Compound Members</a>&nbsp;&nbsp; 
<a href="globals.html" class="qindex">File Members</a>&nbsp;&nbsp;
<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>&nbsp;&raquo&nbsp;<a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a>
  </div>
<div class="contents">
<h1>itkImageReverseConstIterator.h</h1><a href="itkImageReverseConstIterator_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 &amp; Registration Toolkit</span>
<a name="l00004"></a>00004 <span class="comment">  Module:    $RCSfile: itkImageReverseConstIterator.h,v $</span>
<a name="l00005"></a>00005 <span class="comment">  Language:  C++</span>
<a name="l00006"></a>00006 <span class="comment">  Date:      $Date: 2008-10-18 21:13:25 $</span>
<a name="l00007"></a>00007 <span class="comment">  Version:   $Revision: 1.10 $</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 __itkImageReverseConstIterator_h</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkImageReverseConstIterator_h</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkIndex_8h.html">itkIndex.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkSize_8h.html">itkSize.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="itkImage_8h.html">itkImage.h</a>"</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="itkImageConstIterator_8h.html">itkImageConstIterator.h</a>"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;memory&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="keyword">namespace </span>itk
<a name="l00027"></a>00027 {
<a name="l00028"></a>00028 
<a name="l00086"></a>00086 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> TImage&gt;
<a name="l00087"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html">00087</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">ImageReverseConstIterator</a>
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089 <span class="keyword">public</span>:
<a name="l00091"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#5c46cf524289aa8968a3f41ff5ba2a8d">00091</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">ImageReverseConstIterator</a> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a>;
<a name="l00092"></a>00092 
<a name="l00097"></a>00097   <a class="code" href="itkMacro_8h.html#1905cf6b2e88235996fa7ff73b2fb0eb">itkStaticConstMacro</a>(ImageIteratorDimension, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>,
<a name="l00098"></a>00098                       TImage::ImageDimension);
<a name="l00099"></a>00099 
<a name="l00101"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#d183d5f936c312fca658977d269e0f77">00101</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">TImage::IndexType</a>        <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a>;
<a name="l00102"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#0bc6e678711d32b7535a08d58ec8b99a">00102</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::IndexValueType   IndexValueType;
<a name="l00103"></a>00103 
<a name="l00105"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#655ea3f39bceb65d73b3115edeb836fd">00105</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">TImage::SizeType</a>         <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">SizeType</a>;
<a name="l00106"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#66bb605d7356bd4b8ef90f454b62f697">00106</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::SizeValueType    SizeValueType;
<a name="l00107"></a>00107 
<a name="l00109"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#f0bafe65581796c7304e1c2f02589d27">00109</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::OffsetType       OffsetType;
<a name="l00110"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#5da944e5ff1eb4684a3573f1b0c4f762">00110</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::OffsetValueType  OffsetValueType;
<a name="l00111"></a>00111 
<a name="l00113"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#52bf4d5e19d664874ad1836d8af9c46a">00113</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">TImage::RegionType</a>       <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a>;
<a name="l00114"></a>00114 
<a name="l00116"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#0374842de1a3250a47848707e10a42c6">00116</a>   <span class="keyword">typedef</span> TImage   ImageType;
<a name="l00117"></a>00117 
<a name="l00121"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#31c996dc19f2e09c2bc26695880beba3">00121</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::PixelContainer   PixelContainer;
<a name="l00122"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#08db8c2b35d27aa59e022aaabcfecc8e">00122</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">PixelContainer::Pointer</a>  PixelContainerPointer;
<a name="l00123"></a>00123 
<a name="l00125"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#356176df8138e95d378a1fcefcfd05e3">00125</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::InternalPixelType   InternalPixelType;
<a name="l00126"></a>00126 
<a name="l00128"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#a6c3207bd2cc620c6ed92df9cfa5c305">00128</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::PixelType   PixelType;
<a name="l00129"></a>00129 
<a name="l00132"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#fc85d40765c3a1eb000e7de07067f251">00132</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::AccessorType     AccessorType;
<a name="l00133"></a>00133 
<a name="l00135"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#617e9b8cc823ef2961d230e915d20fce">00135</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::AccessorFunctorType     AccessorFunctorType;
<a name="l00136"></a>00136 
<a name="l00139"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#27e507dcad6c0f5fda3ead64fd837372">00139</a>   <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">ImageReverseConstIterator</a>() :m_PixelAccessor(), m_PixelAccessorFunctor()
<a name="l00140"></a>00140     {
<a name="l00141"></a>00141     m_Buffer = 0;
<a name="l00142"></a>00142     m_Offset = 0;
<a name="l00143"></a>00143     m_BeginOffset = 0;
<a name="l00144"></a>00144     m_EndOffset = 0;
<a name="l00145"></a>00145     m_PixelAccessorFunctor.SetBegin( m_Buffer );
<a name="l00146"></a>00146     }
<a name="l00148"></a>00148 
<a name="l00150"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#6fd1596084ac9092d33ef525fa5a90d0">00150</a>   <span class="keyword">virtual</span> <a class="code" href="classitk_1_1ImageReverseConstIterator.html#6fd1596084ac9092d33ef525fa5a90d0">~ImageReverseConstIterator</a>() {};
<a name="l00151"></a>00151 
<a name="l00154"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#1a7ade1372791413fb91763b38176cd5">00154</a>   <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">ImageReverseConstIterator</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a>&amp; it)
<a name="l00155"></a>00155     {
<a name="l00156"></a>00156     m_Image = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#602970ec57bc0b6e278376677c9f60f5">m_Image</a>;     <span class="comment">// copy the smart pointer</span>
<a name="l00157"></a>00157 
<a name="l00158"></a>00158     m_Region = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#c05af0b2a7aa82ae1d1090c55920566b">m_Region</a>;
<a name="l00159"></a>00159     
<a name="l00160"></a>00160     m_Buffer = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#b1012ff5ad8dee3d24cf442e66ae884f">m_Buffer</a>;
<a name="l00161"></a>00161     m_Offset = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#d376b44a5f1677d0aa69d675a7ea1c8c">m_Offset</a>;
<a name="l00162"></a>00162     m_BeginOffset = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#45d47e4fa8303a77054e5adf689b08d1">m_BeginOffset</a>;
<a name="l00163"></a>00163     m_EndOffset = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#2853734f9cd68e55be9d77b17e229e49">m_EndOffset</a>;
<a name="l00164"></a>00164     m_PixelAccessor = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#ce5451fc8c69dd31a75c0ed39092ed38">m_PixelAccessor</a>;
<a name="l00165"></a>00165     m_PixelAccessorFunctor = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#3f88077f77eecfd4c43d6826ec8f980d">m_PixelAccessorFunctor</a>;
<a name="l00166"></a>00166     m_PixelAccessorFunctor.SetBegin( m_Buffer );
<a name="l00167"></a>00167     }
<a name="l00168"></a>00168 
<a name="l00171"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#c1a916b92edd7b868b35f7beb76e3cc1">00171</a>   <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">ImageReverseConstIterator</a>(ImageType *ptr, <span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a> &amp;region)
<a name="l00172"></a>00172     {
<a name="l00173"></a>00173     <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> offset;
<a name="l00174"></a>00174     m_Image = ptr;
<a name="l00175"></a>00175     m_Buffer = m_Image-&gt;GetBufferPointer();
<a name="l00176"></a>00176     m_Region = region;
<a name="l00178"></a>00178 
<a name="l00179"></a>00179     <span class="comment">// Compute the end offset, one pixel before the first pixel</span>
<a name="l00180"></a>00180     offset = m_Image-&gt;ComputeOffset( m_Region.GetIndex() );
<a name="l00181"></a>00181     m_EndOffset = offset-1;
<a name="l00182"></a>00182     
<a name="l00183"></a>00183     <span class="comment">// Compute the begin offset, the last pixel in the region</span>
<a name="l00184"></a>00184     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> ind(m_Region.GetIndex());
<a name="l00185"></a>00185     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">SizeType</a> size(m_Region.GetSize());
<a name="l00186"></a>00186     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i &lt; TImage::ImageDimension; ++i)
<a name="l00187"></a>00187       {
<a name="l00188"></a>00188       ind[i] += (size[i] - 1);
<a name="l00189"></a>00189       }
<a name="l00190"></a>00190     m_BeginOffset = m_Image-&gt;ComputeOffset( ind );
<a name="l00191"></a>00191     m_Offset = m_BeginOffset;
<a name="l00192"></a>00192 
<a name="l00193"></a>00193     m_PixelAccessor = ptr-&gt;GetPixelAccessor();
<a name="l00194"></a>00194     m_PixelAccessorFunctor.SetPixelAccessor( m_PixelAccessor );
<a name="l00195"></a>00195     m_PixelAccessorFunctor.SetBegin( m_Buffer );
<a name="l00196"></a>00196     }
<a name="l00197"></a>00197   
<a name="l00205"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#32b9835e9482a390c760d6cba2db10ea">00205</a>   <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">ImageReverseConstIterator</a>( <span class="keyword">const</span> <a class="code" href="classitk_1_1ImageConstIterator.html">ImageConstIterator&lt;TImage&gt;</a> &amp;it)
<a name="l00206"></a>00206     {
<a name="l00207"></a>00207     m_Image = it.<a class="code" href="classitk_1_1ImageConstIterator.html#0ec131f175838e5c8a9823b1fd5154bd">GetImage</a>();
<a name="l00208"></a>00208     m_Region = it.<a class="code" href="classitk_1_1ImageConstIterator.html#6ae986d23af76672a0fb962a9de54746">GetRegion</a>();
<a name="l00209"></a>00209     m_Buffer = m_Image-&gt;GetBufferPointer();
<a name="l00211"></a>00211 
<a name="l00212"></a>00212     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> ind = it.<a class="code" href="classitk_1_1ImageConstIterator.html#ae11801c25a113360119ef69ec62b1d0">GetIndex</a>();
<a name="l00213"></a>00213 
<a name="l00214"></a>00214     m_Offset = m_Image-&gt;ComputeOffset( ind );
<a name="l00215"></a>00215 
<a name="l00216"></a>00216     <span class="comment">// Compute the end offset, one pixel before the first pixel</span>
<a name="l00217"></a>00217     m_EndOffset = m_Image-&gt;ComputeOffset( m_Region.GetIndex() ) - 1;
<a name="l00218"></a>00218     
<a name="l00219"></a>00219     <span class="comment">// Compute the begin offset, the last pixel in the region</span>
<a name="l00220"></a>00220     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> regInd(m_Region.GetIndex());
<a name="l00221"></a>00221     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">SizeType</a> regSize(m_Region.GetSize());
<a name="l00222"></a>00222     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i &lt; TImage::ImageDimension; ++i)
<a name="l00223"></a>00223       {
<a name="l00224"></a>00224       regInd[i] += (regSize[i] - 1);
<a name="l00225"></a>00225       }
<a name="l00226"></a>00226     m_BeginOffset = m_Image-&gt;ComputeOffset( regInd );
<a name="l00227"></a>00227     
<a name="l00228"></a>00228     m_PixelAccessor = m_Image-&gt;GetPixelAccessor();
<a name="l00229"></a>00229     m_PixelAccessorFunctor.SetPixelAccessor( m_PixelAccessor );
<a name="l00230"></a>00230     m_PixelAccessorFunctor.SetBegin( m_Buffer );
<a name="l00231"></a>00231     }
<a name="l00232"></a>00232 
<a name="l00235"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#93fc1c9759ab5749ad7363e056ac30b5">00235</a>   <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a> &amp;operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a>&amp; it)
<a name="l00236"></a>00236     {
<a name="l00237"></a>00237     m_Image = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#602970ec57bc0b6e278376677c9f60f5">m_Image</a>;     <span class="comment">// copy the smart pointer</span>
<a name="l00238"></a>00238     m_Region = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#c05af0b2a7aa82ae1d1090c55920566b">m_Region</a>;
<a name="l00239"></a>00239 
<a name="l00240"></a>00240     m_Buffer = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#b1012ff5ad8dee3d24cf442e66ae884f">m_Buffer</a>;
<a name="l00241"></a>00241     m_Offset = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#d376b44a5f1677d0aa69d675a7ea1c8c">m_Offset</a>;
<a name="l00242"></a>00242     m_BeginOffset = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#45d47e4fa8303a77054e5adf689b08d1">m_BeginOffset</a>;
<a name="l00243"></a>00243     m_EndOffset = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#2853734f9cd68e55be9d77b17e229e49">m_EndOffset</a>;
<a name="l00244"></a>00244     m_PixelAccessor = it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#ce5451fc8c69dd31a75c0ed39092ed38">m_PixelAccessor</a>;
<a name="l00245"></a>00245     m_PixelAccessorFunctor.SetPixelAccessor( m_PixelAccessor );
<a name="l00246"></a>00246     m_PixelAccessorFunctor.SetBegin( m_Buffer );
<a name="l00247"></a>00247     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00248"></a>00248     }
<a name="l00249"></a>00249   
<a name="l00252"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#fa0ab758f23f7764c8f74b8fb4aad8f7">00252</a>   <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a> &amp;operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1ImageConstIterator.html">ImageConstIterator&lt;TImage&gt;</a>&amp; it)
<a name="l00253"></a>00253     {
<a name="l00254"></a>00254     m_Image = it.<a class="code" href="classitk_1_1ImageConstIterator.html#0ec131f175838e5c8a9823b1fd5154bd">GetImage</a>();
<a name="l00255"></a>00255     m_Region = it.<a class="code" href="classitk_1_1ImageConstIterator.html#6ae986d23af76672a0fb962a9de54746">GetRegion</a>();
<a name="l00256"></a>00256     m_Buffer = m_Image-&gt;GetBufferPointer();
<a name="l00258"></a>00258 
<a name="l00259"></a>00259     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> ind = it.<a class="code" href="classitk_1_1ImageConstIterator.html#ae11801c25a113360119ef69ec62b1d0">GetIndex</a>();
<a name="l00260"></a>00260 
<a name="l00261"></a>00261     m_Offset = m_Image-&gt;ComputeOffset( ind );
<a name="l00262"></a>00262 
<a name="l00263"></a>00263     <span class="comment">// Compute the end offset, one pixel before the first pixel</span>
<a name="l00264"></a>00264     m_EndOffset = m_Image-&gt;ComputeOffset( m_Region.GetIndex() ) - 1;
<a name="l00265"></a>00265     
<a name="l00266"></a>00266     <span class="comment">// Compute the begin offset, the last pixel in the region</span>
<a name="l00267"></a>00267     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> regInd(m_Region.GetIndex());
<a name="l00268"></a>00268     <a class="code" href="namespaceHardConnectedComponentImageFilter.html#5bf82236e1e50e653de84c8ead448599">SizeType</a> regSize(m_Region.GetSize());
<a name="l00269"></a>00269     <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i &lt; TImage::ImageDimension; ++i)
<a name="l00270"></a>00270       {
<a name="l00271"></a>00271       regInd[i] += (regSize[i] - 1);
<a name="l00272"></a>00272       }
<a name="l00273"></a>00273     m_BeginOffset = m_Image-&gt;ComputeOffset( regInd );
<a name="l00274"></a>00274     
<a name="l00275"></a>00275     m_PixelAccessor = m_Image-&gt;GetPixelAccessor();
<a name="l00276"></a>00276     m_PixelAccessorFunctor.SetPixelAccessor( m_PixelAccessor );
<a name="l00277"></a>00277     m_PixelAccessorFunctor.SetBegin( m_Buffer );
<a name="l00278"></a>00278     
<a name="l00279"></a>00279     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00280"></a>00280     }
<a name="l00281"></a>00281   
<a name="l00283"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#2d3a45764b5649375f4e56ade2531650">00283</a>   <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetImageIteratorDimension() 
<a name="l00284"></a>00284     {<span class="keywordflow">return</span> TImage::ImageDimension;}
<a name="l00285"></a>00285 
<a name="l00288"></a>00288   <span class="keywordtype">bool</span>
<a name="l00289"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#fee9f6baf60c9c1f698be4a0c9a4050a">00289</a>   <a class="code" href="namespaceitk_1_1ImageToImageFilterDetail.html#7bf30438b5d3bdc0eddbecd9b17baa3b">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a> &amp;it)<span class="keyword"> const</span>
<a name="l00290"></a>00290 <span class="keyword">    </span>{
<a name="l00291"></a>00291     <span class="comment">// two iterators are the same if they "point to" the same memory location</span>
<a name="l00292"></a>00292     <span class="keywordflow">return</span> (m_Buffer + m_Offset) != (it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#b1012ff5ad8dee3d24cf442e66ae884f">m_Buffer</a> + it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#d376b44a5f1677d0aa69d675a7ea1c8c">m_Offset</a>);
<a name="l00293"></a>00293     }
<a name="l00294"></a>00294 
<a name="l00297"></a>00297   <span class="keywordtype">bool</span>
<a name="l00298"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#2be4496c70a4532f03e73d8ee65e7dd4">00298</a>   <a class="code" href="namespaceitk.html#e1c1b02c301187419478f5126c789a01">operator==</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1ImageReverseConstIterator.html" title="Multi-dimensional image iterator.">Self</a> &amp;it)<span class="keyword"> const</span>
<a name="l00299"></a>00299 <span class="keyword">    </span>{
<a name="l00300"></a>00300     <span class="comment">// two iterators are the same if they "point to" the same memory location</span>
<a name="l00301"></a>00301     <span class="keywordflow">return</span> (m_Buffer + m_Offset) == (it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#b1012ff5ad8dee3d24cf442e66ae884f">m_Buffer</a> + it.<a class="code" href="classitk_1_1ImageReverseConstIterator.html#d376b44a5f1677d0aa69d675a7ea1c8c">m_Offset</a>);
<a name="l00302"></a>00302     }
<a name="l00303"></a>00303 
<a name="l00308"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#ac7b45ca0108c1efd6b25e5d5d98281b">00308</a>   <span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> GetIndex()
<a name="l00309"></a>00309     { <span class="keywordflow">return</span> m_Image-&gt;ComputeIndex( m_Offset );  }
<a name="l00310"></a>00310 
<a name="l00313"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#0223a749013fd4ecd3f41a248189d97a">00313</a>   <span class="keyword">virtual</span> <span class="keywordtype">void</span> SetIndex(<span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">IndexType</a> &amp;ind)
<a name="l00314"></a>00314     { m_Offset = m_Image-&gt;ComputeOffset( ind ); }
<a name="l00315"></a>00315 
<a name="l00316"></a>00316 
<a name="l00319"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#3be3518ae3f22d89bf8bdfd39559b3ef">00319</a>   <span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a>&amp; GetRegion()<span class="keyword"> const</span>
<a name="l00320"></a>00320 <span class="keyword">    </span>{ <span class="keywordflow">return</span> m_Region; }
<a name="l00321"></a>00321 
<a name="l00323"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#35024986c2dfcd1ad1b65c5ba22056ba">00323</a>   <span class="keyword">const</span> PixelType Get(<span class="keywordtype">void</span>)<span class="keyword"> const  </span>
<a name="l00324"></a>00324 <span class="keyword">    </span>{ <span class="keywordflow">return</span> m_PixelAccessorFunctor.Get(*(m_Buffer+m_Offset)); }
<a name="l00325"></a>00325 
<a name="l00327"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#71c6c281ab89faf2805809796607d259">00327</a>   <span class="keywordtype">void</span> Set( <span class="keyword">const</span> PixelType &amp; value)<span class="keyword"> const  </span>
<a name="l00328"></a>00328 <span class="keyword">    </span>{ 
<a name="l00329"></a>00329     this-&gt;m_PixelAccessorFunctor.Set(*(const_cast&lt;InternalPixelType *&gt;(
<a name="l00330"></a>00330             this-&gt;m_Buffer+this-&gt;m_Offset)),value);
<a name="l00331"></a>00331     }
<a name="l00332"></a>00332 
<a name="l00336"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#0d4879b9d9724e2999116666ac51d8f9">00336</a>   <span class="keyword">const</span> PixelType &amp; Value(<span class="keywordtype">void</span>)<span class="keyword"> const  </span>
<a name="l00337"></a>00337 <span class="keyword">    </span>{ <span class="keywordflow">return</span> *(m_Buffer+m_Offset); }
<a name="l00338"></a>00338 
<a name="l00342"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#7fcc37eb46a99f4c5e3838109fb3d017">00342</a>   <span class="keyword">const</span> PixelType &amp; Value(<span class="keywordtype">void</span>) 
<a name="l00343"></a>00343     { <span class="keywordflow">return</span> *(m_Buffer+m_Offset); }
<a name="l00344"></a>00344 
<a name="l00348"></a>00348   <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ac7d0120fe5292cdcdddb6163b8cb150">Self</a> Begin() <span class="keyword">const</span>;
<a name="l00349"></a>00349 
<a name="l00352"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#c3f4abc41fabe83f5d99c920119db661">00352</a>   <span class="keywordtype">void</span> GoToBegin()
<a name="l00353"></a>00353     {
<a name="l00354"></a>00354     m_Offset = m_BeginOffset;
<a name="l00355"></a>00355     }
<a name="l00356"></a>00356 
<a name="l00360"></a>00360   <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ac7d0120fe5292cdcdddb6163b8cb150">Self</a> End() <span class="keyword">const</span>;
<a name="l00361"></a>00361 
<a name="l00364"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#bcd3f019a74bc1169a6820cc6403952d">00364</a>   <span class="keywordtype">void</span> GoToEnd()
<a name="l00365"></a>00365     {
<a name="l00366"></a>00366     m_Offset = m_EndOffset;
<a name="l00367"></a>00367     }
<a name="l00368"></a>00368 
<a name="l00371"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#47982bd1d4307e042ffc4e1c5736fcea">00371</a>   <span class="keywordtype">bool</span> IsAtBegin()
<a name="l00372"></a>00372     {
<a name="l00373"></a>00373     <span class="keywordflow">return</span> (m_Offset == m_BeginOffset);
<a name="l00374"></a>00374     }
<a name="l00375"></a>00375 
<a name="l00378"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#b25066ffb32acc39792c8569b1506ead">00378</a>   <span class="keywordtype">bool</span> IsAtEnd()
<a name="l00379"></a>00379     {
<a name="l00380"></a>00380     <span class="keywordflow">return</span> (m_Offset == m_EndOffset);
<a name="l00381"></a>00381     }
<a name="l00382"></a>00382 
<a name="l00383"></a>00383 <span class="keyword">protected</span>: <span class="comment">//made protected so other iterators can access </span>
<a name="l00384"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#602970ec57bc0b6e278376677c9f60f5">00384</a>   <span class="keyword">typename</span> ImageType::ConstWeakPointer    m_Image;
<a name="l00385"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#c05af0b2a7aa82ae1d1090c55920566b">00385</a>   <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a>                              m_Region; <span class="comment">// region to iterate over</span>
<a name="l00386"></a>00386   
<a name="l00387"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#d376b44a5f1677d0aa69d675a7ea1c8c">00387</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  m_Offset;
<a name="l00388"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#45d47e4fa8303a77054e5adf689b08d1">00388</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  m_BeginOffset; <span class="comment">// offset to last pixel in region</span>
<a name="l00389"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#2853734f9cd68e55be9d77b17e229e49">00389</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>  m_EndOffset;   <span class="comment">// offset to one pixel before first pixel</span>
<a name="l00390"></a>00390 
<a name="l00391"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#b1012ff5ad8dee3d24cf442e66ae884f">00391</a>   <span class="keyword">const</span> InternalPixelType        *m_Buffer;
<a name="l00392"></a>00392 
<a name="l00393"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#ce5451fc8c69dd31a75c0ed39092ed38">00393</a>   AccessorType                    m_PixelAccessor;
<a name="l00394"></a><a class="code" href="classitk_1_1ImageReverseConstIterator.html#3f88077f77eecfd4c43d6826ec8f980d">00394</a>   AccessorFunctorType             m_PixelAccessorFunctor;
<a name="l00395"></a>00395 };
<a name="l00396"></a>00396 
<a name="l00397"></a>00397 } <span class="comment">// end namespace itk</span>
<a name="l00398"></a>00398 
<a name="l00399"></a>00399 <span class="comment">// Define instantiation macro for this template.</span>
<a name="l00400"></a><a class="code" href="itkImageReverseConstIterator_8h.html#f4e7b12243d248519cf1f7cd16e2e019">00400</a> <span class="preprocessor">#define ITK_TEMPLATE_ImageReverseConstIterator(_, EXPORT, x, y) namespace itk { \</span>
<a name="l00401"></a>00401 <span class="preprocessor">  _(1(class EXPORT ImageReverseConstIterator&lt; ITK_TEMPLATE_1 x &gt;)) \</span>
<a name="l00402"></a>00402 <span class="preprocessor">  namespace Templates { typedef ImageReverseConstIterator&lt; ITK_TEMPLATE_1 x &gt; ImageReverseConstIterator##y; } \</span>
<a name="l00403"></a>00403 <span class="preprocessor">  }</span>
<a name="l00404"></a>00404 <span class="preprocessor"></span>
<a name="l00405"></a>00405 <span class="preprocessor">#if ITK_TEMPLATE_EXPLICIT</span>
<a name="l00406"></a>00406 <span class="preprocessor"></span><span class="preprocessor"># include "Templates/itkImageReverseConstIterator+-.h"</span>
<a name="l00407"></a>00407 <span class="preprocessor">#endif</span>
<a name="l00408"></a>00408 <span class="preprocessor"></span>
<a name="l00409"></a>00409 <span class="preprocessor">#if ITK_TEMPLATE_TXX</span>
<a name="l00410"></a>00410 <span class="preprocessor"></span><span class="preprocessor"># include "itkImageReverseConstIterator.txx"</span>
<a name="l00411"></a>00411 <span class="preprocessor">#endif</span>
<a name="l00412"></a>00412 <span class="preprocessor"></span>
<a name="l00413"></a>00413 <span class="preprocessor">#endif </span>
<a name="l00414"></a>00414 <span class="preprocessor"></span>
</pre></div></div>
<hr><address><small>
Generated at Thu May 7 23:11:11 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>,
 &copy;&nbsp;1997-2000</small></address>
</body>
</html>