[vtkusers] VTK for visualizing 3D Networks

BennyS spiess.benjamin at yahoo.de
Sat Mar 16 11:20:43 EDT 2019


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


More information about the vtkusers mailing list