Hi,
I am trying to simulate a volume with cylinder as a source and the code returns an empty matrix.
Could you please let me know the cause. Could the size of the matrix be an issue
MCXLAB ERROR -77 in unit
mcx_core.cu:3522: an illegal memory access was encountered
Error from thread (0): an illegal memory access was encountered
C++ Error: MCXLAB Terminated due to an exception!
load digimouse.mat;
digimouse = ones(size(digimouse));
cyl_R = 5;
cyl_H = 30; matsize = cyl_H;
cyl_mask = defineCylinder(cyl_R,cyl_H,matsize);cyl_mask=cyl_mask*2;
cyl_mask(find(cyl_mask==0))=1;
cyl_mask_rot = imrotate3(cyl_mask,90,[0 1 0]);
cyl_cent = matsize/2;
digimouse_copy = digimouse;
% digimouse_copy(75-cyl_cent:75+cyl_cent-1, 163-cyl_cent:163+cyl_cent-1, 110-cyl_cent:110+cyl_cent-1) = cyl_mask_rot;
digimouse_copy(85-cyl_cent:85+cyl_cent-1, 248-cyl_cent:248+cyl_cent-1, 72-cyl_cent:72+cyl_cent-1) = cyl_mask_rot;
digimouse_copy(find(digimouse==0))=0;
src_pattern = zeros(size(digimouse_copy));
src_pattern(find(digimouse_copy == 2)) = 1;
cfg.vol = digimouse_copy;
cfg.prop = [0 0 1 1 % Boundary
0.033 77 0.9 1.33 % Tissue
4.5 592 0.9799 1.33]; % Blood vessel
cfg.srctype = 'pattern3D';
cfg.srcpattern = logical(src_pattern);
cfg.srcpos = [85.0 248.0 72.0];
cfg2.srcparam1 = size(src_pattern);
cfg.srcdir = [0 0 -1 nan];
cfg.isnormalized = 0;
cfg.outputtype = 'energy';
cfg.tstart = 0;
cfg.tend = 5e-9;
cfg.tstep = 5e-9;
cfg.nphoton = 1e4;
cfg.autopilot = 1;
cfg.gpuid = 1;
cfg.unitinmm = 0.1 * 2;
cfg.debuglevel = 'P';
cfg.bc = '______111111'; % capture photons existing from all faces except z=z_max
cfg.savedetflag = 'dpx';
cfg.issaveref = 1;
flux = mcxlab(cfg);
fcw = flux.data;