# Generate 2D X-ray image from volume, just like DRR...update?

**URL:** <https://discourse.slicer.org/t/generate-2d-x-ray-image-from-volume-just-like-drr-update/17626>\
**Category:** Development\
**Created:** [May 14, 2021, 9:07pm UTC](https://discourse.slicer.org/t/generate-2d-x-ray-image-from-volume-just-like-drr-update/17626 "2021-05-14T21:07:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jumbojing](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jumbojing/32/10811_2.png) [@jumbojing](https://discourse.slicer.org/u/jumbojing)\
**Post date:** [May 14, 2021, 9:07pm UTC](https://discourse.slicer.org/t/generate-2d-x-ray-image-from-volume-just-like-drr-update/17626/1 "2021-05-14T21:07:35Z")

</div>

生成X线片就像DRR, 有没有更好的办法呢?  
我查了相关的讨论,更喜欢volume rendering的渲染方式,怎么通过python实现呢?

> jumbojing  
> 1m  
> Generating X-rays is like DRR, is there a better way?  
> I checked the related discussions, and I prefer the rendering method of volume rendering, how to achieve it through python?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/8/c8ae9a294531a4804b85192d70dbe46d1c287e61.jpeg)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 16, 2021, 12:42am UTC](https://discourse.slicer.org/t/generate-2d-x-ray-image-from-volume-just-like-drr-update/17626/3 "2021-05-16T00:42:23Z")

</div>

You can use the X-ray volume rendering preset. All necessary Python code snippets are listed in the [Slicer Script Repository](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html).
