Generate 2D X-ray image from volume, just like DRR

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:

image_00036

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:

image_00035

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.

1 Like

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