[Insight-users] itkMesh and transferring point data

Robert Tamburo robert.tamburo at gmail.com
Mon May 8 13:25:52 EDT 2006


Hi all,

I'm attempting to visualize, with color, an itkMesh in VTK. I want the point data associated with each point in the mesh to dictate a color at that point. What seems to be happening is the point data is not present in the vtkUnstructuredGrid after conversion from an itkMesh.

My code goes something like this:
1. Convert a binary image to a mesh with itkBinaryMask3DMeshSource
2. Iterate through the mesh points and create point data
3. Set the point data in the mesh <--- values are verified by iterating through them afterward
4. Convert the itkMesh to a vtkUnstructuredGrid (using itk2vtk example)
5. Set the grid as input to a vtkMapper
6. Set ScalarVisibilityOn() and SetScalarModeToUsePointData() for the mapper
7. Set the scalar range for the mapper <-- printing the scalar range here yields (0, 1) =(
8. Add the mapper as input to a vtkActor and render <-- white surface =(

Any ideas why the point data isn't transferring to the vtkUnstructuredGrid? Or is it not supposed to? Am I doing something unintended? 

This is more of a VTK question, but is there a way to directly set the point data in a vtkUnstructuredGrid? I couldn't seem to find the functionality to do so.

Thanks for any help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20060508/06e93c68/attachment.htm


More information about the Insight-users mailing list