Re: VTK for visualizing 3D Networks

BennyS via vtkusers <[email protected]> Sat, 16 Mar 2019 08:20:43 -0700 (MST)
Newsgroups gmane.comp.lib.vtk.user
Message-ID <[email protected]>
I am not sure if I can edit my post here, so I am adding a second reply


I found a way to do it but I am struggling at converting scalar values to
RGB values for my tubes:
For the spheres I used

/
inputData = vtk.vtkPolyData()
inputData.SetPoints(nodePoints)
inputData.GetPointData().SetScalars(scalararray)
[...]
glyphPoints = vtk.vtkGlyph3D()
glyphPoints.SetInputData(inputData)
glyphPoints.SetSourceConnection(sphere.GetOutputPort())
glyphPoints.ClampingOff()
glyphPoints.SetColorModeToColorByScalar()
glyphPoints.SetScaleFactor(0.05)
/

and for the tubes I currently use:

/
edgeData.SetPoints(points) 
edgeData.SetLines(lines) 
edgeData.GetPointData().SetScalars(scalarvalues)
/

 

However, I am still struggling at converting my scalar tube values to an RGB
array which I can use for the mapper with the command 
/
profileMapper.SetScalarModeToUsePointFieldData() 
profileMapper.SelectColorArray("Colors")
/


I found the class vtkScalarsToColors which seems pretty useful in my case,
but I think I am too stupid to understand how it is working after crawling
through the class library and some posts/threads.

Can somebody support me at converting a scalar value to an RGB color for the
tubes?

Thanks!



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers