[vtk-developers] Re: [Fwd: Re: [vtkusers] Bug in vtkExtractVOI]
Charles Law
charles.law at kitware.com
Thu Apr 24 14:58:45 EDT 2003
Hello,
vtkExtractVOI is currently working properly (i.e. the bounds of the output
are correct).
This is a tricky filter because the extracted extent occurs before the sub
sampling and the input origin may not even lie on the output grid. It also
has to behave well when the output is requesting a subset of the outputs
whole extent. The mapping of extents (input to output and the inverse
output to input) is a real pain to compute. It may not be optimal when
subsample is > 1 in combination with an altered minimum extent, but it works.
It may be easier the set the output minimum extent to 0 always, but I
personally like keeping the origin of the output matching the input
origin. This filter currently has the output origin the same as input
origin when when spacing is 1 or the minimum extent does not change. The
solution I chose for the more complicated case is to keep the output
minimum extent the same as the voi minimum extent.
One could try to keep the output origin as close as possible to the input
origin given the grid constraint, but it would not be worth the effort. I
guarantee any changes you make will break the operation of the filter
(especially in data parallel pipelines), and some effort will be required
to fix it.
Charles Law (lawcc).
At 10:01 AM 4/24/2003 -0400, Berk Geveci wrote:
>-----Forwarded Message-----
>
> > From: Charl P. Botha <c.p.botha at its.tudelft.nl>
> > To: bryan cole <bryan.cole at teraview.co.uk>
> > Cc: VTK users list <vtkusers at public.kitware.com>, VTK Developers
> <vtk-developers at public.kitware.com>
> > Subject: Re: [vtkusers] Bug in vtkExtractVOI
> > Date: 23 Apr 2003 14:48:16 +0200
> >
> > 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/
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtk-developers
mailing list