BUNPC / Homer3

MATLAB application for fNIRS data processing and visualization
93 stars 55 forks source link

[BUG]: Wrong logic of hmrR_PruneChannels.m for excluding both wavelengths of same channel. #200

Open BAK262 opened 8 months ago

BAK262 commented 8 months ago

Version of Homer3 you are using

Homer3-1.80.2

Description of the issue

Issue 1: In the lines 89-111, the variable idxsExcl records source-detector pairs where a time series from arbitrary wavelength fails to pass the threshold. However, the exclusion operation (aka line 110 chanList(lst(idxsExcl)) = 0) happens for each loop. This will cause situations that (1) when the time series of 1st wavelength fails to be included (and 2nd not), both series will be pruned ultimately, (2) however, when the time series of 2nd wavelength fails (and 1st not), only the 2nd series will be pruned -- which probably leads a misinterpretation for the concentration data computed from only-one-wavelength source-detecter pairs.

Issue 2: In the lines 115-126, the ii variable is definitely equal to nLambda. What information could it convey to users?