If MCX able to set sparate optical params to each voxels and problem about ring src focus

82 views
Skip to first unread message

Alu mine

unread,
Nov 11, 2023, 5:47:19 PM11/11/23
to mcx-users
Dear Dr.Fang
    I currently using MCX, or more specifically pymcx, to do some photon simulation work,
and encountered follow problem.
1  
    the optical parameters of different voxels can only be specified according to the index,
and set the parameters corresponding to the index according to the domain.media list in json file.
    When the voxel is larger, such as 256*256*50, mcx is difficult to carry out, If MCX can directly set the optical properties of each voxel by input 4 matrices of 256*256*50 representing ua, us, g, n respectively?
2
    When using the new ring light source, If it possible to manually set the focus of the light source (not say src.dir)
In other words,ring light sources now emitted in the same direction(such as [0,0,-1] ), but I need to make the direction of src point to the center of the circle. (Although this can be achieved by setting up multiple light sources, setting it angle by angle is very time-consuming)
Adding a scatter medium at the light source to turn ring light into an ring isotropic light source, can be achieved to a certain extent, but there is still any error between with direct ring light.
    As shown below
1,1 is the result of the above scheme;
1,2 is a slice of 1,1;
2,1 is the voxel setting (a uniform cylindrical medium);
2,2 is the result of superposition and slicing of multiple angles
example.jpg
    Apologize again for submitting to the wrong section before, waiting for your reply

Qianqian Fang

unread,
Nov 11, 2023, 7:01:11 PM11/11/23
to mcx-...@googlegroups.com, Alu mine

for your first question, I meant to respond to your question posted on mmc-users, although I got to send it.

for Q1, mcx supports continuously varying medium, you can set floating-point mua or mua/mus values for each voxel, but it currently does not support varying mua/mus/g/n all together.

for mcxlab, the demo script for using this feature can be found below - for pmcx, the conversion to python is quite straightforward.

https://github.com/fangq/mcx/blob/v2023/mcxlab/examples/demo_continuous_mua_mus.m


mcxlab/pmcx uses the data type and dimensions of cfg.vol to determine which type of medium is given, the settings are described here

https://github.com/fangq/mcx/blob/v2023/mcxlab/mcxlab.m#L46-L57


for your second question,  the 'ring' source is pretty much the same as other area source ('disk', 'planar', ...) where the launch direction is controlled by cfg.srcdir(1:3) and the focal length is controlled by cfg.srcdir(4), please see

https://github.com/fangq/mcx/blob/v2023/mcxlab/mcxlab.m#L72-L78


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/2b4aef2f-bea1-4d9d-be9b-c90dcb268da3n%40googlegroups.com.

Alu mine

unread,
Nov 18, 2023, 1:35:06 AM11/18/23
to mcx-users

I have used the form of not matrix input ua and us, Setting isotropic ring light source can achieve similar effect. 

thanks to open source sharing selfless dedication, looking forward to further improvements in the mcx.

Reply all
Reply to author
Forward
0 new messages