View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010674VTK(No Category)public2010-05-04 20:402016-08-12 09:55
ReporterAndrew Top 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0010674: vtkVoxelContoursToSurfaceFilter is generating meshes with holes in them
DescriptionI am generating a mesh out of a series of parallel contours through the use of the vtkVoxelContoursToSurfaceFilter filter, but the resulting surface has holes in it sometimes. The attached image demonstrates the problem, it is a hollow box with an open top, but you can see the surface is missing from the top edges of the box, despite the fact that the contours are there.

The holes occur only where the surface is parallel to the xz or yz plane. It occurs only at the maximum extent of the surface.

I've done some investigating and I believe I know the exact problem and how to solve it... But I am not a VTK developer.

At the beginning of vtkVoxelContoursToSurfaceFilter::RequestData(), gridOrigin and gridSize are calculated. In the calculations for gridSize[0] and gridSize[1], it seems the intent is for there to be one buffer pixel before the actual data origin, and one buffer pixel after the actual data extent. This is not always the case though:

If the decimal part of (contourBounds[1] - contourBounds[0]) is greater than 0.5, then gridSize[0] will not be large enough because the integer cast floors the result.

Suppose contourBounds[0] = 0 and contourBounds[1] = 40.8, then we will have gridOrigin[0] = -0.5 and gridSize[0] = (int)(40.8 - 0 + 2) = (int)(42.8) = 42. Now, if there are 42 pixels along the x axis, and the first one is the origin, -0.5, then the last one will be -0.5 + 41 = 40.5, which is less than 40.8, the true maximum.

The solution here, I believe, would be to change

  gridSize[0] = (int) (contourBounds[1] - contourBounds[0] + 2);
  gridSize[1] = (int) (contourBounds[3] - contourBounds[2] + 2);

to

  gridSize[0] = (int) (contourBounds[1] - contourBounds[0] + 2.5);
  gridSize[1] = (int) (contourBounds[3] - contourBounds[2] + 2.5);



This is my first bug report, let me know if I can be of more assistance.
TagsNo tags attached.
Project
Type
Attached Filespng file icon holes.PNG [^] (59,371 bytes) 2010-05-04 20:40

 Relationships

  Notes
(0037171)
Kitware Robot (administrator)
2016-08-12 09:55

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.

 Issue History
Date Modified Username Field Change
2010-05-04 20:40 Andrew Top New Issue
2010-05-04 20:40 Andrew Top File Added: holes.PNG
2011-06-16 13:11 Zack Galbreath Category => (No Category)
2016-08-12 09:55 Kitware Robot Note Added: 0037171
2016-08-12 09:55 Kitware Robot Status expired => closed
2016-08-12 09:55 Kitware Robot Resolution open => moved
2016-08-12 09:55 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team