reading your question below, I am under the impression that you must have assumed that the output, fluence.data, is related to normalized energy deposition, thus, should be less than 1 (with the assumption that the total launched energy is 1). if this is the case, I think reading this section of the README should be helpful
https://github.com/fangq/mcx/tree/v2025?tab=readme-ov-file#interpreting-the-output
Briefly, the default mcx output is 'fluence-rate' (cfg.outputtype='flux'), which has a unit of 1/(mm^2*s) or J/(mm^2*s); you can use cfg.outputtype to change the output type, if you change cfg.outputtype to 'fluence', the output unit becomes 1/mm^2. While both 'flux' or 'fluence' outputs are normalized, they do not sum to 1, because they are meant to be the Green's functions - which is produced by a unitary source. You can only test sum-to-1 when you set cfg.outputtype='energy'.
all supported output options can be found here
https://github.com/fangq/mcx/blob/v2025/mcxlab/mcxlab.m#L302-L311
please also see this Jupyter Notebook tutorial on how to correctly save diff. reflectance with mcxlab
another comment related to your testing method, i.e. verifying diffuse reflectance by summing the boundary fluence value - this is also problematic.
the surface fluence (light intensity reaching the surface of the medium, but still within the medium) and the diffuse reflectance (light leaking out of the medium) are not the same thing. They are related by an equation (Eq. 8) described by this paper
* Alwin Kienle and Michael S. Patterson, "Improved solutions of the steady-state and the time-resolved diffusion equations for reflectance from a semi-infinite turbid medium," J. Opt. Soc. Am. A 14, 246-254 (1997)
my student Shijie Yan had previously written a script verifying
this relationship using mcxlab, and match was excellent
https://github.com/fangq/mcx/blob/v2025/mcxlab/examples/demo_diffuse_reflectance_validation.m
Qianqian
Dear Professor Fang,
I hope this email finds you well. First and foremost, I would like to express my sincere gratitude for developing such an outstanding toolkit. Your contributions have been invaluable to our research community.
I am currently working with MCXLAB and have encountered several issues that have been quite perplexing. Therefore, I am reaching out to seek your guidance. Specifically, I aim to simulate a three-layer flat medium and wish to obtain the total diffuse reflectance, total transmittance, as well as the energy absorption distribution within each layer. However, I have run into difficulties when calculating the diffuse reflectance. By summing up the values in the fluence.data of the topmost layer, I obtained a reflectance value exceeding one, which is clearly incorrect. Upon reviewing some of your previous responses to similar inquiries, I understand that it might be necessary to add detectors and utilize the replay feature to track photons and accumulate relevant data packets to accurately compute the diffuse reflectance. Could you please confirm if this is indeed the correct approach?
Additionally, I would greatly appreciate any advice on how to calculate the absorption rate for each individual layer. Understanding this aspect is crucial for my ongoing research.
Your insights would be immensely helpful, and I look forward to your response.
With kind regards,saiwei--
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/b249352b-e25e-4396-ab23-cf62e69e6c78n%40googlegroups.com.