# Can't get right DRR

**URL:** https://discourse.itk.org/t/cant-get-right-drr/6007
**Category:** Algorithms
**Tags:** drr
**Created:** [June 21, 2023, 3:37pm UTC](https://discourse.itk.org/t/cant-get-right-drr/6007 "2023-06-21T15:37:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![suzume](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@suzume](https://discourse.itk.org/u/suzume)
#### Post date: [June 21, 2023, 3:37pm UTC](https://discourse.itk.org/t/cant-get-right-drr/6007/1 "2023-06-21T15:37:06Z")

</div>

Hi, I was using GetDRRSiddonJacobsRayTracing.cxx to generate DRR images. However I can’t generate the right DRR images as the images generated by the author.  
The parameters are set as the author proposed, which are -rp 0 -rx -3 -ry 4 -rz 2 -t 5 5 5 -iso 99.62 101.18 65 -res 1 1 -size 256 256. Here is the DRR image I got:  
[boxheadDRRDev1\_G0.tif](https://discourse.itk.org/uploads/short-url/eogyxlqUmZcQKD8eY4QJkTpgBNE.tif) (64.2 KB)  
The DRR image generated by the author is:  
[boxheadDRRDev1\_G0-Author.tif](https://discourse.itk.org/uploads/short-url/2nTPwlXFvHzMndwnz6lLtbwmE4Y.tif) (64.3 KB)  
I have try many times and I don’t know how to generate the right DRR image as the author. Are there some other parameters in the code should I set, such as the origin of the 2D Image? Is there someone can help me?

---

<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: [June 21, 2023, 3:59pm UTC](https://discourse.itk.org/t/cant-get-right-drr/6007/2 "2023-06-21T15:59:14Z")

</div>

@eewujian are you the author of [https://www.insight-journal.org/browse/publication/784](https://www.insight-journal.org/browse/publication/784)?

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [June 22, 2023, 8:15am UTC](https://discourse.itk.org/t/cant-get-right-drr/6007/3 "2023-06-22T08:15:11Z")

</div>

I guess it is due to a change in the way the physical space is accounted for, see

> <https://github.com/InsightSoftwareConsortium/ITK/commit/cc94806f99054987adc5dc513c40630b44202a8b>
>
> Patches are incorporated from Jian Wu \<eewujian at hotmail.com\> to address
> locat…ions within physical space:
> 
> https://public.kitware.com/pipermail/insight-users/2006-March/017265.html
> https://public.kitware.com/pipermail/insight-users/2006-March/017127.html
> 
> and Aviv Hurvitz \<aviv.hurvitz@gmail.com\>:
> 
> https://public.kitware.com/pipermail/insight-users/2008-July/026509.html
> 
> The tested point is moved to lie outside of the input volume.
> 
> A new baseline is required for the example, whose output is now what is
> expected from passing through a empty cube.
> 
> Change-Id: Ic3ff1cdd566adaf8a417ef0d6e9501deafca822b

You can try to revert this commit or to modify -iso.

---

<div class="post-metadata">

### Author: ![suzume](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/6a8cbe/32.png) [@suzume](https://discourse.itk.org/u/suzume)
#### Post date: [June 22, 2023, 8:50am UTC](https://discourse.itk.org/t/cant-get-right-drr/6007/4 "2023-06-22T08:50:49Z")

</div>

Hi, simon:  
I have found that it may be the problem of transform center. When I set the rotation parameters separately, the results is:  
the parameters are: -rp 0 -t 5 5 5 -iso 255 259 130 -res 0.5 0.5 -size 512 512  
[boxheadfullDRRDev1\_G0t555.tif](https://discourse.itk.org/uploads/short-url/3FJXc2nSTyiOr3vGsoLrB2iWRIo.tif) (256.2 KB)  
the parameters are: -rp 0 -t 5 5 5 -iso 255 259 130 -res 0.5 0.5 -size 512 512 -rz 2  
[boxheadfullDRRDev1\_G0rz2t555.tif](https://discourse.itk.org/uploads/short-url/xscG2JW0Tjm8z6y4awpvM4WjKXM.tif) (256.2 KB)  
the parameters are: -rp 0 -t 5 5 5 -iso 255 259 130 -res 0.5 0.5 -size 512 512 -ry 4  
[boxheadfullDRRDev1\_G0ry4t555.tif](https://discourse.itk.org/uploads/short-url/emTIF2P4WjKoT4inr1z4amHTET.tif) (256.2 KB)  
the parameters are: -rp 0 -t 5 5 5 -iso 255 259 130 -res 0.5 0.5 -size 512 512 -rx -3  
[boxheadfullDRRDev1\_G0rx-3t555.tif](https://discourse.itk.org/uploads/short-url/qJL9qWNhOooBha1aFjRXAS6I2ua.tif) (256.2 KB)  
It seems that the rotation center is not within the CT image. What can I do to figure it out?

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [June 22, 2023, 3:38pm UTC](https://discourse.itk.org/t/cant-get-right-drr/6007/5 "2023-06-22T15:38:15Z")

</div>

It expect a rotation around the isocenter so maybe play with the -iso parameter?
