<!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: itkThresholdMaximumConnectedComponentsImageFilter.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>itkThresholdMaximumConnectedComponentsImageFilter.h</h1><a href="itkThresholdMaximumConnectedComponentsImageFilter_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: itkThresholdMaximumConnectedComponentsImageFilter.h,v $</span> <a name="l00005"></a>00005 <span class="comment"> Language: C++</span> <a name="l00006"></a>00006 <span class="comment"> Date: $Date: 2007-04-27 19:05:39 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.4 $</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 <a name="l00018"></a>00018 <span class="preprocessor">#ifndef __itkThresholdMaximumConnectedComponentsImageFilter_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define __itkThresholdMaximumConnectedComponentsImageFilter_h</span> <a name="l00020"></a>00020 <span class="preprocessor"></span> <a name="l00021"></a>00021 <span class="preprocessor">#include "<a class="code" href="itkInPlaceImageFilter_8h.html">itkInPlaceImageFilter.h</a>"</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="itkBinaryThresholdImageFilter_8h.html">itkBinaryThresholdImageFilter.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="itkConnectedComponentImageFilter_8h.html">itkConnectedComponentImageFilter.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="itkRelabelComponentImageFilter_8h.html">itkRelabelComponentImageFilter.h</a>"</span> <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="itkMinimumMaximumImageCalculator_8h.html">itkMinimumMaximumImageCalculator.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="itkCastImageFilter_8h.html">itkCastImageFilter.h</a>"</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="itkConceptChecking_8h.html">itkConceptChecking.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 <a name="l00074"></a>00074 <span class="keyword">template</span> <<span class="keyword">class</span> TInputImage, <span class="keyword">class</span> TOutputImage = TInputImage> <a name="l00075"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html">00075</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">ThresholdMaximumConnectedComponentsImageFilter</a> : <a name="l00076"></a>00076 <span class="keyword">public</span> <a class="code" href="classitk_1_1ImageToImageFilter.html" title="Base class for filters that take an image as input and produce an image as output...">ImageToImageFilter</a>< TInputImage , TOutputImage > <a name="l00077"></a>00077 { <a name="l00078"></a>00078 <span class="keyword">public</span>: <a name="l00080"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#98e852e4def923ae35c6fcb2c7d61689">00080</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">ThresholdMaximumConnectedComponentsImageFilter</a> <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">Self</a>; <a name="l00081"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#bab1727fbed729f089362e02fe3daf36">00081</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ImageToImageFilter.html">ImageToImageFilter<TInputImage,TOutputImage></a> <a class="code" href="classitk_1_1ImageToImageFilter.html">Superclass</a>; <a name="l00082"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#0b84888e6a4e14b70a89d3eba82ddeb7">00082</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="l00083"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#e99636ed6fb1b4a7d641a608c3270d1a">00083</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="l00084"></a>00084 <a name="l00086"></a>00086 <a class="code" href="itkMacro_8h.html#0fdc15685afa271857c57e7cd482f30c">itkNewMacro</a>(<a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">Self</a>); <a name="l00087"></a>00087 <a name="l00089"></a>00089 <a class="code" href="itkMacro_8h.html#574c1f86661d409dd32c742307a0e96a">itkTypeMacro</a>( <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">ThresholdMaximumConnectedComponentsImageFilter</a>, <a name="l00090"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#d7eca247abe3bd8dcefd3443403ee034">00090</a> <a class="code" href="classitk_1_1ImageToImageFilter.html" title="Base class for filters that take an image as input and produce an image as output...">ImageToImageFilter</a> ); <a name="l00091"></a>00091 <a name="l00093"></a>00093 <span class="keyword">typedef</span> <span class="keyword">typename</span> TInputImage::PixelType PixelType; <a name="l00094"></a>00094 <a name="l00096"></a>00096 <a class="code" href="itkConceptChecking_8h.html#009eae6c305d9c390972159815e6a710">itkConceptMacro</a>(PixelTypeComparable, (<a class="code" href="structitk_1_1Concept_1_1Comparable.html">Concept::Comparable<PixelType></a>)); <a name="l00097"></a>00097 <a name="l00105"></a>00105 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>( MinimumObjectSizeInPixels, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ); <a name="l00106"></a>00106 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>( MinimumObjectSizeInPixels, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ); <a name="l00108"></a>00108 <a name="l00122"></a>00122 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>( InsideValue, PixelType ); <a name="l00123"></a>00123 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>( OutsideValue, PixelType ); <a name="l00124"></a>00124 <a class="code" href="itkMacro_8h.html#7ebdd33cc5e7d74720ced9099c034faa">itkSetMacro</a>( UpperBoundary, PixelType ); <a name="l00125"></a>00125 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>( InsideValue, PixelType ); <a name="l00126"></a>00126 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>( OutsideValue, PixelType ); <a name="l00127"></a>00127 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>( UpperBoundary, PixelType ); <a name="l00129"></a>00129 <a name="l00134"></a>00134 <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>( NumberOfObjects, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ); <a name="l00135"></a>00135 <a name="l00139"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#9b550300e9d907f8b3dca7c87bfcc400">00139</a> <a class="code" href="itkMacro_8h.html#1600305bb01e39e87c472d8bf29bd1cf">itkGetMacro</a>( ThresholdValue, PixelType ); <a name="l00140"></a>00140 <a name="l00142"></a>00142 <span class="keyword">typedef</span> TInputImage <a class="code" href="namespaceHardConnectedComponentImageFilter.html#3742cbac150bee74daa9aab85ed80623">InputImageType</a>; <a name="l00143"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#25bb1bbe3622ae516a8b79a814059367">00143</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#68fafcc6909430ccd70cbc4aeee0107c">InputImageType::ConstPointer</a> InputImagePointer; <a name="l00144"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#a636ea255769185ae3041525409cd3c3">00144</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">InputImageType::RegionType</a> InputImageRegionType; <a name="l00145"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#4d7a540bc18cfbf78070112da1f9dbd9">00145</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> InputImageType::PixelType InputImagePixelType; <a name="l00146"></a>00146 <a name="l00148"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#b15f67b7d849c41c57d23e3dc01b25ab">00148</a> <span class="keyword">typedef</span> TOutputImage <a class="code" href="namespaceHardConnectedComponentImageFilter.html#386ea018cab3835dcdff2603f4d2280e">OutputImageType</a>; <a name="l00149"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#09599a45295fe361ed59eee5e7c91c1d">00149</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">OutputImageType::Pointer</a> OutputImagePointer; <a name="l00150"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#95a88fd8abad67d73f860bd5fea89f0e">00150</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ed8c4a40607d317c666eb96ea265e126">OutputImageType::RegionType</a> OutputImageRegionType; <a name="l00151"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#bbdf6705c6bcdb85729a231dd93adbd7">00151</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> OutputImageType::PixelType OutputImagePixelType; <a name="l00152"></a>00152 <a name="l00153"></a>00153 <a name="l00154"></a>00154 <span class="keyword">protected</span>: <a name="l00155"></a>00155 <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">ThresholdMaximumConnectedComponentsImageFilter</a>(); <a name="l00156"></a><a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#d949c49b9d294797f6e13c029532c79f">00156</a> <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html#d949c49b9d294797f6e13c029532c79f">~ThresholdMaximumConnectedComponentsImageFilter</a>() {}; <a name="l00157"></a>00157 <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="l00158"></a>00158 <a name="l00161"></a>00161 <span class="keywordtype">void</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#f75a5945cdd8315676941024a0b8c1e9">GenerateData</a>(<span class="keywordtype">void</span>); <a name="l00162"></a>00162 <a name="l00167"></a>00167 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> ComputeConnectedComponents(<span class="keywordtype">void</span>); <a name="l00168"></a>00168 <a name="l00169"></a>00169 <a name="l00170"></a>00170 <span class="keyword">private</span>: <a name="l00171"></a>00171 <a name="l00173"></a>00173 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> FilterPixelType; <a name="l00174"></a>00174 <a name="l00175"></a>00175 <a class="code" href="itkMacro_8h.html#1905cf6b2e88235996fa7ff73b2fb0eb">itkStaticConstMacro</a>( ImageDimension, <a name="l00176"></a>00176 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <a name="l00177"></a>00177 TInputImage::ImageDimension ); <a name="l00178"></a>00178 <a name="l00179"></a>00179 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1Image.html" title="Templated n-dimensional image class.">itk::Image< FilterPixelType, itkGetStaticConstMacro(ImageDimension) ></a> <a name="l00180"></a>00180 FilterImageType; <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="keyword">typedef</span> <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">FilterImageType::Pointer</a> FilterImagePointer; <a name="l00183"></a>00183 <a name="l00184"></a>00184 <span class="comment">//purposely not implemented</span> <a name="l00185"></a>00185 <a class="code" href="classitk_1_1ThresholdMaximumConnectedComponentsImageFilter.html" title="Finds the threshold value of an image based on maximizing the number of objects in...">ThresholdMaximumConnectedComponentsImageFilter</a>(<span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ac7d0120fe5292cdcdddb6163b8cb150">Self</a>&); <a name="l00186"></a>00186 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="namespaceHardConnectedComponentImageFilter.html#ac7d0120fe5292cdcdddb6163b8cb150">Self</a>&); <span class="comment">//purposely not implemented</span> <a name="l00187"></a>00187 <a name="l00188"></a>00188 <a name="l00189"></a>00189 <span class="comment">//</span> <a name="l00190"></a>00190 <span class="comment">// Binary Threshold Filter</span> <a name="l00191"></a>00191 <span class="comment">//</span> <a name="l00192"></a>00192 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1BinaryThresholdImageFilter.html" title="Binarize an input image by thresholding.">BinaryThresholdImageFilter< InputImageType, OutputImageType ></a> <a name="l00193"></a>00193 ThresholdFilterType; <a name="l00194"></a>00194 <a name="l00195"></a>00195 <a name="l00196"></a>00196 <span class="comment">// </span> <a name="l00197"></a>00197 <span class="comment">// Connected Components Filter </span> <a name="l00198"></a>00198 <span class="comment">//</span> <a name="l00199"></a>00199 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1ConnectedComponentImageFilter.html" title="Label the objects in a binary image.">ConnectedComponentImageFilter< OutputImageType, FilterImageType ></a> <a name="l00200"></a>00200 ConnectedFilterType; <a name="l00201"></a>00201 <a name="l00202"></a>00202 <a name="l00203"></a>00203 <span class="comment">//</span> <a name="l00204"></a>00204 <span class="comment">// Relabeled Components Filter</span> <a name="l00205"></a>00205 <span class="comment">//</span> <a name="l00206"></a>00206 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1RelabelComponentImageFilter.html" title="Relabel the components in an image such that consecutive labels are used.">RelabelComponentImageFilter< FilterImageType, FilterImageType ></a> <a name="l00207"></a>00207 RelabelFilterType; <a name="l00208"></a>00208 <a name="l00209"></a>00209 <a name="l00210"></a>00210 <span class="comment">//</span> <a name="l00211"></a>00211 <span class="comment">// Minimum maximum calculator</span> <a name="l00212"></a>00212 <span class="comment">//</span> <a name="l00213"></a>00213 <span class="keyword">typedef</span> <a class="code" href="classitk_1_1MinimumMaximumImageCalculator.html">MinimumMaximumImageCalculator< InputImageType ></a> MinMaxCalculatorType; <a name="l00214"></a>00214 <a name="l00215"></a>00215 <span class="comment">// </span> <a name="l00216"></a>00216 <span class="comment">// Declare member variables for the filters of the internal pipeline.</span> <a name="l00217"></a>00217 <span class="comment">//</span> <a name="l00218"></a>00218 <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">ThresholdFilterType::Pointer</a> m_ThresholdFilter; <a name="l00219"></a>00219 <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">ConnectedFilterType::Pointer</a> m_ConnectedComponent; <a name="l00220"></a>00220 <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">RelabelFilterType::Pointer</a> m_LabeledComponent; <a name="l00221"></a>00221 <span class="keyword">typename</span> <a class="code" href="itkFEMMacro_8h.html#539cce1a3282ba59952dedcbf9cdb23f">MinMaxCalculatorType::Pointer</a> m_MinMaxCalculator; <a name="l00222"></a>00222 <a name="l00223"></a>00223 <span class="comment">// Variables defined by the user</span> <a name="l00224"></a>00224 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_MinimumObjectSizeInPixels; <a name="l00225"></a>00225 <a name="l00226"></a>00226 <span class="comment">// Binary threshold variables</span> <a name="l00227"></a>00227 PixelType m_OutsideValue; <a name="l00228"></a>00228 PixelType m_InsideValue; <a name="l00229"></a>00229 PixelType m_LowerBoundary; <a name="l00230"></a>00230 PixelType m_UpperBoundary; <a name="l00231"></a>00231 <a name="l00232"></a>00232 <span class="comment">// Filter variables</span> <a name="l00233"></a>00233 PixelType m_ThresholdValue; <a name="l00234"></a>00234 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> m_NumberOfObjects; <a name="l00235"></a>00235 <a name="l00236"></a>00236 }; <a name="l00237"></a>00237 <a name="l00238"></a>00238 <a name="l00239"></a>00239 } <span class="comment">// end namespace itk</span> <a name="l00240"></a>00240 <a name="l00241"></a>00241 <span class="preprocessor">#ifndef ITK_MANUAL_INSTANTIATION</span> <a name="l00242"></a>00242 <span class="preprocessor"></span><span class="preprocessor">#include "itkThresholdMaximumConnectedComponentsImageFilter.txx"</span> <a name="l00243"></a>00243 <span class="preprocessor">#endif</span> <a name="l00244"></a>00244 <span class="preprocessor"></span> <a name="l00245"></a>00245 <span class="preprocessor">#endif</span> <a name="l00246"></a>00246 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Fri May 8 00:22:03 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>