<div dir="ltr">I figured the problem and resolved it as it follows:<div><br></div><div>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. </div>
<div><br></div><div>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. </div>
<div><br></div><div>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.</div>
<div><br></div><div>If useful, I can prepare an example to put in the vtk wiki.</div><div><br></div><div>-Sam</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:12.571428298950195px">[1] </span><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface" style="font-family:arial,sans-serif;font-size:12.571428298950195px" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface</a><br>
</div><div>[2] <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/SurfaceFromUnorganizedPointsWithPostProc" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Filtering/SurfaceFromUnorganizedPointsWithPostProc</a><br>
<br><div class="gmail_quote">
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Sam Raby</b> <span dir="ltr"><<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.com</a>></span><br>Date: Mon, May 12, 2014 at 2:26 PM<br>
Subject: Fwd: Creating a iso surface out of contours (inaccuracy)<br>To: "<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<br><br><div dir="ltr">
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 <font color="#000000" face="sans-serif"><span style="line-height:19.049999237060547px">does not match with the spatial position of the original point set and is shifted slightly (image attached). </span></font><div>
<br></div><div>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? <div><font color="#000000" face="sans-serif"><span style="line-height:19.049999237060547px"><br>
</span></font><div><div>[1] <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface</a><br><div><br></div><div><br>
<br><div class="gmail_quote"><div>
---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Sam Raby</b> <span dir="ltr"><<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.com</a>></span><br></div><div><div>
Date: Fri, Apr 4, 2014 at 4:20 PM<br>
Subject: Fwd: Creating a iso surface out of contours (inaccuracy)<br>To: "<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<br><br><div dir="ltr">
Let me rephrase my question:<div>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<span style="line-height:1.2em;font-size:10.399999618530273px"> </span>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.</div>
<span><font color="#888888">
<div><br></div><div>-S</div><br></font></span><div class="gmail_quote"><div>---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Sam Raby</b> <span dir="ltr"><<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.com</a>></span><br>
</div><div>
Date: Thu, Mar 13, 2014 at 10:41 AM<br>Subject: Fwd: Creating a iso surface out of contours (inaccuracy)<br>To: "<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
<br><br><div dir="ltr"><div>any idea about my email below, on why the iso surface somtimes does not match with the contours? (like the image attached)</div><div><br></div><div>thanks<br><br></div><div><div><div class="gmail_quote">
---------- Forwarded message ----------<br>
From: <b class="gmail_sendername">Sam Raby</b> <span dir="ltr"><<a href="mailto:rabysam28@gmail.com" target="_blank">rabysam28@gmail.com</a>></span><br>Date: Tue, Mar 11, 2014 at 11:13 PM<br>Subject: Creating a iso surface out of contours (inaccuracy)<br>
To: "<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br><br><br><div dir="ltr"><div class="gmail_quote"><div dir="ltr">
Hi,<div><br></div><div>
I am using the following VTK example to create surface out of my contours:</div><div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface</a><br>
</div><div><br></div><div>The code seems to be working OK, but sometimes, not always, the generated iso surface is off a little bit. <br></div><div><br></div><div>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.</div>
<div><br></div><div>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. </div>
<div><br></div><div>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. </div>
<div><br></div><div>Would you let me know what you think about this issue?</div><div><br></div><div>thanks</div><div><br></div><div><br></div></div>
</div><br></div>
</div><br></div></div></div>
</div></div><br></div>
</div></div></div><br></div></div></div></div></div></div>
</div><br></div></div>