[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> </DIV>
<DIV> 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 as input, for the =
same=20
seedpoint, threshold and radius as given to the volume, the =
output=20
for some slices ( 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> </DIV>
<DIV>Enclosing the code for verification,</DIV>
<DIV> </DIV>
<DIV>typedef =
itk::NeighborhoodConnectedImageFilter<ConverterType::ImageType,=20
ConverterType::ImageType> FilterType;</DIV>
<DIV> </DIV>
<DIV> //check threshold choices<BR> if (low <=3D 0) return=20
;<BR> if (high <=3D 0 || high <=3D low) low =3D =
255; </DIV>
<DIV> </DIV>
<DIV> FilterType::IndexType seed; <BR> seed[0] =3D =
seedPointX;=20
seed[1] =3D seedPointY; <BR><FONT=20
color=3D#008000> //seed[2]=3Dslicenumber;</FONT> <FONT =
color=3D#ff0000>//this is=20
set if volume is given</FONT>.</DIV>
<DIV> </DIV>
<DIV> FilterType::InputImageSizeType =
radius;<BR> FilterType::Pointer=20
filter =3D=20
FilterType::New();<BR> filter->SetInput(meanFilter->GetOutput(=
)); <BR> filter->SetSeed(seed);</DIV>
<DIV> </DIV>
<DIV> radius.Fill(1);<BR> filter->SetRadius(radius);<BR>&nbs=
p;filter->SetLower=20
(low);<BR> filter->SetUpper=20
(high);<BR> filter->SetReplaceValue(1);<BR> <BR> try<BR=
> {<BR> filter->Update();<BR> }<BR> catch=20
(itk::ExceptionObject&=20
e){<BR> AfxMessageBox(e.GetDescription());<BR> retu=
rn=20
;<BR> }<BR> </DIV>
<DIV> </DIV>
<DIV>Thanking you,</DIV>
<DIV> </DIV>
<DIV>Regards,<BR>Valli.<BR></FONT></DIV></BODY></HTML>
------=_NextPart_000_0066_01C314C6.3E86AF00--