Hi,
I’m finding a way to generate 2D X-ray image from volume data, just like what DRR does.
Is there any extension which can do this?Or can I do it in a python way?
thanks
langderyos,
Hi,
I’m finding a way to generate 2D X-ray image from volume data, just like what DRR does.
Is there any extension which can do this?Or can I do it in a python way?
thanks
langderyos,
Probably the easiest way to get DRR-like images is to set up thick slice display using Python. For example, copy-paste this code snippets into the Python console to get started:
Maximum intensity projection:
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')
appLogic = slicer.app.applicationLogic()
sliceLogic = appLogic.GetSliceLogic(sliceNode)
sliceLayerLogic = sliceLogic.GetBackgroundLayer()
reslice = sliceLayerLogic.GetReslice()
reslice.SetSlabModeToMax()
reslice.SetSlabNumberOfSlices(600)
reslice.SetSlabSliceSpacingFraction(0.5)
sliceNode.Modified()
Result for CTChest example data set:
You could get more DRR-like image if you change slab mode to mean instead of max (reslice.SetSlabModeToMean()
), but usually it makes details more difficult to see.
Same data set with DRR-like mean slab mode:
See some more examples here.
For faster updates and display in 3D view, you can configure Volume rendering module to show a maximum intensity projection (MIP). For most realistic DRR rendering, you can try to use Plastimatch extension.
Hi, Andras
Thanks a lot for your reply! I tried it and find it very helpful for me.But in slicer 4.6.0, there is no content in plastimatch module.Perhaps it’s a problem about version.
thanks again
langderyos