MCXLab meaning of output results (trajectory)

219 views
Skip to first unread message

Raphaël Maltais-Tariant

unread,
Aug 3, 2018, 5:55:58 PM8/3/18
to mcx-users
Hi,

I've post two questions recently and I hope this is my last. Sorry.

I'm trying to have a better understanding of the output that the simulation is giving me as I haven't found the documentation that satisfied me. 

First, the fluence:
fluence.data gives me a 180x160x160x10 single matrix.

What is the last x10 for? I expected to see a 180x160x160 matrix instead.


Second trajectory:
trajectory.data gives me a 6x0 single matrix.

-I understood that mcxlab recorded the first 1e6 photons trajectories by default. Why didn't save anything?

-What does the trajectory mean? Is it the trajectory of a photon before it got absorbed or the trajectory of a photon the last time he got scattered?

-Finally, is it possible to know the trajectory of the photons reaching the detector? Or is it possible in general to the trajectory of the photons passing in a certain voxel?

I understand those questions are more complicated but thank you for any help or tips.
RMT

Qianqian Fang

unread,
Aug 5, 2018, 11:58:43 AM8/5/18
to mcx-...@googlegroups.com, Raphaël Maltais-Tariant
On 08/03/2018 05:55 PM, Raphaël Maltais-Tariant wrote:
Hi,

I've post two questions recently and I hope this is my last. Sorry.

I'm trying to have a better understanding of the output that the simulation is giving me as I haven't found the documentation that satisfied me. 

First, the fluence:
fluence.data gives me a 180x160x160x10 single matrix.

What is the last x10 for? I expected to see a 180x160x160 matrix instead.

hi Raphaël

in fact, if you read carefully, this is in the README file of mcx

https://github.com/fangq/mcx/blob/master/README.txt#L637-L732


Second trajectory:
trajectory.data gives me a 6x0 single matrix.

-I understood that mcxlab recorded the first 1e6 photons trajectories by default. Why didn't save anything?

you must tell mcx to output trajectory data by including flag 'M' in the cfg.debuglevel parameter.

for example,

cfg.debuglevel='M';
[flux, detps, vol, seed, traj]=mcxlab(cfg);

>> traj

traj =

     pos: [1000000x3 single]
      id: [1000000x1 uint32]
    data: [6x1000000 single]

-What does the trajectory mean? Is it the trajectory of a photon before it got absorbed or the trajectory of a photon the last time he got scattered?

this is actually explained in the help info of mcxlab

https://github.com/fangq/mcx/blob/master/mcxlab/mcxlab.m#L182-L189

as well as in the README file

https://github.com/fangq/mcx/blob/master/mcxlab/README.txt#L223-L230

however, I want to mention that this feature has not been fully tested. the way
that the trajectory is recorded result in an overwhelming amount of intermediate
nodes, which tend to fill the buffer very quickly, so often you are not able to
capture all trajectories.



-Finally, is it possible to know the trajectory of the photons reaching the detector? Or is it possible in general to the trajectory of the photons passing in a certain voxel?

if you just want to know the trajectory path, you will have to use the "replay" feature,
see this example

https://github.com/fangq/mcx/blob/master/mcxlab/examples/demo_mcxlab_replay.m

if you define the trajectories output in the replay step (i.e. line 30), you will likely
to see the paths of the detected photons, however, as I mentioned above, the
trajectory may not be complete due to the large amount of data to be saved.

if you just want to generate a mask or probability maps of the trajectories, the
Jacobian output could be more informative.

Qianqian


I understand those questions are more complicated but thank you for any help or tips.
RMT
--
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 post to this group, send email to mcx-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mcx-users.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages