[vtkusers] Fwd: Creating a iso surface out of contours (inaccuracy)

Sam Raby rabysam28 at gmail.com
Fri May 23 00:13:22 EDT 2014


I figured the problem and resolved it as it follows:

As known, the X, Y and Z coordinates have to be integer values when input
to the vtkVoxelContoursToSurfaceFilter, and hence in the ContoursToSurface
example [1], the coordinates of the contours (i.e. circles) are all first
converted to IJK coordinate, and the surface in IJK coordinate is
re-constructed. Then the whole reconstructed surface is converted back to
the world coordinate system.

In the process of converting the reconstructed surface to the world
coordinate system, the surface is shifted from (0,0,0) to the center of the
contours, but the problem is that even though the center of the contours
and that of the surface are aligned but their external body do not
necessary match. In most of the time they match, however sometime they are
clearly do not match, like the picture attached.

To address this issue, I got the idea from another example [2] by adding a
post transformation to slightly move the reconstructed surface to match up
with the position of the original contours. One way to do this, is to
compare the farthest corner of the contours with the farthest corner of the
reconstructed surface by simply calling GetBounds, and transfer the surface
accordingly.

If useful, I can prepare an example to put in the vtk wiki.

-Sam

[1] http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface
[2]
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/SurfaceFromUnorganizedPointsWithPostProc

---------- Forwarded message ----------
From: Sam Raby <rabysam28 at gmail.com>
Date: Mon, May 12, 2014 at 2:26 PM
Subject: Fwd: Creating a iso surface out of contours (inaccuracy)
To: "vtkusers at vtk.org" <vtkusers at vtk.org>


What would be the best vtk class to create a 3D surface out of instances of
vtkContourWidget? I am using vtkVoxelContoursToSurfaceFilter [1], but about
50% of the times, the resulting surface does not match with the spatial
position of the original point set and is shifted slightly (image
attached).

vtkContourWidget is a popular class and I am sure there should be a
reliable way to cast a surface out of contours. Would you please advise me?


[1] http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface



---------- Forwarded message ----------
From: Sam Raby <rabysam28 at gmail.com>
Date: Fri, Apr 4, 2014 at 4:20 PM
Subject: Fwd: Creating a iso surface out of contours (inaccuracy)
To: "vtkusers at vtk.org" <vtkusers at vtk.org>


Let me rephrase my question:
I have, let's say, 5 manual contours. They are drawn manually on 5
consecutive slices, and I simply want to generate an iso surface from these
5 contours. I have done this using vtkVoxelContoursToSurfaceFilter class,
but I was wondering whether this is the right class to do this? The problem
is, as shown in the image attached, sometime I undergo some inaccuracy.
Thanks for the help.

-S

---------- Forwarded message ----------
From: Sam Raby <rabysam28 at gmail.com>
 Date: Thu, Mar 13, 2014 at 10:41 AM
Subject: Fwd: Creating a iso surface out of contours (inaccuracy)
To: "vtkusers at vtk.org" <vtkusers at vtk.org>


any idea about my email below, on why the iso surface somtimes does not
match with the contours? (like the image attached)

thanks

---------- Forwarded message ----------
From: Sam Raby <rabysam28 at gmail.com>
Date: Tue, Mar 11, 2014 at 11:13 PM
Subject: Creating a iso surface out of contours (inaccuracy)
To: "vtkusers at vtk.org" <vtkusers at vtk.org>


Hi,

I am using the following VTK example to create surface out of my contours:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface

The code seems to be working OK, but sometimes, not always, the generated
iso surface is off a little bit.

Every time that I render the iso surface I also render the original
contours next to the surface. Please see the image attached which shows
that the surface is not precisely representing the contours.

As shown in the figure, the generated surface which is in cyan is a bit off
compared to the black and white lines which are the contours.

When this type of inaccuracy takes place, I try to modify the contours and
then generate the surface again, and sometimes I see that the generated
surface will be magically corrected and become accurate.

Would you let me know what you think about this issue?

thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140522/10ab02ee/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2014-03-08 17_05_21.png
Type: image/png
Size: 92049 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140522/10ab02ee/attachment-0001.png>


More information about the vtkusers mailing list