<!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: itkWatershedSegmenter.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_16b0d2d22c345042f35cebae66b36010.html">Algorithms</a> </div> <div class="contents"> <h1>itkWatershedSegmenter.h</h1><a href="itkWatershedSegmenter_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: itkWatershedSegmenter.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-01-27 19:30:19 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.18 $</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 __itkWatershedSegmenter_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkWatershedSegmenter_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#if defined(_MSC_VER)</span> <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#pragma warning ( disable : 4786 )</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="itk__hash__map_8h.html">itk_hash_map.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="itkWatershedBoundary_8h.html">itkWatershedBoundary.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="itkWatershedSegmentTable_8h.html">itkWatershedSegmentTable.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="itkEquivalencyTable_8h.html">itkEquivalencyTable.h</a>"</span> <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="itkImage_8h.html">itkImage.h</a>"</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="keyword">namespace </span>itk <a name="l00031"></a>00031 { <a name="l00032"></a>00032 <span class="keyword">namespace </span>watershed <a name="l00033"></a>00033 { <a name="l00089"></a>00089 <span class="keyword">template</span> <<span class="keyword">class</span> TInputImage> <a name="l00090"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html">00090</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1watershed_1_1Segmenter.html">Segmenter</a> <a name="l00091"></a>00091 : <span class="keyword">public</span> <a class="code" href="classitk_1_1ProcessObject.html" title="ProcessObject is the base class for all process objects (source, filters, mappers)...">ProcessObject</a> <a name="l00092"></a>00092 { <a name="l00093"></a>00093 <span class="keyword">public</span>: <a name="l00095"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#afa3517bc960a7e81bde7980dec81bbf">00095</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1watershed_1_1Segmenter.html">Segmenter</a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>; <a name="l00096"></a>00096 <a name="l00098"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#54b45b3a6fc971be2762bffe18f385de">00098</a> <span class="keyword">typedef</span> TInputImage <a class="code" href="namespaceHardConnectedComponentImageFilter.html#3742cbac150bee74daa9aab85ed80623">InputImageType</a>; <a name="l00099"></a>00099 <a class="code" href="itkMacro_8h.html#1905cf6b2e88235996fa7ff73b2fb0eb">itkStaticConstMacro</a>(ImageDimension, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <a name="l00100"></a>00100 TInputImage::ImageDimension); <a name="l00101"></a>00101 <a name="l00102"></a>00102 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">Image<unsigned long, itkGetStaticConstMacro(ImageDimension)></a> <a name="l00103"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#05545e4a19f2bb6d23d115724d6cadf2">00103</a> <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">OutputImageType</a>; <a name="l00104"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#985439398a037f48fd1c7362f306b2f9">00104</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">InputImageType::RegionType</a> ImageRegionType; <a name="l00105"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#9571e6d2636d9116126df84796bbf2fa">00105</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> InputImageType::PixelType <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a>; <a name="l00106"></a>00106 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1watershed_1_1Boundary.html">Boundary<InputPixelType, itkGetStaticConstMacro(ImageDimension)></a> <a name="l00107"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#7794463e1f8e0e5493d55a1dfe4836f0">00107</a> <a class="code" href="classitk_1_1watershed_1_1Boundary.html">BoundaryType</a>; <a name="l00108"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#9a2dc12c9800e1fa5a07a35350ef2587">00108</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#be32dc19e71d40322ad9828b9ab40853">BoundaryType::IndexType</a> BoundaryIndexType; <a name="l00109"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#8b2ee3c2dac60aa006a600ac6b8e7745">00109</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> BoundaryType::FlatHashValueType BoundaryFlatHashValueType; <a name="l00110"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#761b8c4a8ead31763f0b5d2ae1ebed7a">00110</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1watershed_1_1SegmentTable.html">SegmentTable<InputPixelType></a> <a class="code" href="classitk_1_1watershed_1_1SegmentTable.html">SegmentTableType</a>; <a name="l00111"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#7cfd8ca1409aa87c7454e4231acd346d">00111</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">DataObject::Pointer</a> <a class="code" href="classitk_1_1SmartPointer.html">DataObjectPointer</a>; <a name="l00112"></a>00112 <a name="l00115"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#fc6492826795f7352b6998cc9e3f3138">00115</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ProcessObject.html" title="ProcessObject is the base class for all process objects (source, filters, mappers)...">ProcessObject</a> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Superclass</a>; <a name="l00116"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#68d7a3a1c3f6458379174027d0a434fe">00116</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<Self></a> <a class="code" href="classitk_1_1SmartPointer.html">Pointer</a>; <a name="l00117"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#045f5ec571c356fae2f8f6cde131e857">00117</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1SmartPointer.html">SmartPointer<const Self></a> <a class="code" href="classitk_1_1SmartPointer.html">ConstPointer</a>; <a name="l00118"></a>00118 <a class="code" href="itkMacro_8h.html#0fdc15685afa271857c57e7cd482f30c">itkNewMacro</a>(<a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>); <a name="l00119"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#d2341fa4cace869f8d818f38d529e9b4">00119</a> <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>(<a class="code" href="classWatershedSegmenter.html">WatershedSegmenter</a>, <a class="code" href="classitk_1_1ProcessObject.html" title="ProcessObject is the base class for all process objects (source, filters, mappers)...">ProcessObject</a>); <a name="l00121"></a>00121 <a name="l00123"></a>00123 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">InputImageType::Pointer</a> InputImageTypePointer; <a name="l00124"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#4b0fb2a44fcc02fe7fc2d4d3f2c9f56c">00124</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1SmartPointer.html">OutputImageType::Pointer</a> <a class="code" href="classitk_1_1SmartPointer.html">OutputImageTypePointer</a>; <a name="l00125"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#b12ce5268b75b5da88310441d35635ad">00125</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1SmartPointer.html">SegmentTableType::Pointer</a> <a class="code" href="classitk_1_1SmartPointer.html">SegmentTableTypePointer</a>; <a name="l00126"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#d1b6987ecb3b5056c1433bddb2f458ef">00126</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="classitk_1_1SmartPointer.html">BoundaryType::Pointer</a> <a class="code" href="classitk_1_1SmartPointer.html">BoundaryTypePointer</a>; <a name="l00127"></a>00127 <a name="l00129"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#97640cd625022630fed32c96261d2bf9">00129</a> <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> NULL_LABEL; <a name="l00130"></a>00130 <a name="l00132"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#5d741ce344313d29650f512c15fb2edc">00132</a> <span class="keyword">static</span> <span class="keywordtype">short</span> NULL_FLOW; <a name="l00133"></a>00133 <a name="l00135"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#304c5bd5eb22cc40486440c81f32ca03">00135</a> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#3742cbac150bee74daa9aab85ed80623">InputImageType</a> * GetInputImage(<span class="keywordtype">void</span>) <a name="l00136"></a>00136 { <a name="l00137"></a>00137 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="namespaceHardConnectedComponentImageFilter.html#3742cbac150bee74daa9aab85ed80623">InputImageType</a> *<span class="keyword">></span> <a name="l00138"></a>00138 (this-><a class="code" href="classitk_1_1ProcessObject.html#1cb9c8ea89b6357d9d851f4179f933dd">ProcessObject::GetInput</a>(0)); <a name="l00139"></a>00139 } <a name="l00140"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#40c1a62e5f00ac0b2017f3655aab160e">00140</a> <span class="keywordtype">void</span> SetInputImage(<a class="code" href="namespaceHardConnectedComponentImageFilter.html#3742cbac150bee74daa9aab85ed80623">InputImageType</a> *img) <a name="l00141"></a>00141 { this-><a class="code" href="classitk_1_1ProcessObject.html#148829de75f8eae1161af95151710808">ProcessObject::SetNthInput</a>(0, img); } <a name="l00143"></a>00143 <a name="l00146"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#70133339a6c02bef3bca174fc71400d3">00146</a> <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">OutputImageType</a> * GetOutputImage(<span class="keywordtype">void</span>) <a name="l00147"></a>00147 { <a name="l00148"></a>00148 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">OutputImageType</a> *<span class="keyword">></span> <a name="l00149"></a>00149 (this-><a class="code" href="classitk_1_1ProcessObject.html#f24a0bf37dae4c4ea24a03caf200588d">ProcessObject::GetOutput</a>(0)); <a name="l00150"></a>00150 } <a name="l00151"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#f7202fca1a77acd8ebfa1a432e390dc5">00151</a> <span class="keywordtype">void</span> SetOutputImage(<a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">OutputImageType</a> *img) <a name="l00152"></a>00152 { this-><a class="code" href="classitk_1_1ProcessObject.html#2e8baf7173919c763c0ce5a5acc9146c">ProcessObject::SetNthOutput</a>(0, img); } <a name="l00154"></a>00154 <a name="l00157"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#c20faf436f863af96d58ad7a6e5b8d90">00157</a> <a class="code" href="classitk_1_1watershed_1_1SegmentTable.html">SegmentTableType</a> * GetSegmentTable(<span class="keywordtype">void</span>) <a name="l00158"></a>00158 { <a name="l00159"></a>00159 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classitk_1_1watershed_1_1SegmentTable.html">SegmentTableType</a> *<span class="keyword">></span> <a name="l00160"></a>00160 (this-><a class="code" href="classitk_1_1ProcessObject.html#f24a0bf37dae4c4ea24a03caf200588d">ProcessObject::GetOutput</a>(1)); <a name="l00161"></a>00161 } <a name="l00162"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#db356ae9bbc31b37fab5d6cf59e4a1f4">00162</a> <span class="keywordtype">void</span> SetSegmentTable(<a class="code" href="classitk_1_1watershed_1_1SegmentTable.html">SegmentTableType</a> *s) <a name="l00163"></a>00163 { this-><a class="code" href="classitk_1_1ProcessObject.html#2e8baf7173919c763c0ce5a5acc9146c">ProcessObject::SetNthOutput</a>(1, s); } <a name="l00165"></a>00165 <a name="l00168"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#d86c826a1f57c566b476268246826404">00168</a> <a class="code" href="classitk_1_1watershed_1_1Boundary.html">BoundaryType</a> * GetBoundary(<span class="keywordtype">void</span>) <a name="l00169"></a>00169 { <a name="l00170"></a>00170 <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="classitk_1_1watershed_1_1Boundary.html">BoundaryType</a> *<span class="keyword">></span> <a name="l00171"></a>00171 (this-><a class="code" href="classitk_1_1ProcessObject.html#f24a0bf37dae4c4ea24a03caf200588d">ProcessObject::GetOutput</a>(2)); <a name="l00172"></a>00172 } <a name="l00173"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#333d60078617ae61487b6140691c9698">00173</a> <span class="keywordtype">void</span> SetBoundary(<a class="code" href="classitk_1_1watershed_1_1Boundary.html">BoundaryType</a> *b) <a name="l00174"></a>00174 { this-><a class="code" href="classitk_1_1ProcessObject.html#2e8baf7173919c763c0ce5a5acc9146c">ProcessObject::SetNthOutput</a>(2,b); } <a name="l00176"></a>00176 <a name="l00178"></a>00178 <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#f75a5945cdd8315676941024a0b8c1e9">GenerateData</a>(); <a name="l00179"></a>00179 <a name="l00186"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#426039645763bf306ecb6d67dffd66e8">00186</a> <span class="keywordtype">void</span> SetLargestPossibleRegion(ImageRegionType reg) <a name="l00187"></a>00187 { <a name="l00188"></a>00188 <span class="keywordflow">if</span> (reg == m_LargestPossibleRegion) <span class="keywordflow">return</span>; <a name="l00189"></a>00189 m_LargestPossibleRegion = reg; <a name="l00190"></a>00190 this->Modified(); <a name="l00191"></a>00191 } <a name="l00192"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#69702d23828353702c3dbb4a907372ec">00192</a> ImageRegionType GetLargestPossibleRegion()<span class="keyword"> const</span> <a name="l00193"></a>00193 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_LargestPossibleRegion; } <a name="l00195"></a>00195 <a name="l00198"></a>00198 <span class="keyword">static</span> <span class="keywordtype">void</span> RelabelImage(OutputImageTypePointer, <a name="l00199"></a>00199 ImageRegionType, <a name="l00200"></a>00200 <a class="code" href="classitk_1_1SmartPointer.html">EquivalencyTable::Pointer</a>); <a name="l00201"></a>00201 <a name="l00203"></a>00203 <span class="keyword">virtual</span> DataObjectPointer MakeOutput(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> idx); <a name="l00204"></a>00204 <a name="l00207"></a>00207 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(CurrentLabel, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>); <a name="l00208"></a>00208 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>(CurrentLabel, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>); <a name="l00210"></a>00210 <a name="l00221"></a>00221 <a class="code" href="itkMacro_8h.html#5cefe2f514fdc24c2484af7849042f18">itkSetClampMacro</a>(Threshold, <span class="keywordtype">double</span>, 0.0, 1.0); <a name="l00222"></a>00222 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>(Threshold, <span class="keywordtype">double</span>); <a name="l00224"></a>00224 <a name="l00228"></a>00228 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(DoBoundaryAnalysis, <span class="keywordtype">bool</span>); <a name="l00229"></a>00229 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>(DoBoundaryAnalysis, <span class="keywordtype">bool</span>); <a name="l00231"></a>00231 <a name="l00236"></a>00236 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>(SortEdgeLists, <span class="keywordtype">bool</span>); <a name="l00237"></a>00237 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>(SortEdgeLists, <span class="keywordtype">bool</span>); <a name="l00239"></a>00239 <a name="l00240"></a>00240 <span class="keyword">protected</span>: <a name="l00243"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html">00243</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html">flat_region_t</a> <a name="l00244"></a>00244 { <a name="l00245"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html#56fbe70e0db083c707ab3f57b0ee7947">00245</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> *min_label_ptr; <a name="l00246"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html#79b249a35f61fd49183d4b279ba0ce59">00246</a> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a> bounds_min; <a name="l00247"></a>00247 <span class="comment">// InputPixelType bounds_max; // <-- may not be necc.</span> <a name="l00248"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html#e1d96cf3d4f06fa417a2af193b71cd97">00248</a> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a> value; <a name="l00249"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html#53f5cfc0988455f7446ba53292a0fa54">00249</a> <span class="keywordtype">bool</span> is_on_boundary; <a name="l00250"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html#c7acb9bd97d216cd6b179ab883353ead">00250</a> <a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1flat__region__t.html#c7acb9bd97d216cd6b179ab883353ead">flat_region_t</a>() : is_on_boundary(false) {} <a name="l00251"></a>00251 }; <a name="l00252"></a>00252 <a name="l00254"></a>00254 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hash__map.html" title="Replacement for STL hash map because some systems do not support it, or support it...">itk::hash_map<unsigned long, flat_region_t, itk::hash<unsigned long></a> > <a name="l00255"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#6af67e6f43eb27205f7778e6e474498c">00255</a> <a class="code" href="classitk_1_1hash__map.html" title="Replacement for STL hash map because some systems do not support it, or support it...">flat_region_table_t</a>; <a name="l00256"></a>00256 <a name="l00257"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1connectivity__t.html">00257</a> <span class="keyword">struct </span><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1connectivity__t.html">connectivity_t</a> <a name="l00258"></a>00258 { <a name="l00259"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1connectivity__t.html#6cff64e206cb1b8d6a63819852cc4648">00259</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size; <a name="l00260"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1connectivity__t.html#f5bbd3a94adffc7b45f845813c95c2c1">00260</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *index; <a name="l00261"></a><a class="code" href="structitk_1_1watershed_1_1Segmenter_1_1connectivity__t.html#41a043e296370564efb6c509880d7d85">00261</a> <span class="keyword">typename</span> InputImageType::OffsetType *direction; <a name="l00262"></a>00262 }; <a name="l00263"></a>00263 <a name="l00268"></a>00268 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hash__map.html" title="Replacement for STL hash map because some systems do not support it, or support it...">itk::hash_map<unsigned long, InputPixelType, itk::hash<unsigned long></a> <a name="l00269"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#baf1ba67da48d7d2b334a52f27ba359e">00269</a> > <a class="code" href="classitk_1_1hash__map.html" title="Replacement for STL hash map because some systems do not support it, or support it...">edge_table_t</a>; <a name="l00270"></a>00270 <a name="l00271"></a>00271 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1hash__map.html" title="Replacement for STL hash map because some systems do not support it, or support it...">itk::hash_map<unsigned long, edge_table_t, itk::hash<unsigned long></a> <a name="l00272"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#a778a4311239cda3e4413ae16be98eac">00272</a> > <a class="code" href="classitk_1_1hash__map.html" title="Replacement for STL hash map because some systems do not support it, or support it...">edge_table_hash_t</a>; <a name="l00273"></a>00273 <a name="l00274"></a>00274 <a class="code" href="classitk_1_1watershed_1_1Segmenter.html">Segmenter</a>(); <a name="l00275"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#50780cd4d2463f3aa88eb27a23cb8799">00275</a> <a class="code" href="classitk_1_1watershed_1_1Segmenter.html#50780cd4d2463f3aa88eb27a23cb8799">Segmenter</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>&) {} <a name="l00276"></a>00276 <span class="keyword">virtual</span> ~<a class="code" href="classitk_1_1watershed_1_1Segmenter.html">Segmenter</a>(); <a name="l00277"></a>00277 <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#920ae03048a5ad715d803ca2e92b52de">PrintSelf</a>(std::ostream& os, <a class="code" href="classitk_1_1Indent.html" title="Control indentation during Print() invocation.">Indent</a> indent) <span class="keyword">const</span>; <a name="l00278"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#8cd6abd3a369acc99aa0793a592c9130">00278</a> <span class="keywordtype">void</span> <a class="code" href="classitk_1_1watershed_1_1Segmenter.html#8cd6abd3a369acc99aa0793a592c9130">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1LightObject.html" title="Light weight base class for most itk classes.">Self</a>&) {} <a name="l00279"></a>00279 <a name="l00282"></a>00282 <span class="keyword">virtual</span> <span class="keywordtype">void</span> GenerateConnectivity(); <a name="l00283"></a>00283 <a name="l00287"></a>00287 <span class="keywordtype">void</span> GenerateInputRequestedRegion(); <a name="l00288"></a>00288 <span class="keywordtype">void</span> GenerateOutputRequestedRegion(<a class="code" href="classitk_1_1DataObject.html" title="Base class for all data objects in ITK.">DataObject</a> *output); <a name="l00289"></a>00289 <span class="keywordtype">void</span> UpdateOutputInformation(); <a name="l00291"></a>00291 <a name="l00294"></a>00294 <span class="keywordtype">void</span> InitializeBoundary(); <a name="l00295"></a>00295 <a name="l00299"></a>00299 <span class="keywordtype">void</span> AnalyzeBoundaryFlow(InputImageTypePointer, <a name="l00300"></a>00300 flat_region_table_t &, <a name="l00301"></a>00301 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a>); <a name="l00302"></a>00302 <a name="l00306"></a>00306 <span class="keywordtype">void</span> BuildRetainingWall(InputImageTypePointer, <a name="l00307"></a>00307 ImageRegionType, <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a>); <a name="l00308"></a>00308 <a name="l00311"></a>00311 <span class="keywordtype">void</span> LabelMinima(InputImageTypePointer, <a name="l00312"></a>00312 ImageRegionType, flat_region_table_t &, <a name="l00313"></a>00313 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a>); <a name="l00314"></a>00314 <a name="l00318"></a>00318 <span class="keywordtype">void</span> GradientDescent(InputImageTypePointer, ImageRegionType); <a name="l00319"></a>00319 <a name="l00322"></a>00322 <span class="keywordtype">void</span> DescendFlatRegions(flat_region_table_t &, ImageRegionType); <a name="l00323"></a>00323 <a name="l00326"></a>00326 <span class="keywordtype">void</span> UpdateSegmentTable(InputImageTypePointer, ImageRegionType); <a name="l00327"></a>00327 <a name="l00331"></a>00331 <span class="keywordtype">void</span> CollectBoundaryInformation(flat_region_table_t &); <a name="l00332"></a>00332 <a name="l00338"></a>00338 <span class="keyword">static</span> <span class="keywordtype">void</span> Threshold(InputImageTypePointer destination, <a name="l00339"></a>00339 InputImageTypePointer source, <a name="l00340"></a>00340 <span class="keyword">const</span> ImageRegionType source_region, <a name="l00341"></a>00341 <span class="keyword">const</span> ImageRegionType destination_region, <a name="l00342"></a>00342 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a> threshold); <a name="l00343"></a>00343 <a name="l00345"></a>00345 <span class="keyword">static</span> <span class="keywordtype">void</span> MinMax(InputImageTypePointer img, <a name="l00346"></a>00346 ImageRegionType region, <a name="l00347"></a>00347 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a> &min, <a name="l00348"></a>00348 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a> &max); <a name="l00349"></a>00349 <a name="l00351"></a>00351 <span class="keyword">static</span> <span class="keywordtype">void</span> MergeFlatRegions(flat_region_table_t &, <a class="code" href="classitk_1_1SmartPointer.html">EquivalencyTable::Pointer</a>); <a name="l00352"></a>00352 <a name="l00354"></a>00354 <span class="keyword">static</span> <span class="keywordtype">void</span> SetInputImageValues(InputImageTypePointer img, <a name="l00355"></a>00355 <span class="keyword">const</span> ImageRegionType region, <a name="l00356"></a>00356 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#6e44b89d73d576fe68c175566a634ab8">InputPixelType</a> value); <a name="l00357"></a>00357 <a name="l00358"></a>00358 <span class="keyword">static</span> <span class="keywordtype">void</span> SetOutputImageValues(OutputImageTypePointer img, <a name="l00359"></a>00359 <span class="keyword">const</span> ImageRegionType region, <a name="l00360"></a>00360 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> value); <a name="l00361"></a>00361 <a name="l00363"></a>00363 <span class="comment">// bool CheckLabeledBoundaries();</span> <a name="l00364"></a>00364 <a name="l00367"></a><a class="code" href="classitk_1_1watershed_1_1Segmenter.html#0645ed8fe1482067da672afc3f2d58f9">00367</a> connectivity_t m_Connectivity; <a name="l00368"></a>00368 <a name="l00369"></a>00369 <span class="keyword">private</span>: <a name="l00371"></a>00371 <span class="comment">// void PrintFlatRegions(flat_region_table_t &t);</span> <a name="l00372"></a>00372 <a name="l00376"></a>00376 ImageRegionType m_LargestPossibleRegion; <a name="l00377"></a>00377 <a name="l00378"></a>00378 <span class="keywordtype">bool</span> m_SortEdgeLists; <a name="l00379"></a>00379 <span class="keywordtype">bool</span> m_DoBoundaryAnalysis; <a name="l00380"></a>00380 <span class="keywordtype">double</span> m_Threshold; <a name="l00381"></a>00381 <span class="keywordtype">double</span> m_MaximumFloodLevel; <a name="l00382"></a>00382 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> m_CurrentLabel; <a name="l00383"></a>00383 }; <a name="l00384"></a>00384 <a name="l00385"></a>00385 }<span class="comment">// end namespace watershed</span> <a name="l00386"></a>00386 }<span class="comment">// end namespace itk</span> <a name="l00387"></a>00387 <a name="l00388"></a>00388 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION</span> <a name="l00389"></a>00389 <span class="preprocessor"></span><span class="preprocessor">#include "itkWatershedSegmenter.txx"</span> <a name="l00390"></a>00390 <span class="preprocessor">#endif</span> <a name="l00391"></a>00391 <span class="preprocessor"></span> <a name="l00392"></a>00392 <span class="preprocessor">#endif</span> <a name="l00393"></a>00393 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Fri May 8 00:40:48 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>