[Insight-users] Object extraction using Neighbourhood connected filter

cspl affable at hd2 . dot . net . in
Wed, 7 May 2003 18:26:58 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_0066_01C314C6.3E86AF00
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Mr.Luis,

 We are working on itkNeighborhoodConnectedImageFilter. Our requirement =
is to separate brain from Skull for MRImages.i.e to extract largest =
connected region.
Our input dataset is of size 256X256X120. When we give entire volume to =
Filter it is extracting the object as expected. But, When we try to =
extract the largest object slice by slice as input, for the same =
seedpoint, threshold  and radius as given to the volume, the output for =
some slices ( about 6 - 10 slices in 120) is different when compared to =
that of the volume.=20

We are a bit confused about the behaviour. Could you please explain and =
suggest for better results.

Enclosing the code for verification,

typedef itk::NeighborhoodConnectedImageFilter<ConverterType::ImageType, =
ConverterType::ImageType> FilterType;

 //check threshold choices
 if (low <=3D 0) return ;
 if (high <=3D 0 || high <=3D low) low =3D 255;=20

 FilterType::IndexType seed;=20
 seed[0] =3D seedPointX; seed[1] =3D seedPointY;=20
 //seed[2]=3Dslicenumber; //this is set if volume is given.

 FilterType::InputImageSizeType radius;
 FilterType::Pointer filter =3D FilterType::New();
 filter->SetInput(meanFilter->GetOutput());=20
 filter->SetSeed(seed);

 radius.Fill(1);
 filter->SetRadius(radius);
 filter->SetLower (low);
 filter->SetUpper (high);
 filter->SetReplaceValue(1);
=20
 try
 {
  filter->Update();
 }
 catch (itk::ExceptionObject& e){
  AfxMessageBox(e.GetDescription());
  return ;
 }
 =20

Thanking you,

Regards,
Valli.


------=_NextPart_000_0066_01C314C6.3E86AF00
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear Mr.Luis,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;We are working on itkNeighborhoodConnectedImageFilter. Our=20
requirement is to separate brain from Skull for MRImages.i.e to extract =
largest=20
connected region.<BR>Our input dataset is of size 256X256X120. When we =
give=20
entire volume to Filter it is extracting the object as expected. But, =
When we=20
try to extract the largest object slice by slice&nbsp;as input, for the =
same=20
seedpoint, threshold&nbsp; and radius as given to the volume,&nbsp;the =
output=20
for some slices&nbsp;( about 6 - 10 slices in 120) is different when =
compared to=20
that of the volume. <BR></DIV>
<DIV>We are a bit confused about the behaviour. Could you please explain =
and=20
suggest for better results.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Enclosing the code for verification,</DIV>
<DIV>&nbsp;</DIV>
<DIV>typedef =
itk::NeighborhoodConnectedImageFilter&lt;ConverterType::ImageType,=20
ConverterType::ImageType&gt; FilterType;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;//check threshold choices<BR>&nbsp;if (low &lt;=3D 0) return=20
;<BR>&nbsp;if (high &lt;=3D 0 || high &lt;=3D low) low =3D =
255;&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;FilterType::IndexType seed;&nbsp;<BR>&nbsp;seed[0] =3D =
seedPointX;=20
seed[1] =3D seedPointY; <BR><FONT=20
color=3D#008000>&nbsp;//seed[2]=3Dslicenumber;</FONT> <FONT =
color=3D#ff0000>//this is=20
set if volume is given</FONT>.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;FilterType::InputImageSizeType =
radius;<BR>&nbsp;FilterType::Pointer=20
filter =3D=20
FilterType::New();<BR>&nbsp;filter-&gt;SetInput(meanFilter-&gt;GetOutput(=
));&nbsp;<BR>&nbsp;filter-&gt;SetSeed(seed);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;radius.Fill(1);<BR>&nbsp;filter-&gt;SetRadius(radius);<BR>&nbs=
p;filter-&gt;SetLower=20
(low);<BR>&nbsp;filter-&gt;SetUpper=20
(high);<BR>&nbsp;filter-&gt;SetReplaceValue(1);<BR>&nbsp;<BR>&nbsp;try<BR=
>&nbsp;{<BR>&nbsp;&nbsp;filter-&gt;Update();<BR>&nbsp;}<BR>&nbsp;catch=20
(itk::ExceptionObject&amp;=20
e){<BR>&nbsp;&nbsp;AfxMessageBox(e.GetDescription());<BR>&nbsp;&nbsp;retu=
rn=20
;<BR>&nbsp;}<BR>&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanking you,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Regards,<BR>Valli.<BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0066_01C314C6.3E86AF00--