[vtkusers] Need Help: Serious Bug in vtkVolumeRayCastMapper.cxx
Lisa S. Avila
lisa.avila at kitware.com
Tue Nov 20 18:40:47 EST 2001
Hello,
Yes, those lines of code are wrong - and similar ones do exist in VTK 4.0.
I will check in a fix in the next day or two. Essentially, the comparison
should be on the absolute value while the division is not.
I will check in a fix on the VTK 4.0 tree - you'll need to fix it by hand
on your VTK 3.2 build.
Thanks for digging in and finding the problem!
Lisa
At 02:49 AM 11/19/2001, burkhardt.dorn at berlin.de wrote:
>Hello,
>The following vtk3.2 code contains >= comparisions causing zero-division
>errors when two volumeRayDirection[i] are negative and the third is 0. We
>had this problem on WindowsNT-systems with a CompositeRayCastMapper on a
>volume in Fence-Mode, where the xmax=xmin+1 and the same for ymax and
>zmax. The limits where inside the volume. When rotating the volume with
>the mouse, the application crashed constantly...
>
>/*=========================================================================
>
> Program: Visualization Toolkit
> Module: $RCSfile: vtkVolumeRayCastMapper.cxx,v $
> Language: C++
> Date: $Date: 2000/12/10 20:08:59 $
> Version: $Revision: 1.59 $
>
>
>Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen
>All rights reserved.
>
>Redistribution and use in source and binary forms, with or without
>modification, are permitted provided that the following conditions are met:
>
> * Redistributions of source code must retain the above copyright notice,
> this list of conditions and the following disclaimer.
>
> * Redistributions in binary form must reproduce the above copyright notice,
> this list of conditions and the following disclaimer in the documentation
> and/or other materials provided with the distribution.
>
> * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
> of any contributors may be used to endorse or promote products derived
> from this software without specific prior written permission.
>
> * Modified source versions must be plainly marked as such, and must not be
> misrepresented as being the original software.
>
>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
>AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
>IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
>ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
>ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
>DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
>SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
>CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
>OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
>OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>
>=========================================================================*/
>void vtkVolumeRayCastMapper::CastViewRay( VTKRayCastRayInfo *rayInfo,
> VTKRayCastVolumeInfo *volumeInfo )
>{
> Some lines....
>
> for ( i = 0; i < 3; i++ )
> {
> if ( volumeRayDirection[i] >= volumeRayDirection[(i+1)%3]
> && // critical code
> volumeRayDirection[i] >= volumeRayDirection[(i+2)%3] )
> // critical code
> {
> distanceArray[arrayCount] =
> (volumeRayStart[i] -
> savedRayStart[i]) / volumeRayDirection[i];
> break;
> }
> }
>
> Some lines
>}
>
>It seems to us that this function is anyhow wrong. We would have expected
>the comparision of absolute values to get the maximum, but in this case it
>is not quite clear whether one should divide (volumeRayStart[i] -
>savedRayStart[i]) by volumeRayDirection[i] or by its absolute value.
>
>Could you please tell us as soon as possible whether this a known bug and
>whether it is fixed or will be fixed? We have serious trouble about that
>and have vital interest in its solution.
>
>Thank you very much...
>Dipl.-Math. Burkhardt Dorn
>Software Department
>Soft Imaging System Münster
>Germany
>mailto::bd at soft-imaging.de
>
>--
>berlin.de - meine stadt im netz. Jetzt eigene eMail-adresse @berlin.de
>sichern!
>http://www.berlin.de/home/MeineStadt/Anmeldung
>
>_______________________________________________
>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 vtkusers
mailing list