Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCX returns zero detected photons when detector radius equals or less than 0.5 #101

Closed
fangq opened this issue Aug 27, 2020 · 0 comments
Closed
Assignees
Labels

Comments

@fangq
Copy link
Owner

fangq commented Aug 27, 2020

Joe Prosser reported the below issue in a mailing list post
https://groups.google.com/g/mcx-users/c/5wAuk4G7n2o/m/k-2keouAAQAJ

Problem: when a detector's radius is set to 0.5 or less, it does not detect any photon even issrcfrom0 is set properly.

Subject: | [mcx-users] Re: issue with detector radius in mcxlab?
Wed, 26 Aug 2020 13:48:33 -0700 (PDT)
Joe Prosser <joepro6 at ...>

The issue also happens when issrcfrom0=1, only at the detector radius of 0.5 instead of ~1.0 (see below). Sorry for the confusion I had removed that line, trying to minimize the cfg but didn't realize I caused the loss of photons in a different way.

Changed cfg.detpos(1,4) to 0.5
added cfg.tstart=0
added cfg.issrcfrom0 = 1

Same issue. Interestingly the XY exit positions of detected photons when the radius is 0.51 actually forms a 0.51 radius circle. If the circle was only tangentially intersecting the volume, I would expect the radius of XY exit positions to be smaller in that case. 
 
When cfg.detpos(1,4) is set to 0.51:
figure; scatter(detphoton.p(:,1),detphoton.p(:,2),'.')

> On Wednesday, August 26, 2020 at 12:35:49 PM UTC-4 Joe Prosser wrote:
> Hi Dr. Fang,
> 
> I seem to be having issues with detector radius. When I run the below in MCXLAB I get 5190 detected photon packets. If I change the detector radius detpos(1,4) from 1.2 to 1.1, I get zero. I realize there is a work-around to save the exit positions and filter them but the number of detected photons seems to drop off precipitously as the detector radius decreases from 1.2 to 1.1. For a source/detector distance of 20mm the radius threshold is around 0.5mm. Script below. Thanks for taking a look!

> Joe
> Joseph Prosser, PhD
> 
> Revision info
> $Rev::f9ad72$2019.4 $Date::2019-09-06 18:50:12 -04$ by $Author::Qianqian Fang $
> ###############################################################################
> - variant name: [Fermi] compiled by nvcc [7.5] with CUDA [7050]
> - compiled with: RNG [xorshift128+] with Seed Length [4]

This can be reproduced using v2019.4 or latest github version with the following test script

%% set up the parameters and S/D locations
clear all;
cfg.srcpos = [24.5 40 0];
cfg.tstart = 0;
cfg.tend = 5e-9;
cfg.tstep = 2e-11;
cfg.nphoton = 1e7;
cfg.vol = ones(49,120,41);
cfg.srcdir = [0 0 1];
cfg.autopilot = 1;
cfg.detpos = [24.5000 50.0000 0 0.5];
cfg.prop = [0 0 1.0000 1.0000; 0.0264 2.8684 0.6200 1.5111];
cfg.issrcfrom0 = 1;
cfg.issaveexit=1;

[fluence,detphoton,vol]=mcxlab(cfg);
@fangq fangq self-assigned this Aug 27, 2020
@fangq fangq added the bug label Aug 27, 2020
@fangq fangq closed this as completed in 63e5a5f Aug 27, 2020
fangq added a commit to fangq/mcxcl that referenced this issue Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant