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

Luis Ibanez luis . ibanez at kitware . com
Thu, 07 Aug 2003 12:54:20 -0400


Hi Bjorn,

Simple visualization of an ITK Mesh is done
with OpenGL in the application: "Morphogenesis"

http://www . itk . org/cgi-bin/cvsweb . cgi/InsightApplications/Morphogenesis/?cvsroot=Insight

You may want to take a look at the method

    void CellularAggregate::Draw(void) const

in CellularAggregate.cxx


Regards,


   Luis



--------------------------
Bjorn Hanch Sollie wrote:
> 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