[Insight-users] ΄πΈ΄: [Insight-users] How to compute the parameters of VectorFuzzyConnectednessI mageFilter?

zhao yong qiang zhao-yq at cs.sjtu.edu.cn
Fri, 2 Apr 2004 15:53:32 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C418CA.A6891A80
Content-Type: text/plain;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Hi Zhuge,

      The following is my code, I convert the input of vector fuzzy
filter to vector image, and only set one project.

But after executing the program, I get nothing.

=20

typedef itk::Vector<float,1> IntVector;

       typedef itk::Image<IntVector,3> VectorImage;

typedef itk::Image<float,3> InputImageType,

       typedef itk::Image<float,3> OutImage;

       typedef itk::VectorFuzzyConnectednessImageFilter< VectorImage,
OutImage >

              FuzzyFilterType;

       FuzzyFilterType::Pointer FuzzyFilter =3D FuzzyFilterType::New();

=20

       VectorImage::IndexType seed,

       seed[0] =3D (unsigned long)this->viewVolume->clickSelectX();

       seed[1] =3D (unsigned long)this->viewVolume->clickSelectY();

       seed[2] =3D (unsigned long)this->viewVolume->clickSelectZ();

=20

       InputImageType::IndexType startIndex;

=20

       unsigned long radius =3D 2;

       InputImageType::SizeType size;

       InputImageType::RegionType sampleRegion;

       double               m_ObjectMean;

       typedef itk::Matrix<double,1,1>  MatrixType;

       double m_ObjectVariance;

       MatrixType m_ObjectMatrix;

=20

       size.Fill( 2 * radius + 1 );

              for( int j =3D 0; j < 3; j ++ )

              {

                     startIndex[j] =3D seed[j] - radius;

              }

              sampleRegion.SetSize( size );

              sampleRegion.SetIndex( startIndex );

              sampleRegion.Crop(
this->viewVolume->GetInputImage()->GetBufferedRegion() );

=20

              // compute mean and variance

              typedef itk::ImageRegionConstIterator<InputImageType>
Iterator;

              Iterator iter( this->viewVolume->GetInputImage(),
sampleRegion );

=20

              unsigned int counter =3D 0;

              double sum =3D 0;

              double sumsqr =3D 0;

=20

              while (!iter.IsAtEnd())

              {

                     double value =3D static_cast<double>( iter.Get() );

                     sum +=3D value;

                     sumsqr +=3D value * value;

                     counter++;

                     ++iter;

              }

=20

              m_ObjectMean =3D sum / static_cast<double>( counter );

              m_ObjectVariance =3D static_cast<double>( counter ) *
m_ObjectMean * m_ObjectMean;

              m_ObjectVariance =3D ( sumsqr - m_ObjectVariance ) /
static_cast<double>( counter - 1 );

              double m_Variance[1][1] =3D {{m_ObjectVariance}};

              m_ObjectMatrix.GetVnlMatrix().set((const double
*)m_Variance);

=20

       typedef itk::ScalarToArrayCastImageFilter< InputImageType,
VectorImage> ScalarImageFilter;

       ScalarImageFilter::Pointer ScalarImage =3D
ScalarImageFilter::New();

       ScalarImage->SetInput(this->viewVolume->GetInputImage());

       ScalarImage->Update();

=20

       FuzzyFilter->SetInput(ScalarImage->GetOutput());

       FuzzyFilter->SetNumberOfObjects(1);

       FuzzyFilter->Initialization();

=20

       FuzzyFilter->SetObjectsSeed(seed,0);

       FuzzyFilter->SetObjectsMean(m_ObjectMean,0);

       FuzzyFilter->SetObjectsMatrix(m_ObjectMatrix,0);

       FuzzyFilter->Update();

=20

Can you tell me the reason why I cannot get the result?

In your letter, you told me that I need not do any convertion, but if I
do that, the program shows me something wrong. Can you give me an
example of what you said?

=20

Thanks a lot!!!

=20

