[Insight-users] itkMesh and transferring point data

Luis Ibanez luis.ibanez at kitware.com
Wed May 10 08:58:09 EDT 2006


Hi Robert,

In order to identify if the problem is with your visualization code,
or with the actual data in the UnstructuredGrid, you should try saving
the VTK mesh into a .vtk file, and then open that file with ParaView.

If it doesn't show up the colors in ParaView, then you will know that
the problem is with the data structure. While if you see the colors
in ParaView, you will know that the problem is with your visualization
pipeline.

You can download ParaView's source code and binaries for multiple
platforms from


                http://www.paraview.org



    Regards,


      Luis



----------------------
Robert Tamburo wrote:
> 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
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users




More information about the Insight-users mailing list