Getting point coordinates from ContourFilter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting point coordinates from ContourFilter

Syed Amjad
Hi,

I'm new at using VTK. Most of my program development is in OpenGL windows.

I am trying to use vtkContourFilter in opengl. All I need is to display the data..

however, I cannot retrieve the coordinates from the contour object.

here's my code

    //-----Read in the data files-------------------------
    //for reading in pgm files and making a 3d volume
    vtkImageReader *volume=vtkImageReader::New();
    volume->SetDataOrigin(0,0,0);
    volume->SetDataExtent(0, DIM_X-1, 0, DIM_Y-1, 1,DIM_Z);
   
    volume->SetFilePrefix(fileName);
    volume->SetDataScalarTypeToUnsignedChar();
    volume->Update();
    volume->SetDataSpacing (1,1,1);
   
    //rotate the data 90 degrees about the x axis for contour rendering
    vtkTransform *trans=vtkTransform::New();
    trans->Translate(64,0,0);
    trans->RotateZ(90);
    volume->SetTransform(trans);
   
    vtkContourFilter *skinExtractor = vtkContourFilter::New();
    skinExtractor->SetInput((vtkDataSet *) volume->GetOutput());
    skinExtractor->SetValue(0, 1);

    vtkStripper *skinStripper=vtkStripper::New();
    skinStripper->SetInput(skinExtractor->GetOutput());
   
    vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
    skinNormals->SetInput(skinExtractor->GetOutput());
    skinNormals->SetFeatureAngle(60.0);
   
    vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();
    skinMapper->SetInput(skinNormals->GetOutput());
    skinMapper->ScalarVisibilityOff();


How do I get the coordinate information. I need ofcourse the Cells and their corresponding points so I can just render those polygons in opengl....


Thankyou

Majeed


_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers