DIDSR / MCGPU

GPU-accelerated Monte Carlo x-ray transport code to simulate medical x-ray imaging devices.
56 stars 20 forks source link

Half-fan mode #11

Closed dericdesta closed 5 months ago

dericdesta commented 5 months ago

Hi there, thank you for this great framework! I want to simulate a half-fan CBCT (like, e.g., a Varian TrueBeam CBCT is doing it for larger FOV protocols, see here for a schematic). So I want to shift the flat panel detector laterally by some amount. Currently I'm doing it by extending the detector laterally to both sides and cutting away "non-existent" detector space on the projections after simulation. However, this is obviously quite inefficient. So is there a simple way to implement this into MCGPU? I'm happy to do a PR if someone could give me some pointers where code needs to be modified.

Cheers, Frederic!

dericdesta commented 5 months ago

Alright, I think I figured it out (old code lines commented out):

I will also add lateral detector displacement to the input file format (with default = 0). Ping me, if I should open a PR.

Best, Frederic

andreubs commented 5 months ago

Hi Frederic,

I think your solution is correct. Thanks for sharing the problem and the code solving it. I was going to suggest a simpler solution (keep a larger detector than needed --not a problem to waste a little memory-- and reject unwanted sampled angles in the kernel source function) but your solution is more efficient. Please verify that the with the modified code the source sampling is correct and that you are modeling the exact geometry you want. Check the usual geometric suspects: do you need to add or subtract "lateral_detector_displacement"?, is the photon distribution in a flat field consistent after changing the angles?, etc.

Best regards,

 Andreu