apologize for the delay. unfortunately all your embedded images
in the email could not be displayed, either in my email client, or
in the mailing list's web interface
https://groups.google.com/g/mcx-users/c/uJ-DEguNgss
can you please reattach those so I can understand what was the
problem?
You don't often get email from suj...@gmail.com. Learn why this is important
--
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/2f354235-17e6-4568-ad8a-636803ee486fn%40googlegroups.com.
hi Sujit,
I assume that what bothered you was the discontinuities at the
extrusion surface - I think this is expected because mcx dref
output can only represent the output in a voxelated space, which
inherently contains discretization errors - that not only forces
your object surface to be stair-cases (which deviates from the
true surface), but also distorts the dref output by accumulating
dref over a sheet of 1-voxel cover.
this is actually a good example for you to consider using our
SVMC algorithm instead - see our paper here
https://www.osapublishing.org/boe/abstract.cfm?uri=boe-11-11-6262
and examples at
https://github.com/fangq/mcx/blob/master/mcxlab/examples/demo_svmc_cubesph.m
https://github.com/fangq/mcx/blob/master/mcxlab/examples/demo_svmc_sphshells.m
the SVMC method delineates tissue boundaries using interpolated triangular surfaces, which does not have the strong discretization error as you saw in this case.
also, our mesh-based MC (MMC) software offers even better handling in this case - it can save dref over a smooth triangular surface that better captures the small extrusion that you are trying to model, see example how to obtain and play dref using mmclab
https://github.com/fangq/mmc/blob/v2025/mmclab/example/demo_mmclab_basic.m#L37-L43
Qianqian
Dear Dr. Fang,
Apologies for the inconvenience. I've reattached the images. I'm trying to simulate the diffuse reflectance for a volumes with a non-flat topography, and the test volume I am simulating is flat with a small spheroid protrusion. Here is the cross section of the test volume.
In MCX, I've simulated the volume by setting Medium 0 to be the zero voxels and the Medium 1 to be all the non-zero voxels in the tissue. Then I summed up fluence.dref along the z-axis to get the diffuse reflectance. However, some voxels are brighter using this method. Since dref is calculated in the layer of zero voxels immediately next to a non-zero voxel, I believe "corner voxels" that are bounded on multiple surfaces would count more photons. I've attached the image below.
I then tried padding a layer of zeros to cfg.vol, and using Medium 0 to represent the zero-voxels, Medium 1 to represent the intermediate air voxels (same optical properties as Medium 0), and Medium 2 to represent the tissue voxels. This did solve the corner voxel issues, but I lost the spatial frequency information at the regions where M0 voxels are further away from the volume, since here photons from a wider area are received by each detector.
I have a few questions about this. Is there a way to know the voxels that a photon escaped from? When I zero-pad the volume, is there a way to limit the area of acceptance for photons so that I can still see the spatial frequency pattern? Do you have any insights into this? We are happy to share the code if it helps!
Thank you so much for your help!
Sujit Patil
Princess Margaret Cancer Centre, Toronto
On Friday, April 4, 2025 at 10:37:09 PM UTC-4 q.fang wrote:
apologize for the delay. unfortunately all your embedded images in the email could not be displayed, either in my email client, or in the mailing list's web interface
https://groups.google.com/g/mcx-users/c/uJ-DEguNgss
can you please reattach those so I can understand what was the problem?
On 3/20/25 09:04, Sujit Patil wrote:
You don't often get email from suj...@gmail.com. Learn why this is important
Dear Dr. Fang,
I'm currently working on generating SFDI reflectance images using MCX. I'm simulating diffuse reflectance for volumes with a non-flat topography and I am seeing some weird behaviour. Here's is a cross section of the test volume I am simulating - flat with a small spheroid protrusion.
First using cfg.prop, I defined the Medium 0 (zero voxels) to be the air region and Medium 1 to be part of the volume. Since fluence.dref contains data in the zero voxels immediately next to a layer of non-zero voxels, I took the sum along the z-axis. In the image, some voxels appear brighter than others leading to bright rings. I think this is due to some zero voxels are bounded by more than one non-zero voxel and therefore count more photons (photons coming from lateral surfaces and horizontal surfaces).
I also tried using the approach of padding a layer of zeros outside the surface in cfg.vol, and using 1 to represent the air and 2 to represent the tissue (M0 and M1 have the same properties). This does solve the corner voxel issue; however, I lose the spatial frequency information at the regions where the M0 voxels are further away from the volume, since here photons from a wider area are received by each detector.
I have a few questions about this. Is there a way to know the voxels that a photon escaped from? I want to avoid the bright rings caused by corner voxels. Or maybe there is another reason for these? When I zero-pad the volume, is there a way to limit the area of acceptance for photons so that I can still see the spatial frequency pattern?
Do you have any insights into this? Any advice on how I can collect spatial frequency for a non-flat surface would be greatly appreciated! We are happy to share the code if it helps!
Thank you so much for your help!
Sujit PatilPrincess Margaret Cancer Centre, Toronto
--
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/2f354235-17e6-4568-ad8a-636803ee486fn%40googlegroups.com.
--
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/9c7ca0bc-821a-4f47-bb6a-a2fdd448be3dn%40googlegroups.com.
hi Sujit,
sorry for the delayed reply. see my comments below
Dear Dr. Fang,
Thank you again for your previous guidance. I’ve been playing around with mesh-Monte Carlo, and it's been working very well for my application. I also had a few questions.
I was wondering if MMC currently supports fluorescence simulations. I noticed that mmclab doesn’t seem to have an equivalent to mcxlab’s pattern3D source for defining a custom emission distribution. Is there a recommended approach for this using MMC? My goal is to analyze the simulations of tumours with injected fluorophores.
you are correct that mmc/mmclab currently does not support pattern source.
a good news is that one of my students had developed a new
implementation of mmc using GPU's ray-tracing hardware. This
approach not only accelerates MMC simulation significantly, but
also eliminates the needs for "mesh retesselation" for simulation
complex, widefield sources. This means all MCX-supported complex
sources (including pattern3d) can now be supported in MMC without
additional mesh processing.
the paper describing this new implementation is expected to be
submitted in the following month, I will share the paper preprint
and code when it is ready.
Since MMC saves dref over a smooth triangular surface, I was also wondering what the best way to extract that data into a structured N×N matrix—essentially emulating a camera image output? I've tried the two methods. One method is by creating a 2d grid representing dref and calculating the centres of each triangle. Then I found the closest triangle centre to each point on the grid and used that to set the value. The other method is by setting many detectors across one surface of the volume and discretizing the detp positions.
please check out the widefield-detector sample script under the
example folder of mmclab
https://github.com/fangq/mmc/blob/master/mmclab/example/demo_wide_det.m
specifically, by setting cfg.issaveexit flag to 2, mmclab creates and accumulates a 2-D array of detector image, defined by cfg.detpos/detparam1/detparam2, similar to a CCD camera detector. You can place this detector at the desired location/angle to mimic your actual camera placement and it can capture photons based on the light-of-sight.
this feature has not been well advertised. I will add more
description of this feature in our help info.
Qianqian
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/7b537fc6-bdc7-4961-9f73-5faff9f61d78n%40googlegroups.com.
congratulations Mayna! it is always exciting to see validations
of our solvers with real world measurements. it looks awesome!
To view this discussion visit https://groups.google.com/d/msgid/mcx-users/013c0fb5-ebdd-4a9a-ae58-0b9b277f211bn%40googlegroups.com.