hi Kris
did you use mcxlab or mcx?
mcxlab has the capability to receive char/short/int/float/double/float2/float4/short2/char4 arrays as volume input, and will detect/convert automatically.
mcx, however, by default only reads char (byte) based volume masks. if you have a different input format, you must tell mcx the format of the volume file using the -K parameter (this feature only available in v2019.4)
https://github.com/fangq/mcx/blob/master/README.txt#L249-L257
double is not supported by mcx binary.
Also, in both cases, float based volume inputs have different meanings than the integer-based volumes - the integers inputs define volume label, but the float volume defines the mua (and mus) value per voxel.
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 post to this group, send email to mcx-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mcx-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/9fd9d8c6-3f16-4099-a731-51fb16528fb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I use both mcxlab and mcx.
Using mcxlab, I used the mcx2json.m script to convert the cfg that is defined in demo_continuous_mua_mus.m (Approach #2) to a json file with its corresponding volume binary.However, the json2mcx.m script couldn't convert it back to a cfg that didn't raise an error. That is why I changed the format to 'float32'.Doing this, mcxlab worked properly and mua as well as mus were displayed correctly.
hi Kris
I am sorry for the confusions. The support for continuous media, as well as json2mcx, was added recently, and I haven't go through all codes to make sure such data structure is compatible with other existing features.
Using mcx (v2019.4), I wanted to use the json file (converted from demo_continuous_mua_mus.m (Approach #2) by mcx2json.m) to run the simulation via command line. Although I tried all possible values for the -K parameter, I always got the error: MCX ERROR(-6):medium index exceeds the specified medium types in unit mcx_utils.c:1473
I will look into this. it might be the best approach for now to modify from existing working examples, and do not convert from one to another. but thanks for reporting these issues, and hopefully I will fix those in the next release.
if you can write a simple script for me to reproduce the issue, please file a bug at
https://github.com/fangq/mcx/issues
thanks
Qianqian
Best,
Kris
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/0c19de2f-e38a-431c-9f79-9a8137abb308%40googlegroups.com.
hi Kris
thanks for the test scripts, very helpful.
I managed to fix this issue with this commit made a moment ago
https://github.com/fangq/mcx/commit/e1b50b6bbe199026468d45e81a73fb0340045dc1
it modified 3 files:
I tested both mcxlab and mcx binary using the two converted inputs, and both gave me correct results (~30.4% absorption fraction).
I also recompiled mcx/mcxlab nightly build with this new addition. Please go ahead and try it. If there is any further issue, please reopen this issue
https://github.com/fangq/mcx/issues/67
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 post to this group, send email to mcx-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mcx-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/d607bbf7-c773-4262-af0a-fe4341720bae%40googlegroups.com.
Is there a possibility planned in future releases for 4*Nx*Ny*Nz float32 mua/mus/g/n array format?
it can be done, but will involve more code changes, and likely reduced GPU efficiency.
currently, all the volume data are stored in an int32 3D array - char/short label inputs are casted to int, and float2 (mua/mus) are converted to half-precision (fp16) and stored in a single integer (32bit).
if one wants to store mua/mus/g/n per voxel, packing to fp16 or not, it will require a larger sized array. that means more global memory reading and processing.
an alternative is to use the currently supported -K asgn_byte (or -K 103) for encoding all 4 optical parameters. It uses a gray-scale level (0-255 for mua/mus/g and 0-127 for n) to interpolate between cfg.prop(2,:) and cfg.prop(3,:).
For example, if one have cfg.prop=[0,0,1,1; 0.05, 1, 0.9, 1.1; 0.01, 10, 0.8, 1.5] and a 4xNx*Ny*Nz uint8 array as cfg.vol, with the first voxel containing [0, 128, 255, 64], mcx will compute the optical properties via interpolation:
mua[1,1,1]=0.05
mus[1,1,1]=(1+10)/2=5.5
g[1,1,1]=0.8
n[1,1,1]=(1.1+1.5)/2=1.3
for forward purposes, I think such method should provide sufficient accuracy (relative to the stochastic errors of MC), but I have never tested this.
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 post to this group, send email to mcx-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mcx-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/ed6a58c3-179b-4896-82ba-da98e978b4e0%40googlegroups.com.
Thank you very much :)
Best,Kris
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/9894c229-36c5-4289-977c-73ea982b6e3e%40googlegroups.com.