Dear All,
I am a beginner in MCX, so please excuse me if this doubt sounds very trivial.
I am trying to model an infinite medium (experimentally, we had done this using a liquid phantom in a large volume and with the fibers placed about 5cm into the volume of the liquid). However, I have already read that in MCX we cannot place a detector in middle of the volume. Hence, I am trying to differentiate between INF and SEMI INF medium using the boundary conditions. I have a cube of 150mx150mm x150mm with detector at (75,75,0).
hi Vamshi
I want to make three comments:
1. you don't have to use detected photons to quantify light
intensity inside a volume. you can use the volumetric
fluence/fluence-rate output (first output of mcxlab) directly.
each voxel in the fluence output represents the light intensity
inside each voxel location. your fiber measurement is simply a
mean for you to physically probe such quantity (with compromises,
such as inserting the fiber into a volume and disturb the
distribution), but mcx, as a simulator, can directly provide such
information conveniently in a volume without compromise.
2. if you have to, you CAN effectively place a detector "inside" the medium, as long as you set a 1-voxel layer of zero-valued pixels next to it, for example
cfg.vol=uint8(ones(60,60,60));
[xi,yi]=meshgrid(1:60,1:60);
dist2=(xi-30).*(xi-30)+(yi-30).*(yi-30);
dist2=(dist2>25);
cfg.vol(:,:,30)=uint8(dist2);
cfg.detpos=[30,30,29.5,5];
mcxplotvol(cfg.vol) % plot to see the volume
note this flat detector captures photons arriving on both top/bottom sides. if you want to only capture the bottom side, like a fiber, you can extrude the zero-voxel patch all the way to the top, like adding a hollow cylinder matching the diameter of the fiber.
this is an approximated solution because the zero-voxels have a shape mismatch those from the circular detector aperture, such as shown in this diagram
http://mcx.space/wiki/index.cgi?Doc/FAQ#My_simulation_created_an_empty_history_file_why_is_that
3. applying a cyclic bc not only effectively mirror the domain to an infinite slab, but also mirrors the source in the same direction. therefore, this approach gives you valid solution when you are trying to simulate an infinite plane source with an infinite layered medium, like in this example
https://github.com/fangq/mcx/blob/master/mcxlab/examples/demo_infinite_slab_cyclic_bc.m
but if you apply such bc for a pencil beam, the output solution is effectively a result from an infinite 2D grid of the pencil beams over an infinite slab.
if your goal is to simply expand the slab but not to duplicate your source in x/y, then cyclic bc is not a solution. In this case, my only suggestion is to simply increase the size of your domain - when your boundary is sufficiently far away from the source, then it should give you a good solution.
if you only care about detected photons (or total diffuse
reflectance such as our recently added polarized photon modeling),
then you can set cfg.unitinmm to a big number to simulate a large
physical size to attenuate the boundary effect further.
1) I tried putting the plane of the detector [-z = Cyclic], but it gives me 0 detected photons2) Hence, I used following boundary conditions and got the corresponding number of detected photons -INF: [-z = Absorbing]: 216000 detected photons (approx avg for many seed values)SEMI INF: [-z = Fresnel reflecting]: 133000 detected photons (avg)
Intuitively, I was expecting the volume with the detector on a reflecting boundary to give us more detected photons.
generally speaking, strongly reflection on the boundary results
in higher fluence inside the domain, but lower number of detected
photons. a total reflection bc will not allow you to detect any
photon because all photons are bounced back and won't come out
from the surface.
But I am unable to explain this. I have tried varying the BC for all the other boundaries (x,y and +z), but it doesnt make so much of a difference. Could anyone explain why this occurs, or am I doing something wrong? Thank you.
I don't know exactly which dimensions you want to extend your domain, but try increasing the gird size in those directions, at some point, the result will not change as you further increase the domain size. for diffusive media, a few cm from the boundary should be sufficient.
Qianqian
Yours sincerely,Vamshi--
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/d2dca8c2-599a-4dec-bc5f-5f4bbf300813n%40googlegroups.com.
to read mcx output in Python, the simplest way is to add -F jnii to save the data in the JSON/JNIfTI format, more instructions can be found here
https://github.com/fangq/mcx#jnii-files
you can also use -F bnii to export in binary JSON format, and
please check out this thread for how to read it using the latest
version of jdata/bjdata module
https://groups.google.com/g/mcx-users/c/c9mPMjd0RQw/m/N2vrKEzDAwAJ
Qianqian
To view this discussion on the web visit https://groups.google.com/d/msgid/mcx-users/410316b8-c71d-4a2e-9712-aeb4eae677ban%40googlegroups.com.