# How to generate the attenuation matrix?

**URL:** <https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005>\
**Category:** Algorithms\
**Created:** [April 3, 2021, 12:36am UTC](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005 "2021-04-03T00:36:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Massoud](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@Massoud](https://discourse.itk.org/u/Massoud)\
**Post date:** [April 3, 2021, 12:36am UTC](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005/1 "2021-04-03T00:36:22Z")

</div>

Hi everyone,  
I am using rtkfdk.exe to generate 3D image by using measured input projections (0-360 degree) and the Geometry.xml file. I would like to extract the attenuation matrix (Ax=p) where x is the 3D image matrix and p is a 3D matrix of 2D projections at different angles. I would greatly appreciate it if anyone can let me know how to proceed. I can also generate the 3D image by using rtkramp.exe then performing rtkbackprojections.exe on the output of rtkramp.exe.

---

<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:** [April 5, 2021, 2:47pm UTC](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005/2 "2021-04-05T14:47:05Z")

</div>

This sounds like a question for the [RTK mailing list](https://public.kitware.com/mailman/listinfo/rtk-users). However, maybe @simon.rit or @LucasGandel could answer it here?

---

<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:** [April 5, 2021, 3:02pm UTC](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005/3 "2021-04-05T15:02:58Z")

</div>

Thanks @dzenanz for forwarding the message. I would call it the system matrix or the projection matrix. In general, RTK does not store it but computes it on-the-fly, mainly because it’s generally too large for CT. But we have implemented this and we use it for small test cases. It only works for 2D and one projection operator, [JosephForwardProjectionImageFilter](http://www.openrtk.org/Doxygen/classrtk_1_1JosephForwardProjectionImageFilter.html). The command line tool is [rtkprojectionmatrix](https://github.com/SimonRit/RTK/blob/master/applications/rtkprojectionmatrix/rtkprojectionmatrix.cxx) and you need to pass the same parameters as what you’d use to generate data files for the phantom. It stores it in a Matlab file format but it can be read from python too. RTK does not know how to use it because it can compute it on-the-fly.  
I hope it will work, I haven’t used it in a long time…

---

<div class="post-metadata">

**Author:** ![Massoud](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/8491ac/32.png) [@Massoud](https://discourse.itk.org/u/Massoud)\
**Post date:** [April 5, 2021, 9:22pm UTC](https://discourse.itk.org/t/how-to-generate-the-attenuation-matrix/4005/4 "2021-04-05T21:22:19Z")

</div>

Thanks @dzenanz and @simon.rit. I will try this.
