Skip to content

Commit 4aaa161

Browse files
committed
fixed error when EEG.icaact has type single and added relevant test
1 parent 75f248d commit 4aaa161

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ICL_feature_extractor.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
% check for ica
1212
assert(isfield(EEG, 'icawinv'), 'You must have an ICA decomposition to use ICLabel')
1313

14-
% calculate ica activations if missing
14+
% calculate ica activations if missing and cast to double
1515
if isempty(EEG.icaact)
1616
EEG.icaact = eeg_getica(EEG);
1717
end
18+
EEG.icaact = double(EEG.icaact);
1819

1920
% check ica is real
2021
assert(isreal(EEG.icaact), 'Your ICA decomposition must be real to use ICLabel')

run_tests.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ function run_tests()
3535
EEG = pop_epoch(EEG, {'square'}, [-1 1]);
3636
end
3737

38-
%% test complete ICA
38+
%% test complete ICA with data as singles
3939

4040
EEG_temp = setup(EEG, icasphere, icaweights, 1:32);
41+
EEG_temp.data = single(EEG_temp.data);
42+
EEG_temp.icaact = single(EEG_temp.icaact);
4143

4244
test_iclabel(EEG_temp)
4345

0 commit comments

Comments
 (0)