-----=D3=CA=BC=FE=D4=AD=BC=FE-----
=B7=A2=BC=FE=C8=CB: Ying Zhuge [mailto:zhuge at mipg.upenn.edu]=20
=B7=A2=CB=CD=CA=B1=BC=E4: 2004=C4=EA4=D4=C22=C8=D5 0:17
=CA=D5=BC=FE=C8=CB: zhao yong qiang
=D6=F7=CC=E2: Re: [Insight-users] How to compute the parameters of
VectorFuzzyConnectednessImageFilter?

=20

Hi, Yongqiang,

=20

In the vector filter, I take the scalar as the special case of vector
image. You don't need do any convertion. For parameters setting you can
only set the mean vector and covariance matrix as scalar values.

=20

Zhuge


------=_NextPart_000_0001_01C418CA.A6891A80
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dgb2312">


<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
  at font-face
	{font-family:=CB=CE=CC=E5;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
 at font-face
	{font-family:"\ at =CB=CE=CC=E5";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-justify:inter-ideograph;
	font-size:10.5pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.emailstyle17
	{font-family:Arial;
	color:windowtext;}
span.emailstyle18
	{font-family:Arial;}
span.emailstyle19
	{font-family:Arial;
	color:navy;}
span.emailstyle20
	{font-family:Arial;
	color:navy;}
span.emailstyle21
	{font-family:Arial;}
span.emailstyle22
	{font-family:Arial;}
span.emailstyle23
	{font-family:Arial;}
span.EmailStyle24
	{font-family:Arial;}
 at page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	layout-grid:15.6pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body bgcolor=3Dwhite lang=3DZH-CN link=3Dblue vlink=3Dpurple =
style=3D'text-justify-trim:
punctuation'>

<div class=3DSection1 style=3D'layout-grid:15.6pt'>

<div>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>Hi
Zhuge,</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;
The following is my code, I convert the input of vector fuzzy filter to =
vector
image, and only set one project.</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>But
after executing the program, I get nothing.</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left;
text-indent:21.0pt'><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial'>typedef itk::Vector&lt;float,1&gt; =
IntVector;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
typedef itk::Image&lt;IntVector,3&gt; VectorImage;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left;
text-indent:21.0pt'><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial'>typedef itk::Image&lt;float,3&gt; =
InputImageType,</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
typedef itk::Image&lt;float,3&gt; OutImage;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
typedef itk::VectorFuzzyConnectednessImageFilter&lt; VectorImage, =
OutImage &gt;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
FuzzyFilterType;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilterType::Pointer FuzzyFilter =3D =
FuzzyFilterType::New();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
VectorImage::IndexType seed,</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
seed[0] =3D (unsigned =
long)this-&gt;viewVolume-&gt;clickSelectX();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
seed[1] =3D (unsigned =
long)this-&gt;viewVolume-&gt;clickSelectY();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
seed[2] =3D (unsigned =
long)this-&gt;viewVolume-&gt;clickSelectZ();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
InputImageType::IndexType startIndex;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
unsigned long radius =3D 2;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
InputImageType::SizeType size;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
InputImageType::RegionType sampleRegion;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
double&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
m_ObjectMean;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
typedef itk::Matrix&lt;double,1,1&gt;&nbsp; =
MatrixType;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
double m_ObjectVariance;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
MatrixType m_ObjectMatrix;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
size.Fill( 2 * radius + 1 );</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
for( int j =3D 0; j &lt; 3; j ++ )</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;
startIndex[j] =3D seed[j] - radius;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sampleRegion.SetSize( size );</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sampleRegion.SetIndex( startIndex );</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
sampleRegion.Crop( =
this-&gt;viewVolume-&gt;GetInputImage()-&gt;GetBufferedRegion()
);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
// compute mean and variance</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
typedef itk::ImageRegionConstIterator&lt;InputImageType&gt; =
Iterator;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Iterator iter( this-&gt;viewVolume-&gt;GetInputImage(), sampleRegion =
);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
unsigned int counter =3D 0;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
double sum =3D 0;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
double sumsqr =3D 0;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
while (!iter.IsAtEnd())</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp; double
value =3D static_cast&lt;double&gt;( iter.Get() );</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;
sum +=3D value;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;
sumsqr +=3D value * value;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;
counter++;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;
++iter;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
m_ObjectMean =3D sum / static_cast&lt;double&gt;( counter =
);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
m_ObjectVariance =3D static_cast&lt;double&gt;( counter ) * m_ObjectMean =
* m_ObjectMean;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
m_ObjectVariance =3D ( sumsqr - m_ObjectVariance ) / =
static_cast&lt;double&gt;(
counter - 1 );</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
double m_Variance[1][1] =3D {{m_ObjectVariance}};</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
m_ObjectMatrix.GetVnlMatrix().set((const double =
*)m_Variance);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
typedef itk::ScalarToArrayCastImageFilter&lt; InputImageType, =
VectorImage&gt; ScalarImageFilter;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
ScalarImageFilter::Pointer ScalarImage =3D =
ScalarImageFilter::New();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
ScalarImage-&gt;SetInput(this-&gt;viewVolume-&gt;GetInputImage());</span>=
</font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
ScalarImage-&gt;Update();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;SetInput(ScalarImage-&gt;GetOutput());</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;SetNumberOfObjects(1);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;Initialization();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;SetObjectsSeed(seed,0);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;SetObjectsMean(m_ObjectMean,0);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;SetObjectsMatrix(m_ObjectMatrix,0);</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;
FuzzyFilter-&gt;Update();</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>Can
you tell me the reason why I cannot get the result?</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>In
your letter, you told me that I need not do any convertion, but if I do =
that,
the program shows me something wrong. Can you give me an example of what =
you
said?</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>&nbsp;</span></font></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>Thanks
a lot!!!</span></font></p>

</div>

<p class=3DMsoNormal><font size=3D1 color=3Dnavy face=3DArial><span =
lang=3DEN-US
style=3D'font-size:9.0pt;font-family:Arial;color:navy'>&nbsp;</span></fon=
t></p>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3D=CB=CE=CC=E5><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:=CB=CE=CC=E5'>-----=D3=CA=BC=FE=D4=AD=
=BC=FE-----<br>
<b><span style=3D'font-weight:bold'>=B7=A2=BC=FE=C8=CB:</span></b> Ying =
Zhuge
[mailto:zhuge at mipg.upenn.edu] <br>
<b><span style=3D'font-weight:bold'>=B7=A2=CB=CD=CA=B1=BC=E4:</span></b> =
2004=C4=EA4=D4=C22=C8=D5 0:17<br>
<b><span style=3D'font-weight:bold'>=CA=D5=BC=FE=C8=CB:</span></b> =
</span></font><font size=3D2
 face=3D=CB=CE=CC=E5><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:=CB=CE=CC=E5'>zhao</span></font><fo=
nt
size=3D2 face=3D=CB=CE=CC=E5><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:=CB=CE=CC=E5'> yong qiang<br>
<b><span style=3D'font-weight:bold'>=D6=F7=CC=E2:</span></b> Re: =
[Insight-users] How to
compute the parameters of =
VectorFuzzyConnectednessImageFilter?</span></font></p>

<p class=3DMsoNormal style=3D'margin-left:21.0pt'><font size=3D2
face=3D"Times New Roman"><span lang=3DEN-US =
style=3D'font-size:10.5pt'>&nbsp;</span></font></p>

<div>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>Hi,
Yongqiang,</span></font></p>

</div>

<div>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D3 face=3D=CB=CE=CC=E5><span lang=3DEN-US =
style=3D'font-size:12.0pt;font-family:=CB=CE=CC=E5'>&nbsp;</span></font><=
/p>

</div>

<div>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>In
the vector filter, I take the scalar as the special case of vector =
image. You
don't need do any convertion. For parameters setting&nbsp;you can only =
set the
mean vector and&nbsp;covariance matrix&nbsp;as&nbsp;scalar =
values.</span></font></p>

</div>

<div>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D3 face=3D=CB=CE=CC=E5><span lang=3DEN-US =
style=3D'font-size:12.0pt;font-family:=CB=CE=CC=E5'>&nbsp;</span></font><=
/p>

</div>

<div>

<p class=3DMsoNormal align=3Dleft =
style=3D'margin-left:21.0pt;text-align:left'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial'>Zhuge</span></font></p>

</div>

</div>

</body>

</html>

------=_NextPart_000_0001_01C418CA.A6891A80--