<!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: itkGaussianOperator.h Source File</title> <link href="DoxygenStyle.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Section customized for INSIGHT : Tue Jul 17 01:02:45 2001 --> <center> <a href="index.html" class="qindex">Main Page</a> <a href="modules.html" class="qindex">Groups</a> <a href="namespaces.html" class="qindex">Namespace List</a> <a href="hierarchy.html" class="qindex">Class Hierarchy</a> <a href="classes.html" class="qindex">Alphabetical List</a> <a href="annotated.html" class="qindex">Compound List</a> <a href="files.html" class="qindex">File List</a> <a href="namespacemembers.html" class="qindex">Namespace Members</a> <a href="functions.html" class="qindex">Compound Members</a> <a href="globals.html" class="qindex">File Members</a> <a href="pages.html" class="qindex">Concepts</a></center> <!-- Generated by Doxygen 1.5.9 --> <div class="navpath"><a class="el" href="dir_02e23d841c198393a6e961e9a0678fff.html">Code</a> » <a class="el" href="dir_ea7fc529ede9a38b0438cf13831ae873.html">Common</a> </div> <div class="contents"> <h1>itkGaussianOperator.h</h1><a href="itkGaussianOperator_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: itkGaussianOperator.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-17 01:08:45 $</span> <a name="l00007"></a>00007 <span class="comment"> Version: $Revision: 1.26 $</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 __itkGaussianOperator_h</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define __itkGaussianOperator_h</span> <a name="l00019"></a>00019 <span class="preprocessor"></span> <a name="l00020"></a>00020 <span class="preprocessor">#include "<a class="code" href="itkNeighborhoodOperator_8h.html">itkNeighborhoodOperator.h</a>"</span> <a name="l00021"></a>00021 <span class="preprocessor">#include <math.h></span> <a name="l00022"></a>00022 <span class="keyword">namespace </span>itk { <a name="l00023"></a>00023 <a name="l00059"></a>00059 <span class="keyword">template</span><<span class="keyword">class </span>TPixel,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> VDimension=2, <a name="l00060"></a>00060 <span class="keyword">class </span>TAllocator = NeighborhoodAllocator<TPixel> > <a name="l00061"></a><a class="code" href="classitk_1_1GaussianOperator.html">00061</a> <span class="keyword">class </span><a class="code" href="itkWin32Header_8h.html#7d4384322557205d75f0719c012dded6">ITK_EXPORT</a> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">GaussianOperator</a> <a name="l00062"></a>00062 : <span class="keyword">public</span> <a class="code" href="classitk_1_1NeighborhoodOperator.html" title="Virtual class that defines a common interface to all neighborhood operator subtypes...">NeighborhoodOperator</a><TPixel, VDimension, TAllocator> <a name="l00063"></a>00063 { <a name="l00064"></a>00064 <span class="keyword">public</span>: <a name="l00066"></a><a class="code" href="classitk_1_1GaussianOperator.html#8ac6148d5de091702baaf1507b6e4aa9">00066</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">GaussianOperator</a> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">Self</a>; <a name="l00067"></a><a class="code" href="classitk_1_1GaussianOperator.html#b73921680d35654b318ff56e4d02f217">00067</a> <span class="keyword">typedef</span> <a class="code" href="classitk_1_1NeighborhoodOperator.html">NeighborhoodOperator<TPixel, VDimension, TAllocator></a> <a class="code" href="classitk_1_1NeighborhoodOperator.html">Superclass</a>; <a name="l00068"></a>00068 <a name="l00070"></a><a class="code" href="classitk_1_1GaussianOperator.html#afa4a552e28d376696061461c210fdaf">00070</a> <a class="code" href="classitk_1_1GaussianOperator.html#afa4a552e28d376696061461c210fdaf">GaussianOperator</a>() : m_Variance(1), m_MaximumError(.01), m_MaximumKernelWidth(30) { } <a name="l00071"></a>00071 <a name="l00073"></a><a class="code" href="classitk_1_1GaussianOperator.html#18885a5307078f121ecfbfae6fcc1b99">00073</a> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">GaussianOperator</a>(<span class="keyword">const</span> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">Self</a> &other) <a name="l00074"></a>00074 : <a class="code" href="classitk_1_1NeighborhoodOperator.html" title="Virtual class that defines a common interface to all neighborhood operator subtypes...">NeighborhoodOperator</a><TPixel, VDimension, TAllocator>(other) <a name="l00075"></a>00075 { <a name="l00076"></a>00076 m_Variance = other.m_Variance; <a name="l00077"></a>00077 m_MaximumError = other.m_MaximumError; <a name="l00078"></a>00078 m_MaximumKernelWidth = other.m_MaximumKernelWidth; <a name="l00079"></a>00079 } <a name="l00081"></a>00081 <a name="l00083"></a><a class="code" href="classitk_1_1GaussianOperator.html#7c48616b1d6a8d6c20730bda6a488731">00083</a> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">Self</a> &operator=(<span class="keyword">const</span> <a class="code" href="classitk_1_1GaussianOperator.html" title="A NeighborhoodOperator whose coefficients are a one dimensional, discrete Gaussian...">Self</a> &other) <a name="l00084"></a>00084 { <a name="l00085"></a>00085 Superclass::operator=(other); <a name="l00086"></a>00086 m_Variance = other.m_Variance; <a name="l00087"></a>00087 m_MaximumError = other.m_MaximumError; <a name="l00088"></a>00088 m_MaximumKernelWidth = other.m_MaximumKernelWidth; <a name="l00089"></a>00089 <span class="keywordflow">return</span> *<span class="keyword">this</span>; <a name="l00090"></a>00090 } <a name="l00092"></a>00092 <a name="l00094"></a><a class="code" href="classitk_1_1GaussianOperator.html#a0d90f8697b1d615947672b6cbb18839">00094</a> <span class="keywordtype">void</span> SetVariance(<span class="keyword">const</span> <span class="keywordtype">double</span> &variance) <a name="l00095"></a>00095 { <a name="l00096"></a>00096 m_Variance = variance; <a name="l00097"></a>00097 } <a name="l00098"></a>00098 <a name="l00103"></a><a class="code" href="classitk_1_1GaussianOperator.html#1256ac7db1bc3bae21dd0bb3d1a5b272">00103</a> <span class="keywordtype">void</span> SetMaximumError(<span class="keyword">const</span> <span class="keywordtype">double</span> &max_error) <a name="l00104"></a>00104 { <a name="l00105"></a>00105 <span class="keywordflow">if</span> (max_error >= 1 || max_error <= 0) <a name="l00106"></a>00106 { <a name="l00107"></a>00107 <a class="code" href="itkMacro_8h.html#c51de1a715471e7fd0f2e481a70fa1f8">itkExceptionMacro</a>(<span class="stringliteral">"Maximum Error Must be in the range [ 0.0 , 1.0 ]"</span>); <a name="l00108"></a>00108 } <a name="l00109"></a>00109 <a name="l00110"></a>00110 m_MaximumError = max_error; <a name="l00111"></a>00111 } <a name="l00112"></a>00112 <a name="l00114"></a><a class="code" href="classitk_1_1GaussianOperator.html#f36fbb90dc7d033d312dcf6b0c0078e8">00114</a> <span class="keywordtype">double</span> GetVariance() <a name="l00115"></a>00115 { <span class="keywordflow">return</span> m_Variance; } <a name="l00116"></a>00116 <a name="l00121"></a><a class="code" href="classitk_1_1GaussianOperator.html#8550d29cd8f06e1ed6bf3551a715cf3a">00121</a> <span class="keywordtype">double</span> GetMaximumError() <a name="l00122"></a>00122 { <span class="keywordflow">return</span> m_MaximumError; } <a name="l00123"></a>00123 <a name="l00128"></a><a class="code" href="classitk_1_1GaussianOperator.html#1e9799dd59a77abcd3e40efe719d07bd">00128</a> <span class="keywordtype">void</span> SetMaximumKernelWidth( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> n ) <a name="l00129"></a>00129 { m_MaximumKernelWidth = n; } <a name="l00130"></a>00130 <a name="l00132"></a><a class="code" href="classitk_1_1GaussianOperator.html#6934752c2df8793c473390b31981d406">00132</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GetMaximumKernelWidth()<span class="keyword"> const</span> <a name="l00133"></a>00133 <span class="keyword"> </span>{ <span class="keywordflow">return</span> m_MaximumKernelWidth; } <a name="l00134"></a>00134 <a name="l00136"></a><a class="code" href="classitk_1_1GaussianOperator.html#8df0391bdff55dcb4faff559c5eb4056">00136</a> <span class="keyword">virtual</span> <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> i)<span class="keyword"> const</span> <a name="l00137"></a>00137 <span class="keyword"> </span>{ <a name="l00138"></a>00138 os << i << <span class="stringliteral">"GaussianOperator { this="</span> << <span class="keyword">this</span> <a name="l00139"></a>00139 << <span class="stringliteral">", m_Variance = "</span> << m_Variance <a name="l00140"></a>00140 << <span class="stringliteral">", m_MaximumError = "</span> << m_MaximumError <a name="l00141"></a>00141 << <span class="stringliteral">"} "</span> << std::endl; <a name="l00142"></a>00142 <a class="code" href="namespaceHardConnectedComponentImageFilter.html#920ae03048a5ad715d803ca2e92b52de">Superclass::PrintSelf</a>(os, i.<a class="code" href="classitk_1_1Indent.html#d8083599b8f6497704b67a195768db33">GetNextIndent</a>()); <a name="l00143"></a>00143 } <a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="keyword">protected</span>: <a name="l00147"></a><a class="code" href="classitk_1_1GaussianOperator.html#8f5954fade086fbd2da0784fe99de8a5">00147</a> <span class="keyword">typedef</span> <span class="keyword">typename</span> Superclass::CoefficientVector CoefficientVector; <a name="l00148"></a>00148 <a name="l00150"></a>00150 <span class="keywordtype">double</span> ModifiedBesselI0(<span class="keywordtype">double</span>); <a name="l00151"></a>00151 <a name="l00154"></a>00154 <span class="keywordtype">double</span> ModifiedBesselI1(<span class="keywordtype">double</span>); <a name="l00155"></a>00155 <a name="l00158"></a>00158 <span class="keywordtype">double</span> ModifiedBesselI(<span class="keywordtype">int</span>, <span class="keywordtype">double</span>); <a name="l00159"></a>00159 <a name="l00161"></a>00161 CoefficientVector GenerateCoefficients(); <a name="l00162"></a>00162 <a name="l00164"></a><a class="code" href="classitk_1_1GaussianOperator.html#dbdc779fe9000e246045ed1d3b596abf">00164</a> <span class="keywordtype">void</span> Fill(<span class="keyword">const</span> CoefficientVector& coeff) <a name="l00165"></a>00165 { this->FillCenteredDirectional(coeff); } <a name="l00166"></a>00166 <a name="l00167"></a>00167 <span class="keyword">private</span>: <a name="l00169"></a>00169 <span class="keywordtype">double</span> m_Variance; <a name="l00170"></a>00170 <a name="l00173"></a>00173 <span class="keywordtype">double</span> m_MaximumError; <a name="l00174"></a>00174 <a name="l00178"></a>00178 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_MaximumKernelWidth; <a name="l00179"></a>00179 <a name="l00181"></a>00181 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="namespaceHardConnectedComponentImageFilter.html#1e7887715ed528b24824746b7f5d5e58">GetNameOfClass</a>() <a name="l00182"></a>00182 { <span class="keywordflow">return</span> <span class="stringliteral">"itkGaussianOperator"</span>; } <a name="l00183"></a>00183 <a name="l00184"></a>00184 }; <a name="l00185"></a>00185 <a name="l00186"></a>00186 } <span class="comment">// namespace itk</span> <a name="l00187"></a>00187 <a name="l00188"></a>00188 <span class="comment">// Define instantiation macro for this template.</span> <a name="l00189"></a><a class="code" href="itkGaussianOperator_8h.html#946fa3b8ccf9abd65591dde20c4d7c34">00189</a> <span class="preprocessor">#define ITK_TEMPLATE_GaussianOperator(_, EXPORT, x, y) namespace itk { \</span> <a name="l00190"></a>00190 <span class="preprocessor"> _(2(class EXPORT GaussianOperator< ITK_TEMPLATE_2 x >)) \</span> <a name="l00191"></a>00191 <span class="preprocessor"> namespace Templates { typedef GaussianOperator< ITK_TEMPLATE_2 x > \</span> <a name="l00192"></a>00192 <span class="preprocessor"> GaussianOperator##y; } \</span> <a name="l00193"></a>00193 <span class="preprocessor"> }</span> <a name="l00194"></a>00194 <span class="preprocessor"></span> <a name="l00195"></a>00195 <span class="preprocessor">#if ITK_TEMPLATE_EXPLICIT</span> <a name="l00196"></a>00196 <span class="preprocessor"></span><span class="preprocessor"># include "Templates/itkGaussianOperator+-.h"</span> <a name="l00197"></a>00197 <span class="preprocessor">#endif</span> <a name="l00198"></a>00198 <span class="preprocessor"></span> <a name="l00199"></a>00199 <span class="preprocessor">#if ITK_TEMPLATE_TXX</span> <a name="l00200"></a>00200 <span class="preprocessor"></span><span class="preprocessor"># include "itkGaussianOperator.txx"</span> <a name="l00201"></a>00201 <span class="preprocessor">#endif</span> <a name="l00202"></a>00202 <span class="preprocessor"></span> <a name="l00203"></a>00203 <span class="preprocessor">#endif</span> <a name="l00204"></a>00204 <span class="preprocessor"></span> </pre></div></div> <hr><address><small> Generated at Thu May 7 22:48:20 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>