arcadelab / deepdrr

Code for "DeepDRR: A Catalyst for Machine Learning in Fluoroscopy-guided Procedures". https://arxiv.org/abs/1803.08606
GNU General Public License v3.0
209 stars 60 forks source link

Zooming out on the DRR #111

Closed YassinAbdelrahman closed 10 months ago

YassinAbdelrahman commented 10 months ago

Hi,

I have recently started using the minimal example to load a CT scan and generate an X-ray projection. I have adjusted parameters so it looks like the following picture: example_projector

However, I am looking for something that is zoomed out quite a bit more, something that looks like this: thumbnail_DRR_LOEX_2_2

This is the code I am using:

from deepdrr import geo, Volume, MobileCArm
from deepdrr.projector import Projector # separate import for CUDA init
from deepdrr.utils import image_utils

ct = Volume.from_nifti('Output Volume_3.nii.gz')
ct.supine()
carm = MobileCArm(isocenter=ct.center_in_world,alpha=0, beta=0, degrees=True)
# Initialize the Projector object (allocates GPU memory)
with Projector(ct, carm=carm, step=0.1,photon_count=10000,neglog=True,intensity_upper_bound=3) as projector:

    # Move the C-arm to the desired pose.
    carm.move_to(isocenter_in_world=ct.center_in_world + geo.v(0, 0, -500))

    # Run projection
    image = projector()

Could anyone help me accomplish this? I am quite new to CT image processing so any help would be appreciated!

Thank you, Yassin

benjamindkilleen commented 10 months ago

Hi Yassin,

This kind of image would not be possible to acquire with a MobileCArm, so you'll have to specify the projection matrix yourself, using a very large detector and placing it just behind the CT. Szeliski's Computer Vision Ch2 is a good reference, or there are numerous articles online.

Note, if the image is not cone-beam X-ray, then DeepDRR may not be well-suited to this type of projection.

Best,

Benjamin