[vtkusers] vtkContourGrid problems
Aaron Cois
aaron_vtk at yahoo.com
Mon Jun 19 15:24:42 EDT 2006
I'm trying to use a vtkContourGrid to calculate the contour of a vtkUnstructuredGrid for surface visualization. I have been able to visualize my grid as a point cloud using a standard mapper/actor setup, so I know there is correct data in the grid. However, when I try to pass it into my vtkContourGrid, I get an error indicating that there is "No data to contour". My code basically looks like this:
vtkPoints *points = vtkPoints::New(); points->Allocate(m_InSegmentImage->GetRequestedRegion().GetSize()[0]*m_InSegmentImage->GetRequestedRegion().GetSize()[1]*m_InSegmentImage->GetRequestedRegion().GetSize()[2]);
vtkUnstructuredGrid * grid = vtkUnstructuredGrid::New();
// ** Loop to insert points into vtkPoints
{
points->InsertNextPoint(it.GetIndex()[0],it.GetIndex()[1],it.GetIndex()[2]);
}
grid->SetPoints(points);
unsigned int isoLevel = 64;
vtkContourGrid * contour;
vtkSmoothPolyDataFilter * smoother;
vtkPolyDataNormals * norms;
vtkStripper * strip;
vtkPolyDataMapper * contourMapper;
contour = vtkContourGrid::New();
contour->SetInput(grid);
contour->SetValue(0, isoLevel);
contour->Update();
...
I've searched the archives and found one instance of this exact question being asked, but no responses to it. Can anyone help?
Aaron
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060619/55458943/attachment.htm>
More information about the vtkusers
mailing list