position of source

49 views
Skip to first unread message

Brighten Pan

unread,
Mar 28, 2025, 7:52:14 AMMar 28
to mcx-...@googlegroups.com

Dear Prof. Fang,

I hope you're well.

I have a question regarding the difference in source positioning during simulation. Specifically, I simulated a two-layer slab model and positioned the source and detector according to the following MATLAB code:

cfg.nphoton=1e8;
% 3D volume
cfg.vol=uint8(ones(200,200,200));
cfg.vol(:,:,11:end)=2; % 1st layer thickness: 10 mm
cfg.unitinmm = 1;
% source
cfg.srctype='isotropic';
cfg.srcpos=[85 100 1];
cfg.srcdir=[0 0 1];
% detector
cfg.detpos=[115 100 1 1];
cfg.issrcfrom0=0;  
With this setup, the detector recorded 3840 photons.

When I changed the source and detector positions as shown below:
% source
cfg.srctype='isotropic';
cfg.srcpos=[85 100 0];
cfg.srcdir=[0 0 1];
% detector
cfg.detpos=[115 100 0 1];
cfg.issrcfrom0=1;
The number of detected photons slightly decreased to 3835.

Could you please help me understand the difference between these two source positions? Additionally, I would like to mimic a realistic testing scenario where the source and detector are placed on the tissue surface to collect tissue-scattered photons. What positioning setup would you recommend in this case?

I greatly appreciate your time and guidance, and I look forward to your response.

Best regards,
Brighten

Qianqian Fang

unread,
Apr 4, 2025, 10:33:11 PMApr 4
to mcx-...@googlegroups.com, Brighten Pan

hi Brighten,

sorry for the delay. have been buys with a few deadlines.

the effect of cfg.issrcfrom0=1 is to basically subtract srcpos/detpos by 1 -- issrcfrom0=1 assumes the lower-bottom corner (origin) of the 3D volume has a coordinate of [0,0,0] and issrcfrom0=0 assumes that origin is [1,1,1].

the physical placement of your source/detector relative to the domain in the z-axis are identical for your two settings.

the src/det x/y placement are offset by 1, but the relative positions between the source and the detector remains the same, so, the captured photons are expected to be nearly the same.

let me know if this makes sense.

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/CABOqd3FybaR-4Xdx_ha5Lgm0_Hx4mzr79iZFGOmSS-Li475q9Q%40mail.gmail.com.

Brighten Pan

unread,
Apr 7, 2025, 6:26:27 AMApr 7
to Qianqian Fang, mcx-...@googlegroups.com
Hi Prof. Fang,

Thank you for your reply.

My primary goal is to use the simulated scattered photons to calculate the electric field autocorrelation function (G1) and compare it with the two-layer analytical model of G1 for diffuse correlation spectroscopy. For the analytical model, the thickness of the first layer is a key parameter. Based on your explanation, I wanted to ask if there is any difference in determining the first layer's thickness to be used in the analytical model?

When I use 10 mm (as indicated in my previous email) as the first layer thickness in the analytical model, there is a discrepancy with the simulated curve. However, if I adjust the first layer thickness to 11 mm, the two curves match quite well (see the attached images). I'm wondering if this discrepancy could be related to the source and detector configuration I used, and I would appreciate any insights you might have on this.
image.pngimage.png
I appreciate your time and look forward to your thoughts.

Best regards,
Brighten


Qianqian Fang <q.f...@neu.edu> 于2025年4月5日周六 03:33写道:

Qianqian Fang

unread,
Apr 16, 2025, 1:59:16 PMApr 16
to Brighten Pan, mcx-...@googlegroups.com

hi Brighten,

I suggest you call mcxpreview(cfg) and plot the domain for the two settings, it should place the source relative to the medium layer by following the cfg issrcfrom0 flag settings.

you can potentially see if there is a relative offset between the source and the domain, and adjust it accordingly in your analytical model.


Qianqian

Brighten Pan

unread,
Apr 17, 2025, 4:49:11 AMApr 17
to Qianqian Fang, mcx-...@googlegroups.com
Hi Prof. Fang,

Thank you for your suggestion. I will try this to check my model.

Thanks again for your support!

Best regards,

Brighten

Qianqian Fang <q.f...@neu.edu> 于2025年4月16日周三 18:59写道:
Reply all
Reply to author
Forward
0 new messages