How to set different source intensity in mcxlab?

116 views
Skip to first unread message

Bin H.

unread,
Jan 23, 2024, 10:56:04 AM1/23/24
to mcx-users
Dear Sir or Madam,

I  am a newbie, still don't understand how to set different source intensity.

I searched this group, and see Dr. Fang says " by default, mcx normalizes the solution so that the total source intensity is 1".  ,  and "No matter how many photons you simulation, what voxel size you choose, mcx's fluence output (cfg.outputtype='fluence') will always match this analytical solution"

Does it means no matter how many photons you input, the output will always be normalized to the case when source intensity is 1?

So how to change source intensity to see the increase of depth of penetration?

Thank you very much!




Bin H.

unread,
Jan 23, 2024, 12:34:38 PM1/23/24
to mcx-users
And also  What about multiple sources?  In the "example_sequential_simulations.m"
and the output is the summation of fluence from each source, so is it not normalized any more?
The code just adds the fluence from each source together.

Qianqian Fang

unread,
Jan 23, 2024, 12:47:10 PM1/23/24
to mcx-...@googlegroups.com, Bin H.

hi Bin,

by default, mcx normalizes a source so that the simulation is always a Green's function.

any scaling you want to do to the source can imply multiple to the  fluence/fluence rate/energy deposit output produced by mcx because mcx solutions are linear to the source term.

for example, if your source has an "intensity" of 2 instead of 1, you just multiply 2 to the output.


when you simulate multiple sources, you let mcx return the solutions for each unitary source, and manually scale them and add solutions together.


in the most recent release - v2023, we have added a new feature to allow users to manually set source intensity - by setting the 4th element of cfg.srcpos in mcxlab/pmcx, or setting Optode.Source.Weight parameter inside the JSON input file

https://github.com/fangq/mcx/blob/v2023/src/mcx_utils.c#L2492

this number by default is 1, so that the output is still simulating a unitary source, but you can change it to any scalar value. 

I want to mention that mcx v2023's source weight can be a negative number; same for pattered source - mcx accepts negative pattern values to conveniently simulate Fourier or other patterns, and my students have been using this feature extensively in their works.


in addition, recently, I completed a new feature of supporting multiple sources of the same type in the following announcement

https://twitter.com/FangQ/status/1741329118375907540

to use this feature, you need to set cfg.srcpos/srcdir/srcparam1/srcparam2 to matrices of the same size; you can adjust the relative intensities between these sources by setting the 4th column of the cfg.srcpos input, see

see this sample script

https://github.com/fangq/mcx/blob/master/mcxlab/examples/demo_multisrc.m#L47


in summary - you can pretty much do all what you hoped  - simulating non-unitary source or multiple sources - using the old version of mcx if you understand the linear nature of the mcx solution to the source; however the newly added weight control and multi-src simulation make these a bit more streamlined.


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/7cf45be7-afb4-4bd1-b2c2-f5380ad84e77n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages