detector inside the medium

9 views
Skip to first unread message

zhang haohui

unread,
Sep 1, 2025, 3:29:07 PM (7 days ago) Sep 1
to mcx-users
Dear Prof. Fang,

I am currently using your mcxlab package and would like to detect the number of photons with a photodetector embedded inside the medium.

From the manual, I see that "mcx detectors captures photons at the "intersecting surface" between tissue-0-voxel boundary and a sphere of given radius". My question is: is it possible to define a small surface inside the medium and capture the photons passing through that surface?

Thank you very much for your help.


Best wishes
Haohui

Qianqian Fang

unread,
Sep 1, 2025, 4:17:37 PM (7 days ago) Sep 1
to mcx-...@googlegroups.com, zhang haohui

hi Haohui,

the reason that mcx imposes this restriction (detection only happens before a photon exiting the domain) is to prevent continued propagation after detection - which is not physically possible.

because of that, detectors must be either located on the bounding box of the domain or the interface between a zero/non-zero voxel.

if your detector are indeed located inside the domain, you will have to create a small "cavity" region filled with 0-valued voxels. for example, you can do

cfg.issrcfrom0 = 1;
cfg.vol=ones(60, 60, 60);
cfg.vol(28:32, 28:32, 10) = 0;
cfg.detpos = [30,30,10, 4];

this should be able to capture all photons exiting from the voxel boundaries of those set to 0. As you can see, a limitation of this approach is that it must be a gap at least 1 voxel wide.

Qianqian

--
You received this message because you are subscribed to the Google Groups "mcx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcx-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/f6c2d3e4-d8b4-4403-9e96-94c516785d78n%40googlegroups.com.

Qianqian Fang

unread,
Sep 1, 2025, 11:16:30 PM (7 days ago) Sep 1
to zhang haohui, mcx-...@googlegroups.com

no, they won't. any photon leaving from a non-zero voxel to the background will be terminated.

On 9/1/25 19:07, zhang haohui wrote:
Hello, Prof. Fang,

Thank you very much for your reply. I find your method very clever and now have a follow-up question. For photons that leave the medium and enter the small void, will they be able to propagate back into the medium?  

Best regards
Haohui

zhang haohui

unread,
Sep 1, 2025, 11:20:54 PM (7 days ago) Sep 1
to Qianqian Fang, mcx-...@googlegroups.com
Hello, Prof. Fang

Thank you for your explanation. 

Best regards
Haohui
Reply all
Reply to author
Forward
0 new messages