<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"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></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 <<a href="mailto:trash001@odu.edu">trash001@odu.edu</a>> wrote:<br>
> Hi all,<br>
><br>
> I am trying to extract surfaces from a MINC (.mnc) data file using<br>
> vtkMarchingCubes. The code I am using is based on the VTK wiki's Marching<br>
> cubes on a sphere example, and is as follows:<br>
><br>
> void marching_cubes() {<br>
> vtkMINCImageReader* minc = vtkMINCImageReader::New();<br>
> minc->SetFileName("/home/trash001/Desktop/AtlasGrey.mnc");<br>
><br>
> vtkVoxelModeller* voxelModeller = vtkVoxelModeller::New();<br>
><br>
> voxelModeller->SetSampleDimensions(197, 233, 189);<br>
> voxelModeller->SetModelBounds(-98, 99, -134, 99, -72, 117);<br>
> voxelModeller->SetScalarTypeToFloat();<br>
> voxelModeller->SetMaximumDistance(.01);<br>
> voxelModeller->SetInputConnection(minc->GetOutputPort());<br>
><br>
> vtkMarchingCubes* surface = vtkMarchingCubes::New();<br>
> surface->SetInputConnection(voxelModeller->GetOutputPort());<br>
> surface->ComputeNormalsOn();<br>
> surface->SetValue(0, 0.5);<br>
><br>
> vtkRenderer* renderer = vtkRenderer::New();<br>
> renderer->SetBackground(.1, .2, .3);<br>
><br>
> vtkRenderWindow* renderWindow = vtkRenderWindow::New();<br>
> renderWindow->AddRenderer(renderer);<br>
> vtkRenderWindowInteractor* interactor =<br>
> vtkRenderWindowInteractor::New();<br>
> interactor->SetRenderWindow(renderWindow);<br>
><br>
> vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();<br>
> mapper->SetInputConnection(surface->GetOutputPort());<br>
><br>
> vtkActor* actor = vtkActor::New();<br>
> actor->SetMapper(mapper);<br>
><br>
> renderer->AddActor(actor);<br>
><br>
> renderWindow->Render();<br>
> interactor->Start();<br>
> return;<br>
> }<br>
><br>
> When I run this code, I get a blank window. I suspect that the problem is<br>
> that I cannot provide the MINC data to vtkMarchingCubes in a suitable<br>
> format, but I could be wrong. Any help would be appreciated.<br>
><br>
> Thanks,<br>
> --<br>
> Tanweer Rashid<br>
> Graduate Teaching & Research Assistant<br>
> Department of Modeling, Simulation and Visualization Engineering<br>
> Old Dominion University<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <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:<br>
> <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>
><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>