[vtkusers] Generating Mesh from Contour Data?
Ashika Umanga Umagiliya
aumanga at biggjapan.com
Mon Oct 4 05:38:00 EDT 2010
Greetings all,
I refered the post below on this topic ,
http://vtk.1045678.n5.nabble.com/Creating-a-3D-surface-mesh-from-a-stack-of-contours-td1245753.html
In the solution given below , I don't understand the variable
"input_image" (which i assume of type vtkImageData).
Is it the volume-data which is used to extract contours? Can't I
generate mesh only using contours without this image data?
vtkAppendPolyData * app = vtkAppendPolyData::New();
for (std::vector<vtkPolyData*>::iterator i = roi.contours.begin(); i !=
roi.contours.end(); i++)
app->AddInput(*i);
vtkPolyDataWriter* w=vtkPolyDataWriter::New();
vtkLinearExtrusionFilter * extrude=vtkLinearExtrusionFilter::New();
extrude->SetInput(app->GetOutput());
extrude->SetVector(0, 0, 3); //3 is the Z spacing between contours
extrude->CappingOn();
extrude->Update();
vtkPolyDataToImageStencil* sts=vtkPolyDataToImageStencil::New();
vtkImageStencil* stencil=vtkImageStencil::New();
sts->SetInput(extrude->GetOutput());
sts->SetInformationInput(input_image); /////****** What is this
input_image ?
sts->Update();
stencil->SetStencil(sts->GetOutput());
stencil->SetInput(input_image);
vtkSmartPointer<vtkMarchingCubes> marching =
vtkSmartPointer<vtkMarchingCubes>::New();
marching->SetInput(stencil->GetOutput());
marching->SetValue(0,0.5);
marching->Update();
**
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101004/dea8be9d/attachment.htm>
More information about the vtkusers
mailing list