# Create DRR image from Chest CT scan

**URL:** <https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370>\
**Category:** Community\
**Created:** [October 23, 2018, 7:17pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370 "2018-10-23T19:17:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumedha\_singla](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sumedha\_singla](https://discourse.itk.org/u/sumedha_singla)\
**Post date:** [October 23, 2018, 7:17pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/1 "2018-10-23T19:17:08Z")

</div>

Hi everyone,

We are trying to convert 3D volumetric CT images to chest Xray (for a sake of comparison with another dataset). We use this example:

> <https://github.com/InsightSoftwareConsortium/ITKTwoProjectionRegistration/blob/master/test/GetDRRSiddonJacobsRayTracing.cxx>

The projection results in radiography-looking images but it is visually different from what we expected. Here is an example of what we get:

 ![image](https://discourse.itk.org/uploads/default/original/1X/c40ad93a9d70b4093ee7415b225ce8a2eb9f7ead.jpeg)

and example what we thought we can get:

 ![image](https://discourse.itk.org/uploads/default/original/1X/3d0259bc6fbaa13fa02e2beab52222bdcfe49a84.jpeg)

I think we are missing some transformation on intensity right before the projection and I don’t what should be. I searched for it and I found this paper:

> **[A method to produce and validate a digitally reconstructed radiograph-based...](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3473768/)**
>
> The purpose of this study was to develop and validate a computer model to produce realistic simulated computed radiography (CR) chest images using CT data sets of real patients.Anatomical noise, which is the limiting factor in determining pathology...

Is there any transformation on the intensity of 3D CT image that results in 2D projection looking more like chest Xray? Is there anything like that paper implemented in ITK?  
Also, if someone can provide some insight into how to use the available options with the GetDRRSiddonJacobsRayTracing method.

Thanks

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [October 23, 2018, 8:32pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/2 "2018-10-23T20:32:27Z")

</div>

Hello @sumedha_singla ! 👋

It looks like a good start.

The X-ray example looks to have more soft-tissue content from the shoulder, etc. So, beam path selection and interrogated volume selection may help.

Also, Siddon-Jacobs projection is also available in OpenRTK:

> **[SimonRit/RTK](https://github.com/SimonRit/RTK)**
>
> Reconstruction Toolkit. Contribute to SimonRit/RTK development by creating an account on GitHub.

which has more configuration options.

HTH,  
Matt

---

<div class="post-metadata">

**Author:** ![sumedha\_singla](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sumedha\_singla](https://discourse.itk.org/u/sumedha_singla)\
**Post date:** [October 24, 2018, 3:00am UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/3 "2018-10-24T03:00:22Z")

</div>

Hi Matt,  
Thank you for your prompt reply. You are the best. I will look into your suggestion and post any followup question.  
Best,  
Sumedha

---

<div class="post-metadata">

**Author:** ![sumedha\_singla](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sumedha\_singla](https://discourse.itk.org/u/sumedha_singla)\
**Post date:** [October 26, 2018, 4:19pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/4 "2018-10-26T16:19:15Z")

</div>

Hi,

Can you please elaborate on interrogated volume selection. Also, I have build OpenRTK. Can you please point me to the specific filter that provide this functionality. Meanwhile, I played around with the example in ITK filtering: “DigitallyReconstructedRadiograph1”. Its looks very similar to [InsightSoftwareConsortium/ITKTwoProjectionRegistration/blob/master/test/GetDRRSiddonJacobsRayTracing.cxx](https://github.com/InsightSoftwareConsortium/ITKTwoProjectionRegistration/blob/master/test/GetDRRSiddonJacobsRayTracing.cxx)  
But there is no option to choose projection angle. How can we provide projection angle in “DigitallyReconstructedRadiograph1” example?

Best,  
Sumedha

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [October 26, 2018, 6:06pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/5 "2018-10-26T18:06:22Z")

</div>

> [@sumedha\_singla](#):
>
> Can you please elaborate on interrogated volume selection.

That is, are the rays passing through the muscles in the shoulder, for example?

> [@sumedha\_singla](#):
>
> Also, I have build OpenRTK. Can you please point me to the specific filter that provide this functionality.

Look for examples that use `rtk::ForwardProjectionImageFilter`, e.g.

> <https://github.com/SimonRit/RTK/blob/b32cffdc6f9d7a432c50023c370ed996a7985b69/applications/rtkforwardprojections/rtkforwardprojections.cxx>

> [@sumedha\_singla](#):
>
> Meanwhile, I played around with the example in ITK filtering: “DigitallyReconstructedRadiograph1”.

RTK is recommended for the most flexibilty.

HTH,  
Matt

---

<div class="post-metadata">

**Author:** ![Gokce\_Guven](https://discourse.itk.org/user_avatar/discourse.itk.org/gokce_guven/32/1594_2.png) [@Gokce\_Guven](https://discourse.itk.org/u/Gokce_Guven)\
**Post date:** [June 29, 2020, 8:28am UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/6 "2020-06-29T08:28:08Z")

</div>

Hi, I am also trying to use DRR to create biplanar xrays from CT files. I don’t know c++, I want to use python. I spent hours to compile ITK modules, now trying to understand the examples, but I don’t have time for this for this week at least. Is it possible to use python without compiling ITK files? How can I do it?

Thanks in advance  
Gokce

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://discourse.itk.org/user_avatar/discourse.itk.org/jhlegarreta/32/476_2.png) [@jhlegarreta](https://discourse.itk.org/u/jhlegarreta)\
**Post date:** [June 29, 2020, 12:30pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/7 "2020-06-29T12:30:49Z")

</div>

@Gokce_Guven you can directly use the ITK Python package from the Python Package Index:

> **[itk](https://pypi.org/project/itk/)**
>
> ITK is an open-source toolkit for multidimensional image analysis

---

<div class="post-metadata">

**Author:** ![Gokce\_Guven](https://discourse.itk.org/user_avatar/discourse.itk.org/gokce_guven/32/1594_2.png) [@Gokce\_Guven](https://discourse.itk.org/u/Gokce_Guven)\
**Post date:** [June 29, 2020, 10:46pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/8 "2020-06-29T22:46:02Z")

</div>

@jhlegarreta Thanks a lot for your fast response, I will check it 🙂

Best  
Gokce

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [July 10, 2020, 9:12pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/9 "2020-07-10T21:12:59Z")

</div>

There is also the [`itk-rtk` Python package](http://www.openrtk.org/):

```auto
pip install itk-rtk

```

---

<div class="post-metadata">

**Author:** ![tzodge](https://discourse.itk.org/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@tzodge](https://discourse.itk.org/u/tzodge)\
**Post date:** [November 1, 2020, 2:07am UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/10 "2020-11-01T02:07:18Z")

</div>

@Gokce_Guven were you able to get DRR running with python?

Thanks,  
Tejas

---

<div class="post-metadata">

**Author:** ![Steve](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@Steve](https://discourse.itk.org/u/Steve)\
**Post date:** [September 22, 2021, 2:58am UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/12 "2021-09-22T02:58:28Z")

</div>

Hello @sumedha_singla @matt.mccormick  
I am quite new to ITK. Could you help to simply explain how to do the input of CT series (what i have a series of .dcm). ? Do I need to convert to other format for _itkImageFileReader_ ?

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [September 22, 2021, 1:51pm UTC](https://discourse.itk.org/t/create-drr-image-from-chest-ct-scan/1370/13 "2021-09-22T13:51:14Z")

</div>

Take a look at this [example](https://itk.org/ITKExamples/src/IO/GDCM/ReadDICOMSeriesAndWrite3DImage/Documentation.html) of how to convert a DICOM series into a single 3D image. Then you can use _itkImageFileReader_ on that single image. Otherwise you will have to use the DICOM series reading code if you don’t want to convert first.
