Sophie

Sophie

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

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: itkImageRandomNonRepeatingConstIteratorWithIndex.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>itkImageRandomNonRepeatingConstIteratorWithIndex.h</h1><a href="itkImageRandomNonRepeatingConstIteratorWithIndex_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: itkImageRandomNonRepeatingConstIteratorWithIndex.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-05 19:04:57 $</span>
<a name="l00007"></a>00007 <span class="comment">  Version:   $Revision: 1.9 $</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 __itkImageRandomNonRepeatingConstIteratorWithIndex_h</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkImageRandomNonRepeatingConstIteratorWithIndex_h</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span>
<a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkImageConstIteratorWithIndex_8h.html">itkImageConstIteratorWithIndex.h</a>"</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkImage_8h.html">itkImage.h</a>"</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;algorithm&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="itkMersenneTwisterRandomVariateGenerator_8h.html">itkMersenneTwisterRandomVariateGenerator.h</a>"</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="keyword">namespace </span>itk
<a name="l00028"></a>00028 {
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 
<a name="l00040"></a><a class="code" href="classitk_1_1NodeOfPermutation.html">00040</a> <span class="keyword">class </span><a class="code" href="classitk_1_1NodeOfPermutation.html">NodeOfPermutation</a>
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 <span class="keyword">public</span>:
<a name="l00043"></a><a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">00043</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>   <a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a>;
<a name="l00044"></a><a class="code" href="classitk_1_1NodeOfPermutation.html#e52caa62254f9a2c42cfbc106e2397b5">00044</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>   <a class="code" href="classitk_1_1NodeOfPermutation.html#e52caa62254f9a2c42cfbc106e2397b5">m_Index</a>;
<a name="l00045"></a><a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">00045</a>   <span class="keywordtype">double</span>          <a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">m_Value</a>;
<a name="l00046"></a>00046 
<a name="l00047"></a><a class="code" href="classitk_1_1NodeOfPermutation.html#964ade261d05c0256abdbfd5a5263523">00047</a>   <a class="code" href="classitk_1_1NodeOfPermutation.html#964ade261d05c0256abdbfd5a5263523">NodeOfPermutation</a> ()
<a name="l00048"></a>00048     {
<a name="l00049"></a>00049     <a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a>=0;
<a name="l00050"></a>00050     <a class="code" href="classitk_1_1NodeOfPermutation.html#e52caa62254f9a2c42cfbc106e2397b5">m_Index</a>=0;
<a name="l00051"></a>00051     <a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">m_Value</a>=0.0;
<a name="l00052"></a>00052     }
<a name="l00053"></a>00053 
<a name="l00054"></a><a class="code" href="classitk_1_1NodeOfPermutation.html#fd6183a9b19a50236c3e8d8e06a4ebf5">00054</a>   <span class="keywordtype">bool</span> <a class="code" href="classitk_1_1NodeOfPermutation.html#fd6183a9b19a50236c3e8d8e06a4ebf5">operator&lt;</a>( <span class="keyword">const</span> <a class="code" href="classitk_1_1NodeOfPermutation.html">NodeOfPermutation</a>&amp; b)<span class="keyword"> const</span>
<a name="l00055"></a>00055 <span class="keyword">    </span>{
<a name="l00056"></a>00056     <span class="keywordflow">if</span>(<a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a>==b.<a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a>)
<a name="l00057"></a>00057       {
<a name="l00058"></a>00058       <span class="keywordflow">return</span> <a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">m_Value</a> &lt; b.<a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">m_Value</a>;
<a name="l00059"></a>00059       }
<a name="l00060"></a>00060     <span class="keywordflow">else</span>
<a name="l00061"></a>00061       {
<a name="l00062"></a>00062       <span class="keywordflow">return</span> <a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a> &lt; b.<a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a>;
<a name="l00063"></a>00063       }
<a name="l00064"></a>00064     }
<a name="l00065"></a>00065 };
<a name="l00066"></a>00066 
<a name="l00067"></a>00067 
<a name="l00069"></a><a class="code" href="classitk_1_1RandomPermutation.html">00069</a> <span class="keyword">class </span><a class="code" href="classitk_1_1RandomPermutation.html">RandomPermutation</a>
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 <span class="keyword">public</span>:
<a name="l00072"></a><a class="code" href="classitk_1_1RandomPermutation.html#e99f5b1ae5a68897abf16499dfa3bca0">00072</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">Statistics::MersenneTwisterRandomVariateGenerator::Pointer</a> <a class="code" href="classitk_1_1SmartPointer.html">GeneratorPointer</a>;
<a name="l00073"></a><a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">00073</a>   <a class="code" href="classitk_1_1NodeOfPermutation.html">NodeOfPermutation</a> *   <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>;
<a name="l00074"></a><a class="code" href="classitk_1_1RandomPermutation.html#e124048497153aa6409f8e21644ebd06">00074</a>   <a class="code" href="classitk_1_1SmartPointer.html">GeneratorPointer</a>      <a class="code" href="classitk_1_1RandomPermutation.html#e124048497153aa6409f8e21644ebd06">m_Generator</a>;
<a name="l00075"></a><a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">00075</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>         <a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">m_Size</a>;
<a name="l00076"></a>00076 
<a name="l00077"></a><a class="code" href="classitk_1_1RandomPermutation.html#83986860060430f0c5321fedd56cd8f6">00077</a>   <a class="code" href="classitk_1_1RandomPermutation.html#83986860060430f0c5321fedd56cd8f6">RandomPermutation</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> sz)
<a name="l00078"></a>00078     {
<a name="l00079"></a>00079     <a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">m_Size</a> = sz;
<a name="l00080"></a>00080     <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a> = <span class="keyword">new</span> <a class="code" href="classitk_1_1NodeOfPermutation.html">NodeOfPermutation</a>[<a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">m_Size</a>];
<a name="l00081"></a>00081     <a class="code" href="classitk_1_1RandomPermutation.html#e124048497153aa6409f8e21644ebd06">m_Generator</a> = <a class="code" href="namespaceHardConnectedComponentImageFilter.html#870262f145e0b45206db74df8053b59c">Statistics::MersenneTwisterRandomVariateGenerator::New</a>();
<a name="l00082"></a>00082     this-&gt;<a class="code" href="classitk_1_1RandomPermutation.html#352c1071162edb39648446a15a22dee7">Shuffle</a>();
<a name="l00083"></a>00083     }
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="classitk_1_1RandomPermutation.html#00d5b28e44ec15aeec921b32b901ae37">00085</a>   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1RandomPermutation.html#00d5b28e44ec15aeec921b32b901ae37">Dump</a>()
<a name="l00086"></a>00086     {
<a name="l00087"></a>00087     <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0;i&lt;<a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">m_Size</a>;i++)
<a name="l00088"></a>00088       {
<a name="l00089"></a>00089       std::cout&lt;&lt;<a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">m_Value</a>&lt;&lt;<span class="stringliteral">" "</span>&lt;&lt;<a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a>
<a name="l00090"></a>00090                &lt;&lt;<span class="stringliteral">" "</span>&lt;&lt;<a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#e52caa62254f9a2c42cfbc106e2397b5">m_Index</a>&lt;&lt;<span class="stringliteral">";"</span>;
<a name="l00091"></a>00091       std::cout&lt;&lt;std::endl;
<a name="l00092"></a>00092       }
<a name="l00093"></a>00093     }
<a name="l00094"></a>00094 
<a name="l00095"></a><a class="code" href="classitk_1_1RandomPermutation.html#7bbf658faeb49bda2ea2d290a21d2a88">00095</a>   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1RandomPermutation.html#7bbf658faeb49bda2ea2d290a21d2a88">SetPriority</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> i,<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> priority)
<a name="l00096"></a>00096     {
<a name="l00097"></a>00097     <span class="keywordflow">if</span>(i&gt;<a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">m_Size</a>)
<a name="l00098"></a>00098       {
<a name="l00099"></a>00099       std::cerr&lt;&lt;<span class="stringliteral">"Error - i dont have "</span>&lt;&lt;i&lt;&lt;<span class="stringliteral">" elements"</span>&lt;&lt;std::endl;
<a name="l00100"></a>00100       }
<a name="l00101"></a>00101     <span class="keywordflow">else</span>
<a name="l00102"></a>00102       {
<a name="l00103"></a>00103       <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#afa2495790dc577008dc92dc188f4ec1">m_Priority</a> = priority;
<a name="l00104"></a>00104       }
<a name="l00105"></a>00105     }
<a name="l00106"></a>00106 
<a name="l00107"></a><a class="code" href="classitk_1_1RandomPermutation.html#352c1071162edb39648446a15a22dee7">00107</a>   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1RandomPermutation.html#352c1071162edb39648446a15a22dee7">Shuffle</a>()
<a name="l00108"></a>00108     {
<a name="l00109"></a>00109     <span class="keywordflow">for</span>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i=0; i &lt; <a class="code" href="classitk_1_1RandomPermutation.html#2228a942361528767825ccb22d6b9608">m_Size</a>; i++ )
<a name="l00110"></a>00110       {
<a name="l00111"></a>00111       <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#55b37f259db0be1f0ad8812fb3b9a79d">m_Value</a> = <a class="code" href="classitk_1_1RandomPermutation.html#e124048497153aa6409f8e21644ebd06">m_Generator</a>-&gt;GetVariateWithClosedRange ( 1.0 );
<a name="l00112"></a>00112       <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#e52caa62254f9a2c42cfbc106e2397b5">m_Index</a>=i;
<a name="l00113"></a>00113       }
<a name="l00114"></a>00114     std::sort(<a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>,<a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>+m_Size);
<a name="l00115"></a>00115     }
<a name="l00116"></a>00116 
<a name="l00117"></a><a class="code" href="classitk_1_1RandomPermutation.html#210afa6568c9e0ca91f6a5c753c6016b">00117</a>   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="classitk_1_1RandomPermutation.html#210afa6568c9e0ca91f6a5c753c6016b">operator[]</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> i)
<a name="l00118"></a>00118     {
<a name="l00119"></a>00119     <span class="keywordflow">return</span> <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>[i].<a class="code" href="classitk_1_1NodeOfPermutation.html#e52caa62254f9a2c42cfbc106e2397b5">m_Index</a>;
<a name="l00120"></a>00120     }
<a name="l00121"></a>00121 
<a name="l00122"></a><a class="code" href="classitk_1_1RandomPermutation.html#49e182a845f4704b9e31afe39ce543dd">00122</a>   <a class="code" href="classitk_1_1RandomPermutation.html#49e182a845f4704b9e31afe39ce543dd">~RandomPermutation</a>()
<a name="l00123"></a>00123     {
<a name="l00124"></a>00124     <span class="keyword">delete</span> [] <a class="code" href="classitk_1_1RandomPermutation.html#b53cc4e31ef307c3ea8ce41aeec3966a">m_Permutation</a>;
<a name="l00125"></a>00125     }
<a name="l00126"></a>00126 
<a name="l00128"></a><a class="code" href="classitk_1_1RandomPermutation.html#e6f66f0c6b9c5105a1ace725359bcfea">00128</a>   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1RandomPermutation.html#e6f66f0c6b9c5105a1ace725359bcfea">ReinitializeSeed</a>()
<a name="l00129"></a>00129     {
<a name="l00130"></a>00130     <a class="code" href="classitk_1_1RandomPermutation.html#e124048497153aa6409f8e21644ebd06">m_Generator</a>-&gt;Initialize();
<a name="l00131"></a>00131     }
<a name="l00132"></a>00132 
<a name="l00133"></a><a class="code" href="classitk_1_1RandomPermutation.html#7770160e11a954098482fd08e4281cda">00133</a>   <span class="keywordtype">void</span> <a class="code" href="classitk_1_1RandomPermutation.html#e6f66f0c6b9c5105a1ace725359bcfea">ReinitializeSeed</a>(<span class="keywordtype">int</span> seed)
<a name="l00134"></a>00134     {
<a name="l00135"></a>00135     <a class="code" href="classitk_1_1RandomPermutation.html#e124048497153aa6409f8e21644ebd06">m_Generator</a>-&gt;Initialize ( seed );
<a name="l00136"></a>00136     }
<a name="l00137"></a>00137 };
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 
<a name="l00207"></a>00207 <span class="keyword">template</span>&lt;<span class="keyword">typename</span> TImage&gt;
<a name="l00208"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html">00208</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html" title="A multi-dimensional image iterator that visits a random set of pixels within an image...">ImageRandomNonRepeatingConstIteratorWithIndex</a> : <span class="keyword">public</span> <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html" title="A base class for multi-dimensional iterators templated over image type that are designed...">ImageConstIteratorWithIndex</a>&lt;TImage&gt;
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210 <span class="keyword">public</span>:
<a name="l00212"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#c34dc92d1d79fe572cc160bcc83130f3">00212</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html" title="A multi-dimensional image iterator that visits a random set of pixels within an image...">ImageRandomNonRepeatingConstIteratorWithIndex</a>   <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html" title="A base class for multi-dimensional iterators templated over image type that are designed...">Self</a>;
<a name="l00213"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#c4fcb3df166a8e079d0ca2badfa8e083">00213</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html">ImageConstIteratorWithIndex&lt;TImage&gt;</a>             <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html">Superclass</a>;
<a name="l00214"></a>00214 
<a name="l00219"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#2533729af5a68d30dfe73a7ce3102532">00219</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="l00220"></a>00220 
<a name="l00225"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#0570b51f1d328b955267cb1019eeeafd">00225</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="l00226"></a>00226 
<a name="l00231"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#14f16cad229d078b8ff23abd8c14350f">00231</a>   <span class="keyword">typedef</span> TImage ImageType;
<a name="l00232"></a>00232 
<a name="l00236"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#f0e1dfadba1d80306ef857eff9d6bf6b">00236</a>   <span class="keyword">typedef</span> <span class="keyword">typename</span> TImage::PixelContainer       PixelContainer;
<a name="l00237"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#2c132730b28b873d7df95c7ae3f48618">00237</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="l00238"></a>00238 
<a name="l00240"></a>00240   <a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html" title="A multi-dimensional image iterator that visits a random set of pixels within an image...">ImageRandomNonRepeatingConstIteratorWithIndex</a>();
<a name="l00241"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#aa3f8f0d5248c0926708e04ab46d1005">00241</a>   ~<a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html" title="A multi-dimensional image iterator that visits a random set of pixels within an image...">ImageRandomNonRepeatingConstIteratorWithIndex</a>()
<a name="l00242"></a>00242     { 
<a name="l00243"></a>00243     <span class="keywordflow">if</span>( m_Permutation )
<a name="l00244"></a>00244       {
<a name="l00245"></a>00245       <span class="keyword">delete</span> m_Permutation;
<a name="l00246"></a>00246       }
<a name="l00247"></a>00247     }
<a name="l00249"></a>00249 
<a name="l00252"></a>00252   <a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html" title="A multi-dimensional image iterator that visits a random set of pixels within an image...">ImageRandomNonRepeatingConstIteratorWithIndex</a>(<span class="keyword">const</span> ImageType *ptr, <span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">RegionType</a>&amp; region);
<a name="l00253"></a>00253 
<a name="l00260"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#eac63ddfc3969d88fc7ac28bccbbab3a">00260</a>   <a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html" title="A multi-dimensional image iterator that visits a random set of pixels within an image...">ImageRandomNonRepeatingConstIteratorWithIndex</a>( <span class="keyword">const</span> <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html">ImageConstIteratorWithIndex&lt;TImage&gt;</a> &amp;it)
<a name="l00261"></a>00261     {
<a name="l00262"></a>00262     this-&gt;<a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html" title="A base class for multi-dimensional iterators templated over image type that are designed...">ImageConstIteratorWithIndex&lt;TImage&gt;::operator=</a>(it);
<a name="l00263"></a>00263     m_Permutation = <a class="code" href="itkVoronoiDiagram2D_8h.html#070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a>;
<a name="l00264"></a>00264     }
<a name="l00265"></a>00265 
<a name="l00267"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#354f5abb8c6d2a3ff53411fde958bbb9">00267</a>   <span class="keywordtype">void</span> GoToBegin(<span class="keywordtype">void</span>)
<a name="l00268"></a>00268     {
<a name="l00269"></a>00269     m_NumberOfSamplesDone = 0L;
<a name="l00270"></a>00270     this-&gt;UpdatePosition();
<a name="l00271"></a>00271     }
<a name="l00273"></a>00273 
<a name="l00275"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#e29aa440e1c80e4c4e236d0692e8885f">00275</a>   <span class="keywordtype">void</span> GoToEnd(<span class="keywordtype">void</span>)
<a name="l00276"></a>00276     {
<a name="l00277"></a>00277     m_NumberOfSamplesDone = m_NumberOfSamplesRequested;
<a name="l00278"></a>00278     this-&gt;UpdatePosition();
<a name="l00279"></a>00279     }
<a name="l00281"></a>00281 
<a name="l00283"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#670daaf7336b3aa2add9aaef632c057d">00283</a>   <span class="keywordtype">bool</span> IsAtBegin(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
<a name="l00284"></a>00284 <span class="keyword">    </span>{
<a name="l00285"></a>00285     <span class="keywordflow">return</span> (m_NumberOfSamplesDone == 0L);
<a name="l00286"></a>00286     }
<a name="l00287"></a>00287 
<a name="l00289"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#c2c45df302e7bfe6a409b4641d32cfc9">00289</a>   <span class="keywordtype">bool</span> IsAtEnd(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
<a name="l00290"></a>00290 <span class="keyword">    </span>{
<a name="l00291"></a>00291     <span class="keywordflow">return</span> (m_NumberOfSamplesDone &gt;= m_NumberOfSamplesRequested);
<a name="l00292"></a>00292     }
<a name="l00293"></a>00293 
<a name="l00294"></a>00294 
<a name="l00296"></a>00296   <a class="code" href="itkMacro_8h.html#1905cf6b2e88235996fa7ff73b2fb0eb">itkStaticConstMacro</a>( ImageDimension, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, ::<a class="code" href="structitk_1_1GetImageDimension.html">itk::GetImageDimension&lt; TImage &gt;::ImageDimension</a> );
<a name="l00297"></a>00297 
<a name="l00298"></a>00298 
<a name="l00300"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#c5fe867541ad54382bf9199594895ef3">00300</a>   <span class="keyword">typedef</span> <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">itk::Image&lt; unsigned long, itkGetStaticConstMacro(ImageDimension ) &gt;</a>  <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">PriorityImageType</a>;
<a name="l00301"></a>00301 
<a name="l00307"></a>00307   <span class="keywordtype">void</span> SetPriorityImage(<span class="keyword">const</span> <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">PriorityImageType</a> * priorityImage);
<a name="l00308"></a>00308 
<a name="l00311"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#21670ffe9e41816c95ae7f3c5ae4b36e">00311</a>   <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html" title="A base class for multi-dimensional iterators templated over image type that are designed...">Self</a> &amp; operator++()
<a name="l00312"></a>00312     {
<a name="l00313"></a>00313     m_NumberOfSamplesDone++;
<a name="l00314"></a>00314     this-&gt;UpdatePosition();
<a name="l00315"></a>00315     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00316"></a>00316     }
<a name="l00318"></a>00318 
<a name="l00321"></a><a class="code" href="classitk_1_1ImageRandomNonRepeatingConstIteratorWithIndex.html#00f94fcc1d4db77912c3f5c392f72ab6">00321</a>   <a class="code" href="classitk_1_1ImageConstIteratorWithIndex.html" title="A base class for multi-dimensional iterators templated over image type that are designed...">Self</a> &amp; operator--()
<a name="l00322"></a>00322     {
<a name="l00323"></a>00323     m_NumberOfSamplesDone--;
<a name="l00324"></a>00324     this-&gt;UpdatePosition();
<a name="l00325"></a>00325     <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00326"></a>00326     }
<a name="l00328"></a>00328 
<a name="l00330"></a>00330   <span class="keywordtype">void</span> SetNumberOfSamples( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> number );
<a name="l00331"></a>00331   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> GetNumberOfSamples( <span class="keywordtype">void</span> ) <span class="keyword">const</span>;
<a name="l00333"></a>00333 
<a name="l00335"></a>00335   <span class="keywordtype">void</span> ReinitializeSeed();
<a name="l00336"></a>00336 
<a name="l00339"></a>00339   <span class="keywordtype">void</span> ReinitializeSeed(<span class="keywordtype">int</span>);
<a name="l00340"></a>00340 
<a name="l00341"></a>00341 <span class="keyword">private</span>:
<a name="l00342"></a>00342   <span class="keywordtype">void</span> UpdatePosition();
<a name="l00343"></a>00343 
<a name="l00344"></a>00344   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>           m_NumberOfSamplesRequested;
<a name="l00345"></a>00345   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>           m_NumberOfSamplesDone;
<a name="l00346"></a>00346   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>           m_NumberOfPixelsInRegion;
<a name="l00347"></a>00347   <a class="code" href="classitk_1_1RandomPermutation.html">RandomPermutation</a> *     m_Permutation;
<a name="l00348"></a>00348 };
<a name="l00349"></a>00349 
<a name="l00350"></a>00350 } <span class="comment">// end namespace itk</span>
<a name="l00351"></a>00351 
<a name="l00352"></a>00352 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION</span>
<a name="l00353"></a>00353 <span class="preprocessor"></span><span class="preprocessor">#include "itkImageRandomNonRepeatingConstIteratorWithIndex.txx"</span>
<a name="l00354"></a>00354 <span class="preprocessor">#endif</span>
<a name="l00355"></a>00355 <span class="preprocessor"></span>
<a name="l00356"></a>00356 <span class="preprocessor">#endif</span>
<a name="l00357"></a>00357 <span class="preprocessor"></span>
</pre></div></div>
<hr><address><small>
Generated at Thu May 7 23:06:12 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>