[Insight-users] Visualizing mesh in OpenGL

Catherine Peloquin cepeloquin at gmail.com
Thu Jun 21 12:07:16 EDT 2007


Hello all,

I am trying to visualize the mesh produced by the BinaryMask3dMeshSource in
OpenGL.  I ran the filter, retrieved the mesh points by using a point
iterator, then saved the points to a text file.  The iterator is as follows:

  MeshType::ConstPointer mesh = meshSource->GetOutput();
  PointsContainer::ConstPointer points = mesh->GetPoints();

  PointsConstIterator itr = points->Begin();
  PointsConstIterator end = points->End();
       while( itr != end )
        {
        PointType point = itr.Value();
        double x = point[0];
            a_file << x<<" ";
        double y = point[1];
            a_file << y<<" ";
        double z = point[2];
            a_file << z<<endl;
            count++;
    ++itr;
        }

I then open the text file and use GL_POINTS to draw a the points.  I
visualized the mesh like this as an easy way to visualize and will later
determine the connectivity of the points and draw the surface line in
Morphogenesis in Insight Applications.

My problem is that the mesh does not look anything like I expect it to.  It
looks very noisy and I cannot make out the features I am looking for.  I am
running the filter for bone right now, and have tried HU of 380, 500, and
1000.

Does anyone have any recommendations?

Thank you,
Catherine Peloquin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070621/492da83e/attachment.html


More information about the Insight-users mailing list