[vtk-developers] Re: [vtkusers] Bug in vtkExtractVOI

Charl P. Botha c.p.botha at its.tudelft.nl
Wed Apr 23 08:48:16 EDT 2003


On Wed, 2003-04-23 at 14:06, bryan cole wrote:
> The attached python script illustrates the problem: On running the
> script, the Bounds and Origin of the output of vtkExtractVOI() are
> printed. The dataset origin should coincide with the lower values of the
> dataset bounds. With VTK-4.2.2, the Origin is clearly incorrect (looks
> like a sign-problem). Running the script on VTK-4.1 gives the expected,
> correct result.
> 
> Can someone else verify this effect. What's the procedure for
> bug-reporting?

This is IMHO the best way of reporting strange behaviour: with a small
out-of-the-box runnable Python or Tcl script.  In anycase, I had a look
at current VTK CVS and line 204 in vtkExtractVOI seems dubious:
    
203 outAR[i] = ar[i] * this->SampleRate[i];
204 outOrigin[i] = origin[i] + voi[2*i]*ar[i] - outExt[2*i]*outAR[i];
205 outSize *= outDims[i];

It's of course the outOrigin[i] calculation I'm referring to.  The
problem is also that there's no clear definition of the output origin. 
Should the origin be at the "lower" corner of the output bounds, or
should the origin remain exactly where it is?

Personally I would vote for the output origin to remain in exactly the
same spot.  This would allow one to position VOIs correctly inside of
their super-volumes, which is a highly desirable characteristic.  Think
for example of extracting an iso-surface from a VOI and then wanting to
use this extracted isosurface in the containing volume.  This will break
if the vtkExtractVOI moves the origin.

I would like to change line 204 to:
outOrigin[i] = origin[i]
along with a fat comment explaining the reasoning behind that.

Thoughts?

Thanks,
Charl

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtk-developers mailing list