[vtkusers] Use marching cubes on MINC data

Bill Lorensen bill.lorensen at gmail.com
Mon Mar 12 15:01:22 EDT 2012


DiscreteMarchingCubes will properly handle multiple discrete values.
For example, adjacent segmented structures will remain in contact. To
use MarchingCubes with discrete data you need extract the desired
segmented structure and then run MarchingCubes.

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



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the vtkusers mailing list