Hi all,
I programmatically compute fiber tract in micro-CT images. I have a set of streamlines, each described as two nodes (the coordinates of each node are known), along with their angle with centerline and calculated anisotropy. I want to convert this to .vtk format for visualization and further analysis purposes.
From my digging up until now. I figured out;
- I first need to create
vtk.PolyData()
object from the node coordinatespolydata_object.SetPoints(coordinates)
. One node is one point. - Then, for each line, I could do the following:
lines = vtkCellArray() lines.InsertNextCell(2) lines.InsertCellPoint(point_a) lines.InsertCellPoint(point_b) polydata_object.SetLines(lines)
I have a few questions:
- First of all, is my approach correct?
- When we use
.SetLines()
does it clear existing lines and add the new one or append to the existing lines? - How do I add the angle and anisotropy information of each line to the above PolyData object?
These might be dumb questions, but I am new to vtk.
Thank you in advance.