Isotropic source point in a homogeneous slab resulting in a non gaussian green function

122 views
Skip to first unread message

Pascal Nguyen

unread,
Dec 21, 2023, 11:21:53 AM12/21/23
to mcx-users

Dear Prof. Fang,

Firstly, thank you for your amazing software.

I am attempting to simulate an isotropic source point inside a slab using "pattern3d" so that I can extend it to an isotropic pattern of fluorescence. However, with the source type "pattern3d" and the isotropic source point, when I attempt to examine the last slice of the green function computed via MCX, it should exhibit a Gaussian profile. Unfortunately, it does not.

I have tested with an another Monte Carlo software which gave me a gaussian profile, did I configure MCX wrongly ?

Here is a part of my MCX configuration using your python wrapper :
# Volume Load
vol = np.ones((51,41,16))
#MIDDLE
vol[26, 21, 8] = 2
cfg={}
cfg['vol'] = vol
cfg['prop'] = np.array([[0,0,1,1], #mm-1
[0.2,0.05,0.9,1.37],
[0.2,0.05,0.9,1.37]])
mask_pattern = copy.deepcopy(cfg['vol'])
mask_pattern[mask_pattern != 2] = 0
mask_pattern[mask_pattern == 2] = 1
cfg['srctype'] = 'pattern3d'
cfg['srcpattern'] = mask_pattern
cfg['srcpos'] = [0, 0, 0];
cfg['srcdir'] = [0, 0, 1, float("nan")] # nan means random direction
cfg['srcparam1'] = list(cfg['srcpattern'].shape) + [0]
cfg['nphoton'] = float(1e7)
cfg['tstart'] = 0
cfg['tend'] = 5e-9
cfg['tstep'] = 5e-9
cfg['bc'] = '______000001'
cfg['savedetflag'] = 'xv'
cfg['maxdetphoton'] = 1E8
cfg['srctype'] = "pencil"
cfg['autopilot'] = 1
cfg['gpuid'] = 1
cfg['unitinmm'] = 1
cfg['debuglevel'] = 'P'
cfg['outputtype'] = 'fluence'

Thank you in advance,
Best regards,
Pascal Nguyen

Qianqian Fang

unread,
Dec 28, 2023, 11:00:01 AM12/28/23
to mcx-...@googlegroups.com, Pascal Nguyen

hi Pascal,

I believe what you saw was the voxel shape effect - your domain has very low scattering, so the light intensity across the domain is related to the light emitted along each direction. by setting one voxel as emitter, you can see that angular distribution of the emitted rays are not spatially uniform.

either you replace it by an 'isotropic' source or increase your medium scattering should give you more uniform angular distribution.

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 on the web visit https://groups.google.com/d/msgid/mcx-users/f30a6ac2-629f-4c04-9d91-a48ca4c2d875n%40googlegroups.com.

Pascal Nguyen

unread,
Jan 9, 2024, 9:34:45 AM1/9/24
to mcx-users
Hi Prof. Fang,

Using isotropic source works perfectly. Thank you very much Prof. Fang.

Best regards,
Pascal Nguyen
Reply all
Reply to author
Forward
0 new messages