[vtkusers] Getting point coordinates from ContourFilter

Syed Amjad majeed.amjad at gmail.com
Sat Jan 28 20:00:13 EST 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060128/10ca8c88/attachment.htm>


More information about the vtkusers mailing list