[Insight-users] Behavior of itkTubeSpatialObject

Julien Jomier jjomier at cs.unc.edu
Wed, 28 Apr 2004 14:06:23 -0400


Hi Robert,

Thanks for the clear explanation of the problem.
I've checked in a fix for the ends of the tube that were rounded. The
IsInside() function in spatial objects was using spheres instead of
cylinders.

Regarding the "spikes", I think this is due to the FloodFillIterator
boundary condition used in the SpatialOjectToImageFilter. I tried to set =
the
radius to 4.9 instead of 5 and it removed the "spikes".

Also, you should be aware that the resolution of the resulting tube =
depends
on the resolution of your output image. You should try to set the size =
of
the image as the size of the bounding box of your tube.
(SpatialObjectToImageFilter should do that automatically if you don't
specify the size).

Let us know if that solves your problem,
Thanks for the report,

Julien

> -----Original Message-----
> From: insight-users-admin at itk.org=20
> [mailto:insight-users-admin at itk.org] On Behalf Of Robert Tamburo
> Sent: Wednesday, April 28, 2004 8:39 AM
> To: insight-users at itk.org
> Subject: [Insight-users] Behavior of itkTubeSpatialObject
>=20
>=20
> Hi all,
> I'm trying to create a test image consisting of a curved=20
> cylinder using itkTubeSpatialObject in conjunction with=20
> itkSpatialObjectToImageFilter. Are the geometric properties=20
> of a tube (the defining points have the same
> radius) similar to a cylinder?
>=20
> I ask because I've tried a few experiements and my tube isn't=20
> very circular (in cross-section). The results of my trials=20
> can be found  at  http://www.pitt.edu/~rjtst21/tubes.htm
>=20
> Trial 1:
> The first row of images shows a wireframe of the tube and a=20
> cross-section of the corresponding gray level image. The tube=20
> is flat and rectangular.
>=20
> Trial 2:
> I straightened out the tube and made it longer, but still got=20
> a "rectangular" tube. Since the radius was only 2, I thought=20
> the pixel resolution might be an issue. I compared it to a=20
> cylinder created with itkFiniteCylinderSpatialFunction.  As=20
> you can see in the second row of images (bottom) the cylinder=20
> is circular, so a radius of 2 is large enough to observe a circle.
>=20
> Trial 3:
> I increased the radius to 5 and put the tube in the x-y=20
> plane.  The tube formed "spikes" at each point. Also, the=20
> ends of the tube were rounded (are they supposed to be flat?).
>=20
> Is this consistent with how itkTubeSpatialObject should=20
> behave? Any info for creating more cylindrical looking tubes=20
> would be greatly appreciated.
>=20
> The code to generate the tube is below:
> -------------
> TubePointerType tube =3D TubeType::New();
> TubePointListType list;
>=20
> TubeType::TransformType::OffsetType offset;
> offset.Fill(15); // origin
> tube->GetObjectToParentTransform()->SetOffset(offset);
> tube->ComputeObjectToWorldTransform();
>=20
> // create list of points for the tube in x-y plane
> for(unsigned int i =3D 0; i < 10; i++)
>   {
>   TubePointType p;
>   p.SetPosition(i, i, 0);
>   p.SetRadius(5.0);
>   list.push_back(p);
>   }
>=20
> // set tube properties
> tube->GetProperty()->SetName("tube");
> tube->SetId(1);
> tube->SetPoints(list);
>=20
> // initialize filter
> typedef SpatialObjectToImageFilter<TubeType, ImageType>=20
> SpatialObjectToImageFilterType;=20
> SpatialObjectToImageFilterType::Pointer imageFilter =3D=20
> SpatialObjectToImageFilterType::New();
> imageFilter->SetInput(tube);
> imageFilter->SetInsideValue(255);
> imageFilter->SetOutsideValue(0);
> imageFilter->SetChildrenDepth(0);
>=20
> ImageType::SizeType imageSizeObject;=20
> imageSizeObject.SetSize(m_ImageSize);
> imageFilter->SetSize(imageSizeObject);
>=20
> imageFilter->Update();
>=20
> m_Image =3D imageFilter->GetOutput();
>=20
>=20
>=20
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org=20
> http://www.itk.org/mailman/listinfo/insight-> users
>=20