[Insight-users] How to render ITK mesh in OpenGL-based environment?

Bjorn Hanch Sollie bhs at pvv . org
Thu, 7 Aug 2003 18:30:58 +0200 (CEST)


Hi all,

I'm using the BinaryMask3DMeshSource in ITK to create a mesh from a
segmented image.  The code is basically like this:

  typedef itk::Mesh<double> MeshType;
  typedef itk::BinaryMask3DMeshSource<MeshType> MeshSourceType;

  MeshSourceType::Pointer meshSource = MeshSourceType::New();
  meshSource->SetObjectValue(objectValue);
  meshSource->SetBinaryImage(segmentedImage);
  meshSource->Update();
  return meshSource->GetOutput();

My problem is that I need to render/visualize this mesh in an
OpenGL-based environment, and so my question is: How do I convert this
ITK mesh into something that is suited to be rendered in such an
environment?  How do I use the data output by this filter to construct
a geometric object for this purpose?  I suppose some example code
would be the best thing, but all comments and suggestions are welcome,
of course!

Thanks in advance,

-Beorn
-- 
Truth is often just a widely held opinion.