[vtkusers] help with rendering CT series into 3D graphic
Hp07
hinesh_88 at hotmail.co.uk
Thu Aug 11 04:27:00 EDT 2016
Hi all,
Any help or advise will help me a huge amount. I have been trying to render
a series of CT slices into a 3-D graphic, the window opens and the script
runs with no errors, however the image does not appear in the window.
Please see code below:
import vtk
filepath = r"/Users/hp/Desktop/CT_Slice/"
dcmrder = vtk.vtkDICOMImageReader()
dcmrder.SetDirectoryName(filepath)
dcmrder.Update()
renderer = vtk.vtkRenderer()
renderwindow = vtk.vtkRenderWindow()
renderwindow.AddRenderer(renderer)
rndrint = vtk.vtkRenderWindowInteractor()
rndrint.SetRenderWindow(renderwindow)
renderer.SetBackground(0,0,0)
renderwindow.SetSize(720,720)
mc = vtk.vtkMarchingCubes()
mc.SetInputConnection(dcmrder.GetOutputPort())
mc.Update()
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(mc.GetOutputPort())
actor = vtk.vtkActor()
actor.SetMapper(mapper)
renderer.AddActor(actor)
rndrint.Initialize()
rndrint.Start()
--
View this message in context: http://vtk.1045678.n5.nabble.com/help-with-rendering-CT-series-into-3D-graphic-tp5739661.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list