[vtkusers] actor render order question

hchen hjchen.work at gmail.com
Mon Oct 3 12:03:47 EDT 2016


Hi,

I have a problem that I suspect has something to do with actor render order.
I am wondering if anyone can help me with.

What I am trying to do is to display three layers, CT in the bottom, then RT
dose on top of CT, and lastly, isodose contour on the very top.

The code to achieve this is in python, and looks like the following. The
problem is that, when I scroll through slices, on most slices, everything
looks like they supposed to be, but on some slices, the iso-dose contour is
missing, especially when I changed from axial to sagittal or coronal view.
It seems that that, for the slices where the iso-dose contour are missing,
the iso-dose contour is sent to bottom layer, because if I don't add actorCT
and actorDose into the render (i.e. only render iso-dose contour), I see
iso-dose contour all the time. Any suggestions on how to get this right is
welcome. Thanks in advance.

mapperCT = vtk.vtkImageResliceMapper()
mapperCT.SetInputData( readerCT.GetOutput() )
mapperCT.SliceFaceCameraOn()
mapperCT.SliceAtFocalPointOn()
ipCT = vtk.vtkImageProperty()
ipCT.SetColorLevle( CT_Level )
ipCT.SetColorWindow( CT_Window )
actorCT = vtk.vtiImageSlice()
actorCT.SetMapper( mapperCT )
actorCT.SetProperty( ipCT )

mapperDose = vtk.vtkImageReslieceMapper()
mapperDose.SetInputData( readerDose.GetOutput() )
mapperDose.SliceFaceCameraOn()
mapperDose.SliceAtFocalPointOn()
lutDose = vtk.vtkLookupTable()
...set range, hue, saturation etc
lutDose.SetAlphaRange(0, 1.0)
lutDose.Build()
ipDose = vtk.vtkImageProperty()
ipDose.SetLookupTable( lutDose )
actorDose = vtk.vtkImageSlice()
actorDose.SetMapper( mapperDose )
actorDose.SetProperty( ipDose )

contour = vtk.vtkMarchingSquares()
contour.SetInputConnection( readerDose.GetOutputPort() )
contour.SetImageRange( ext[0], ext[1], ext[2], ext[3], current_slice,
current_slice)
mapperContour = vtk.vtkPolyDataMapper()
mapperContour.SetInputConnection( contour.GetOutputPort() )
actor = vtk.vtkActor()
actor.SetMapper( mapperContour )

render = vtk.vtkRender()
render.AddActor( actorCT )
render.AddActor( actorDose )
render.AddActor( actorContour )



--
View this message in context: http://vtk.1045678.n5.nabble.com/actor-render-order-question-tp5740633.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list