[Insight-users] help needed in using neighbourhood class
cspl
affable at hd2 . dot . net . in
Tue, 23 Jul 2002 14:30:22 +0530
This is a multi-part message in MIME format.
------=_NextPart_000_0079_01C23255.7A017500
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dear Mr.Luise,
I am working on morphological operations on Images.I used the class =
"itk::BinaryDilateImageFilter .h".
I have created structuring element using the Neighbourhood class.
But,I got the output image as the input image with out any effect.I =
tested the application with both MRI and CT Scan Images.
I found many classes on neighbourhood.I could understand the each class =
but,what is sequence of using them in order to create required =
structuring element.
Here, I am enclosing code.
// code to dilate an image
itk::Size<2> size =3D {256, 256}; //used for setting radius
=20
typedef itk::NeighborhoodAllocator<PixelType> NAllocator;
NAllocator *nat=3Dnew NAllocator;
=20
typedef itk::Neighborhood<PixelType,(unsigned int)2,NAllocator> =
KernelType;
KernelType *NA=3Dnew KernelType;
//To set radius
NA->SetRadius(size);
unsigned short cv=3DNA->GetCenterValue();=20
=20
typedef =
itk::BinaryDilateImageFilter<ImageType,ImageType,KernelType> =
Morphology;
Morphology::Pointer GMF=3D Morphology::New();
=20
=20
GMF->SetInput(image);
=20
GMF->SetDilateValue(25000);
=20
ImageType::Pointer image1 =3D GMF->GetOutput();
//code to write a raw file
Regards,
CSPL
------=_NextPart_000_0079_01C23255.7A017500
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.Luise,<BR> I am working on =
morphological operations on Images.I used the class =20
"itk::BinaryDilateImageFilter .h".<BR>I have created structuring element =
using=20
the Neighbourhood class.<BR>But,I got the output image as the input =
image with=20
out any effect.I tested the application with both MRI and CT Scan =
Images.<BR>I=20
found many classes on neighbourhood.I could understand the each class =
but,what=20
is sequence of using them in order to create required structuring=20
element.<BR>Here, I am enclosing code.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>// code to dilate an =
image<BR>itk::Size<2>=20
size =3D {256, 256}; //used for setting =
radius<BR> <BR> =20
typedef itk::NeighborhoodAllocator<PixelType> =20
NAllocator;<BR> NAllocator *nat=3Dnew=20
NAllocator;<BR> <BR> typedef=20
itk::Neighborhood<PixelType,(unsigned int)2,NAllocator>=20
KernelType;<BR> KernelType *NA=3Dnew=20
KernelType;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> //To set =
radius</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> =20
NA->SetRadius(size);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> unsigned short=20
cv=3DNA->GetCenterValue(); </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> <BR> =20
typedef =
=20
itk::BinaryDilateImageFilter<ImageType,ImageType,KernelType> &=
nbsp; =20
Morphology;<BR> Morphology::Pointer GMF=3D=20
Morphology::New();<BR> =20
<BR> <BR> GMF->SetInput(image);<BR> <BR> GMF->S=
etDilateValue(25000);<BR> =20
<BR> ImageType::Pointer image1 =3D =
GMF->GetOutput();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> //code to write a raw =
file</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CSPL</FONT></DIV></BODY></HTML>
------=_NextPart_000_0079_01C23255.7A017500--