<!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 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">> Date: Tue, 05 Jul 2005 12:05:27 +0800</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> From: "Jimmy Wong" <good_piggy@msn.com></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Subject: [Insight-users] Question about itkImageGaussianModelEstimator</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> To: insight-users@itk.org</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Message-ID: <BAY5-F117DD30928D20CFCC22A0DF9E60@phx.gbl></FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Content-Type: text/plain; format=flowed</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Dear all,</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> In itkImageGaussianModelEstimator.txx, line 219, the code is</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> //-----------------------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> if(classIndex > 0)</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> {</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> m_NumberOfSamples[classIndex][0] +=1;</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> InputImagePixelType inImgVec = inIt.Get();</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> for(unsigned int band_x = 0; band_x < VectorDimension; band_x++)</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> {</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> m_Means[classIndex][band_x] += inImgVec[band_x];</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> for(unsigned int band_y = 0; band_y <= band_x; band_y++ )</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> {</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> m_Covariance[classIndex][band_x][band_y] += inImgVec[band_x] * </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> inImgVec[band_y];</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> }</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> }</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> }</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> }// end for</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> //---------------------------------------------------------------------</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> If the condition is classIndex > 0, will we lost one class?</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Thanks in advance.</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Zhimin</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> _________________________________________________________________</FONT>
<BR><FONT SIZE=2 FACE="Courier New">> Get an advanced look at the new version of MSN Messenger. </FONT>
<BR><FONT SIZE=2 FACE="Courier New">> </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>