<div dir="ltr">Hi Bill,<br><br>What is the advantage of using DiscreteMarchingMarchingCubes over MarchingCubes for binary masks?<br><br>Both seems to produce the same result.<br><br>Thanks<br><br>Jothy<br><br><div class="gmail_quote">
On Mon, Mar 12, 2012 at 5:55 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does the mind data have continuous grayscale values or are the values<br>
discrete (from a segmentation algorithm)?<br>
<br>
If they are continuous, pass the data directly to marching cubes (no<br>
voxelmodeller). You will need to select a proper isosurface value for<br>
the structure you want to see.<br>
<br>
If the data is discrete, use DiscreteMarchingCubes and pass in the<br>
value for the segmented structure you want so see.<br>
<div><div></div><div class="h5"><br>
On Mon, Mar 12, 2012 at 10:28 AM, Tanweer Rashid &lt;<a href="mailto:trash001@odu.edu">trash001@odu.edu</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; I am trying to extract surfaces from a MINC (.mnc) data file using<br>
&gt; vtkMarchingCubes. The code I am using is based on the VTK wiki&#39;s Marching<br>
&gt; cubes on a sphere example, and is as follows:<br>
&gt;<br>
&gt; void marching_cubes() {<br>
&gt;     vtkMINCImageReader* minc = vtkMINCImageReader::New();<br>
&gt;     minc-&gt;SetFileName(&quot;/home/trash001/Desktop/AtlasGrey.mnc&quot;);<br>
&gt;<br>
&gt;     vtkVoxelModeller* voxelModeller = vtkVoxelModeller::New();<br>
&gt;<br>
&gt;     voxelModeller-&gt;SetSampleDimensions(197, 233, 189);<br>
&gt;     voxelModeller-&gt;SetModelBounds(-98, 99, -134, 99, -72, 117);<br>
&gt;     voxelModeller-&gt;SetScalarTypeToFloat();<br>
&gt;     voxelModeller-&gt;SetMaximumDistance(.01);<br>
&gt;     voxelModeller-&gt;SetInputConnection(minc-&gt;GetOutputPort());<br>
&gt;<br>
&gt;     vtkMarchingCubes* surface = vtkMarchingCubes::New();<br>
&gt;     surface-&gt;SetInputConnection(voxelModeller-&gt;GetOutputPort());<br>
&gt;     surface-&gt;ComputeNormalsOn();<br>
&gt;     surface-&gt;SetValue(0, 0.5);<br>
&gt;<br>
&gt;     vtkRenderer* renderer = vtkRenderer::New();<br>
&gt;     renderer-&gt;SetBackground(.1, .2, .3);<br>
&gt;<br>
&gt;     vtkRenderWindow* renderWindow = vtkRenderWindow::New();<br>
&gt;     renderWindow-&gt;AddRenderer(renderer);<br>
&gt;     vtkRenderWindowInteractor* interactor =<br>
&gt; vtkRenderWindowInteractor::New();<br>
&gt;     interactor-&gt;SetRenderWindow(renderWindow);<br>
&gt;<br>
&gt;     vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();<br>
&gt;     mapper-&gt;SetInputConnection(surface-&gt;GetOutputPort());<br>
&gt;<br>
&gt;     vtkActor* actor = vtkActor::New();<br>
&gt;     actor-&gt;SetMapper(mapper);<br>
&gt;<br>
&gt;     renderer-&gt;AddActor(actor);<br>
&gt;<br>
&gt;     renderWindow-&gt;Render();<br>
&gt;     interactor-&gt;Start();<br>
&gt;     return;<br>
&gt; }<br>
&gt;<br>
&gt; When I run this code, I get a blank window. I suspect that the problem is<br>
&gt; that I cannot provide the MINC data to vtkMarchingCubes in a suitable<br>
&gt; format, but I could be wrong. Any help would be appreciated.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; --<br>
&gt; Tanweer Rashid<br>
&gt; Graduate Teaching &amp; Research Assistant<br>
&gt; Department of Modeling, Simulation and Visualization Engineering<br>
&gt; Old Dominion University<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the VTK FAQ at:<br>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>