MantisBT - VTK
View Issue Details
0004212VTK(No Category)public2006-12-15 07:532016-08-12 09:54
Michael Knopke 
Will Schroeder 
normalmajoralways
closedmoved 
 
 
0004212: vtkImageMarchingCubes produces division by zero errors
when using this class to create isosurfaces from volume data the class will produce "division by zero" errors on certain threshold values (e.g. 1068). This also seems to be related to the used dataset, since this only happens with some datasets. However using vtkMarchingCubes does not produce those errors when used with the same datasets and pipeline. (datasets are unsigned char arrays)
No tags attached.
Issue History
2008-05-16 07:25Andy TurnerNote Added: 0011958
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2016-08-12 09:54Kitware RobotNote Added: 0036897
2016-08-12 09:54Kitware RobotStatusexpired => closed
2016-08-12 09:54Kitware RobotResolutionopen => moved

Notes
(0011958)
Andy Turner   
2008-05-16 07:25   
Hi, I came across this issue today in the guise of NaNs in the normal data. I came up with this quick fix (on the CVS version):-

diff -r1.1 vtkImageMarchingCubes.cxx
479,482c479,486
< temp = -1.0 / sqrt(g[0]*g[0] + g[1]*g[1] + g[2]*g[2]);
< g[0] *= temp;
< g[1] *= temp;
< g[2] *= temp;
---
> temp = sqrt(g[0]*g[0] + g[1]*g[1] + g[2]*g[2]);
> if ( temp != 0 )
> {
> temp = -1.0 / temp;
> g[0] *= temp;
> g[1] *= temp;
> g[2] *= temp;
> }

I wonder whether it would in fact be better to do this with vtkMath::normalize?
(0036897)
Kitware Robot   
2016-08-12 09:54   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page.