# DRR grayvalue Incorrect

**URL:** <https://discourse.itk.org/t/drr-grayvalue-incorrect/6415>\
**Category:** Algorithms\
**Tags:** registration\
**Created:** [January 26, 2024, 8:14am UTC](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415 "2024-01-26T08:14:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Post date:** [January 26, 2024, 8:14am UTC](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415/1 "2024-01-26T08:14:29Z")

</div>

![image](https://discourse.itk.org/uploads/default/original/2X/b/bce539676c00688c54f1a1ce7da207290f53f968.jpeg)

I used rtk:: CudaForwardProjectionImageFilter to generate DRR, and I shifted the volume to the left. The grayscale value on the right side of the generated DRR is closer to the part that passes through the volume, but shouldn’t its grayscale value be closer to the air?

---

<div class="post-metadata">

**Author:** ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Post date:** [January 26, 2024, 8:25am UTC](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415/2 "2024-01-26T08:25:00Z")

</div>

I want to use this class to generate DRR images and complete 2D 3D image registration, but how should the transformer be set? Directly applying the transformation to volume is very slow. Is it correct for me to apply the transformation to geometry?

 ![image](https://discourse.itk.org/uploads/default/original/2X/8/80f123f3700c13131d4cf9631dae938060640be9.jpeg)

---

<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:** [January 26, 2024, 10:05am UTC](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415/3 "2024-01-26T10:05:48Z")

</div>

RTK forward projector just computes the line integrals of your volume. If you have a CT in HU, air is at -1000 and so you’ll have negative value in air. What you observe on the right of your DRR are for pixels corresponding to x-rays not crossing the volume, then the value is at 0. You might want to rescale your volume to have air at 0 before computing DRRs.

I have never used this class to do 2D 3D registration, sorry.

---

<div class="post-metadata">

**Author:** ![ma1282029525](https://discourse.itk.org/user_avatar/discourse.itk.org/ma1282029525/32/3084_2.png) [@ma1282029525](https://discourse.itk.org/u/ma1282029525)\
**Post date:** [January 29, 2024, 1:24am UTC](https://discourse.itk.org/t/drr-grayvalue-incorrect/6415/4 "2024-01-29T01:24:40Z")

</div>

thank you very much 😄
