Skip to content

Commit

Permalink
fixed error when EEG.icaact has type single and added relevant test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapton committed Jan 25, 2019
1 parent 75f248d commit 4aaa161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ICL_feature_extractor.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
% check for ica
assert(isfield(EEG, 'icawinv'), 'You must have an ICA decomposition to use ICLabel')

% calculate ica activations if missing
% calculate ica activations if missing and cast to double
if isempty(EEG.icaact)
EEG.icaact = eeg_getica(EEG);
end
EEG.icaact = double(EEG.icaact);

% check ica is real
assert(isreal(EEG.icaact), 'Your ICA decomposition must be real to use ICLabel')
Expand Down
4 changes: 3 additions & 1 deletion run_tests.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ function run_tests()
EEG = pop_epoch(EEG, {'square'}, [-1 1]);
end

%% test complete ICA
%% test complete ICA with data as singles

EEG_temp = setup(EEG, icasphere, icaweights, 1:32);
EEG_temp.data = single(EEG_temp.data);
EEG_temp.icaact = single(EEG_temp.icaact);

test_iclabel(EEG_temp)

Expand Down

0 comments on commit 4aaa161

Please sign in to comment.