It's not really a problem - just an artifact of the way things are done.
Corners are always rounded because a grid is set up such that the grid
vertices lie halfway between the required integer locations of the input
contours in X, and Y. (In Z the grid locations lie on integer planes). In
the first example, a 3x3x2 grid is created with X values at -0.5, 0.5,
and 1.5, Y values at -0.5, 0.5, and 1.5, and Z values at 0.0, and 1.0.
Distance from the input contours is then computed along the grid lines,
and propagated throughout the volume (L1 distance, not L2). The cube that
you see produced in the first example is actually 45 degrees off from the
input contours. This is the "rounding" that occurs at corners,
but since you have such a small grid there are only corners to it. In the
next example, your grid has increased in size, so you do actually have
sides to the cube, but the rounding is still significant. Try making the
edges go from 0 to 10, or even 0 to 100 (rather than 0 to 1 or 0 to 2 as
you have in your two examples) and you will see the rounding effect
decrease (the edges are still rounded, but the size of the rounding is
within the size of a voxel, so the smaller a voxel is in relation to the
cube, the less apparent the rounding will be).
This class was not intended to be used on such small input contours - it
was designed for the case where the contours were traced by hand on some
input slices with a resolution of maybe 100x100 or 256x256, or the
contours were created from some binary classification of the image. The
goal is to create a surface with the shape of maybe a kidney or a liver
where the input contours only indicate the approximate but not exact
location of the surface. This class cannot accurately preserve a
geometric object (the contours exactly define the surface) such as a
cube.
Lisa
At 05:30 PM 11/24/99 +0800, Lee Yen Hoe wrote:
Hi,
I am quite new to this class, I encounter a strange problem.
If I set two squares from coordinates
(0,0,0) (0,1,0) (1,1,0), (1,0,0)
(0,0,1) (0,1,1) (1,1,1), (1,0,1)
a cube comes out nicely.
But if I set it to 2
(0,0,0) (0,2,0) (2,2,0), (2,0,0)
(0,0,1) (0,2,1) (2,2,1), (2,0,1)
It appears to be a hexangon.
The code is similar to the example contoursToSurface.tcl, except that I
change
the "Create the data" part to just
set i 0
set width 2
set numberOfOutputPoints 4
polys InsertNextCell $numberOfOutputPoints
points InsertPoint $i 0 0 0
polys InsertCellPoint $i
incr i
points InsertPoint $i 0 $width 0
polys InsertCellPoint $i
incr i
points InsertPoint $i $width $width 0
polys InsertCellPoint $i
incr i
points InsertPoint $i $width 0 0
polys InsertCellPoint $i
incr i
polys InsertNextCell $numberOfOutputPoints
points InsertPoint $i 0 0 1
polys InsertCellPoint $i
incr i
points InsertPoint $i 0 $width 1
polys InsertCellPoint $i
incr i
points InsertPoint $i $width $width 1
polys InsertCellPoint $i
incr i
points InsertPoint $i $width 0 1
polys InsertCellPoint $i
incr i
[Image]
Hi,
I am quite new to this class, I encounter a strange problem.
If I set two squares from coordinates
(0,0,0) (0,1,0) (1,1,0), (1,0,0)
(0,0,1) (0,1,1) (1,1,1), (1,0,1)
a cube comes out nicely.
But if I set it to 2
(0,0,0) (0,2,0) (2,2,0), (2,0,0)
(0,0,1) (0,2,1) (2,2,1), (2,0,1)
It appears to be a hexangon.
The code is similar to the example contoursToSurface.tcl, except that I
change
the "Create the data" part to just
set i 0
set width 2
set numberOfOutputPoints 4
polys InsertNextCell $numberOfOutputPoints
points InsertPoint $i 0 0 0
polys InsertCellPoint $i
incr i
points InsertPoint $i 0 $width 0
polys InsertCellPoint $i
incr i
points InsertPoint $i $width $width 0
polys InsertCellPoint $i
incr i
points InsertPoint $i $width 0 0
polys InsertCellPoint $i
incr i
polys InsertNextCell $numberOfOutputPoints
points InsertPoint $i 0 0 1
polys InsertCellPoint $i
incr i
points InsertPoint $i 0 $width 1
polys InsertCellPoint $i
incr i
points InsertPoint $i $width $width 1
polys InsertCellPoint $i
incr i
points InsertPoint $i $width 0 1
polys InsertCellPoint $i
incr i
Embedded Content: a887cb.jpg: 00000001,0ee7155c,00000000,00000000