<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.6944.0">
<TITLE>Re: [Insight-users] Question about itkImageGaussianModelEstimator</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Courier New">Hi Jimmy,</FONT>

<BR><FONT SIZE=2 FACE="Courier New">You made a good observation. In designing the class, it was assumed that the foreground classes (classes of interest) have labels greater than 0. 0 is considered to be background.</FONT></P>

<P><FONT SIZE=2 FACE="Courier New">In most medical images a large chunk of the image is occupied by the background. Iterating through the background adds to the computation time. Many a times the background statistics is known apriori or can be set more efficiently by doing sparse sampling. Also the background statistics in many cases does not change frequently. In such cases the statistics for the background could be separately computed, a model is often generated which is then reused until the background changes. </FONT></P>

<P><FONT SIZE=2 FACE="Courier New">At design time it was concluded if a user needed to calculate the statistics with class labels 0; He/She would be expected to assign the class a non-zero label say by offsetting all the labels by 1. I would suggest that your resort to this approach if you want to use this class for background class estimator. Alternatively, you may want to look into using</FONT> <A HREF="file://itkGaussianDensityFunction_8h-source.html"><U><FONT COLOR="#0000FF" FACE="Times New Roman">itkGaussianDensityFunction.h</FONT></U></A><FONT FACE="Times New Roman"> in itk::statistics for&nbsp; handling the background as a special class.</FONT></P>

<P><FONT FACE="Times New Roman">Thanks,</FONT>

<BR><FONT FACE="Times New Roman">Sayan </FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Courier New">&gt; Date: Tue, 05 Jul 2005 12:05:27 +0800</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; From: &quot;Jimmy Wong&quot; &lt;good_piggy@msn.com&gt;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Subject: [Insight-users] Question about itkImageGaussianModelEstimator</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; To: insight-users@itk.org</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Message-ID: &lt;BAY5-F117DD30928D20CFCC22A0DF9E60@phx.gbl&gt;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Content-Type: text/plain; format=flowed</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Dear all,</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; In itkImageGaussianModelEstimator.txx, line 219, the code is</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; //-----------------------------------------------------------------------------------</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp; if(classIndex &gt; 0)</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_NumberOfSamples[classIndex][0] +=1;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InputImagePixelType inImgVec = inIt.Get();</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(unsigned int band_x = 0; band_x &lt; VectorDimension; band_x++)</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Means[classIndex][band_x] += inImgVec[band_x];</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(unsigned int band_y = 0; band_y &lt;= band_x; band_y++ )</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_Covariance[classIndex][band_x][band_y] += inImgVec[band_x] * </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; inImgVec[band_y];</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt;&nbsp;&nbsp;&nbsp;&nbsp; }// end for</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; //---------------------------------------------------------------------</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; If the condition is classIndex &gt; 0, will we lost one class?</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Thanks in advance.</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Zhimin</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; _________________________________________________________________</FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; Get an advanced look at the new version of MSN Messenger. </FONT>

<BR><FONT SIZE=2 FACE="Courier New">&gt; </FONT><A HREF="http://messenger.msn.com.sg/Beta/Default.aspx"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Courier New">http://messenger.msn.com.sg/Beta/Default.aspx</FONT></U></A>
</P>

</BODY>
</HTML>