File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 1- function dett = mcxdettime(detp ,prop )
1+ function dett = mcxdettime(detp ,prop , unitinmm )
22%
3- % dett=mcxdetweight (detp,prop)
3+ % dett=mcxdettime (detp,prop,unitinmm )
44%
55% Recalculate the detected photon time using partial path data and
66% optical properties (for perturbation Monte Carlo or detector readings)
1111% input:
1212% detp: the 2nd output from mcxlab. detp must be a struct
1313% prop: optical property list, as defined in the cfg.prop field of mcxlab's input
14+ % unitinmm: voxel edge-length in mm, should use cfg.unitinmm used to generate detp;
15+ % if ignored, assume to be 1 (mm)
1416%
1517% output:
1618% dett: re-caculated detected photon time based on the partial path data and optical property table
2224
2325R_C0 = 3 .335640951981520e- 12 ; % inverse of light speed in vacuum
2426
27+ if (nargin <= 3 )
28+ unitinmm= 1 ;
29+ end
30+
2531medianum= size(prop ,1 );
2632if (medianum <= 1 )
2733 error(' empty property list' );
3036if (isstruct(detp ))
3137 dett= zeros(size(detp .ppath ,1 ),1 );
3238 for i= 1 : medianum - 1
33- dett= dett + prop(i + 1 ,4 )*detp .ppath(: ,i )*R_C0 ;
39+ dett= dett + prop(i + 1 ,4 )*detp .ppath(: ,i )*R_C0 * unitinmm ;
3440 end
3541else
3642 error(' the first input must be a struct with a subfield named "ppath"' );
Original file line number Diff line number Diff line change 1- function detw = mcxdetweight(detp ,prop )
1+ function detw = mcxdetweight(detp ,prop , unitinmm )
22%
3- % detw=mcxdetweight(detp,prop)
3+ % detw=mcxdetweight(detp,prop,unitinmm )
44%
55% Recalculate the detected photon weight using partial path data and
66% optical properties (for perturbation Monte Carlo or detector readings)
1010% input:
1111% detp: the 2nd output from mcxlab. detp must a struct
1212% prop: optical property list, as defined in the cfg.prop field of mcxlab's input
13+ % unitinmm: voxel edge-length in mm, should use cfg.unitinmm used to generate detp;
14+ % if ignored, assume to be 1 (mm)
1315%
1416% output:
1517% detw: re-caculated detected photon weight based on the partial path data and optical property table
2426 error(' empty property list' );
2527end
2628
29+ if (nargin <= 3 )
30+ unitinmm= 1 ;
31+ end
32+
2733if (isstruct(detp ))
2834 if (~isfield(detp ,' w0' ))
2935 detw= ones(size(detp .ppath ,1 ),1 );
3036 else
3137 detw= detp .w0 ;
3238 end
3339 for i= 1 : medianum - 1
34- detw= detw .* exp(-prop(i + 1 ,1 )*detp .ppath(: ,i ));
40+ detw= detw .* exp(-prop(i + 1 ,1 )*detp .ppath(: ,i )* unitinmm );
3541 end
3642else
3743 error(' the first input must be a struct with a subfield named "ppath"' );
You can’t perform that action at this time.
0 commit comments