[Insight-users] TubeSpatialObject in groups

Julien Jomier jjomier at cs.unc.edu
Thu, 8 Jan 2004 14:29:26 -0500


Hi Gavin,

I've reproduced the problem you mentioned. I just put a fix in the cvs
repository. The problem was the depth used for the computation of the
bounding box.
By default the computation was done on the object itself and not its
children because the internal variable m_BoundingBoxChildrenDepth was set to
zero by default. I modified the initialization of this ivar to be
MaximumDepth, therefore the computation of the bounding box is now done on
the entire tree.

Thanks for the bug report,
Let us know if you find further problems,

Julien

----- Original Message ----- 
From: "Gavin Baker" <gavinb+xtk at cs.mu.OZ.AU>
To: <insight-users at itk.org>
Sent: Thursday, January 01, 2004 12:45 AM
Subject: [Insight-users] TubeSpatialObject in groups


>
> Hi all,
>
> Happy New Year...!
>
> I have been using the spatial objects classes to generate test data (with
> great success), and came across some unexpected behaviour.
>
> I create a TubeSpatialObject, and if I plug it straight into the
> SpatialObjectToImageFilter it is rendered into the volume just fine.
>
> If I create a group and add the tubes to the group, it doesn't work
> (ie. nothing comes out in the volume) until I explicitly call
> ComputeBoundingBox() on the tubes.
>
> If I create a group and add some ellipses in the same manner, it works
fine
> _without_ calling ComputeBoundingBox().  (I haven't changed the child
depth
> for the BB calculation.)
>
> I'm not sure if this is an actual bug or not, but I would expect them to
> behave the same.  There doesn't appear to be much difference in the
> implementation of the ellipse and tube.  Is it necessary to call
> ComputeBoundingBox() manually for each object?  If so, I would suggest a
> small addition to the manual to this effect:
>
> --- 
/debian/build/ITK/insighttoolkit-1.4.0/Examples/SpatialObjects/EllipseSpatia
lObject.cxx     2003-09-11 00:30:00.000000000 +1000
> +++ /tmp/EllipseSpatialObject.cxx       2004-01-01 16:35:31.000000000
+1100
>  at  at  -141,7 +141,10  at  at 
>  //
>  // Like other spatial objects, we can also query the bounding box of the
>  // object by using \code{GetBoundingBox()}. The resulting bounding box is
> -// expressed in the local frame.
> +// expressed in the local frame.  Before adding a spatial object to a
group,
> +// the bounding box should be recalculated by calling
> +// \code{ComputeBoundingBox()} to ensure the parent object has the
correctly
> +// sized bounding box.
>  //
>  // Software Guide : EndLatex
>
>
> Thanks - best regards to all,
>
>   :: Gavin
>
> -- 
> Gavin Baker                                      Complex Systems Group
> http://www.cs.mu.oz.au/~gavinb             The University of Melbourne
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>