[Insight-users] TubeSpatialObject in groups
Gavin Baker
gavinb+xtk at cs.mu.OZ.AU
Thu, 1 Jan 2004 16:45:37 +1100
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/EllipseSpatialObject.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