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

[BUG]: wrong definition of active channels in hmrR_MotionArtifact (hmrR_MotionArtifactByChannel) #201

Open
anaflom opened this issue May 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@anaflom
Copy link

anaflom commented May 2, 2024

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

@anaflom anaflom added the bug Something isn't working label May 2, 2024
@anaflom anaflom changed the title [BUG]: [BUG]: wrong definition of active channels in hmrR_MotionArtifact (hmrR_MotionArtifactByChannel) May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant