[vtkusers] BUG: vtkImageData::ComputeBounds() ... + solution
Ken Martin
ken.martin at kitware.com
Thu Jul 18 10:12:21 EDT 2002
> Hmm, interesting, all those concepts of what the bounds
> actualy are...
> I think one could say that each of the three options make
> sense, so a debate about which one is "correct" is not very usefull.
>
> Why don't we make the three options available to the
> programmer's preference?
> I imagine something like this:
>
> add a enum variable to the class vtkImageData named
> "BoundsComputationMethod" which can have three values
> "BetweenExtents" "BetweenHalfShiftedVoxels" and
> "BetweenExentsPlusOne".
>
> then add a switch statement to the
> vtkImageData::ComputeBounds() function, and handle it
> according to the BoundsComputationMethod variable.
>
> If the BoundsComputationMethod can also be set globally,
> much like is doen now in for example
> vtkMapper::SetGlobalImmediateModeRendering(int val) , then
> the programmer could set his/her choice at the
> beginning of the program.
> If the default is "BetweenExtents", then nobody would
> notice any difference when they upgrade, except that there
> are two new possible ways to compute the bounds.
>
> Would this be a good idea? Not too much work, I would think?
It would need to be done for much more than just compute bounds.
Probably half of the methods in vtkImageData would have to be
reworked. GetCell, GetNumberOfCells, etc. And as I mentioned the
rendering of images would also have to take this into account,
vtkImageActor would need to be modified. Volume rendering would also
require changes to handle this. It is certainly not something that
could be done correctly without a few weeks of work. But, it could be
done.
Ken
More information about the vtkusers
mailing list