Homer3
Homer3 copied to clipboard
[BUG]: wrong definition of active channels in hmrR_MotionArtifact (hmrR_MotionArtifactByChannel)
Version of Homer3 you are using
Homer3-1.80.2
Your environment (MATLAB environment and OS)
MATLAB R2024a; Windows 11 Pro 64-bit 23H2
Description of the issue
The issue is related to the channels considered active by the functions hmrR_MotionArtifact (and hmrR_MotionArtifactByChannel)
Actual behavior: Currently the function does (lines 99-104) % Get list of active channels mlActMan{iBlk} = mlAct_Initialize(mlActMan{iBlk}, MeasList); mlActAuto{iBlk} = mlAct_Initialize(mlActAuto{iBlk}, MeasList); lstAct1 = mlAct_Matrix2IndexList(mlActAuto{iBlk}, MeasList); lstAct2 = mlAct_Matrix2IndexList(mlActMan{iBlk}, MeasList); lstAct = unique([lstAct1(:)', lstAct2(:)']);
This code will be considered active channels, channels that are considered active either in manual or automatic pruning. For example, if 5 channels were pruned automatically and none were pruned manually, then all channels will be considered active.
Expected behavior: I think what we want is to consider active channels those that are active both in mlActMan and mlActAuto. Then, the last three lines should be
lstAct1 = mlAct_Matrix2BinaryVector(mlActAuto{iBlk}, MeasList); lstAct2 = mlAct_Matrix2BinaryVector(mlActMan{iBlk}, MeasList); lstAct = find(lstAct1 & lstAct2);
The same applies to hmrR_MotionArtifactByChannel on lines 111-113