Skip to content

Commit

Permalink
Merge pull request sccn#79 from sccn/pop_import_fix
Browse files Browse the repository at this point in the history
Pop import fix
  • Loading branch information
arnodelorme authored Aug 18, 2021
2 parents 8918ff2 + 71816ef commit c51ea49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pop_importbids.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
% 'eventtype' - [string] BIDS event column to use for EEGLAB event types.
% common choices are usually 'trial_type' or 'value'.
% Default is 'value'.
% 'bidstask' - [string] value of a key task- allowing to analyze some
% tasks only
%
% Outputs:
% STUDY - EEGLAB STUDY structure
Expand Down Expand Up @@ -114,6 +116,10 @@
}, 'pop_importbids');
if isstr(opt), error(opt); end

if ~exist('jsondecode.m','file')
addpath([fileparts(which('pop_importbids.m')) filesep 'JSONio'])
end

% Options:
% - copy folder
% - use channel location and event
Expand Down Expand Up @@ -244,7 +250,7 @@
ind = strmatch( '.fif', cellfun(@(x)x(end-3:end), allFiles, 'uniformoutput', false) ); % FIF
if isempty(ind)
ind = strmatch( '.gz', cellfun(@(x)x(end-2:end), allFiles, 'uniformoutput', false) ); % FIF
if isempty(ind)
if isempty(ind) && ~isempty(allFiles)
fprintf(2, 'No EEG file found for subject %s\n', bids.participants{iSubject,1});
end
end
Expand Down Expand Up @@ -566,7 +572,7 @@
parent = fileparts(parent);
end
if isempty(outFile)
outFile = filterHiddenFile(folder, dir(fullfile(parent, fileName)));
outFile = filterHiddenFile(parent, dir(fullfile(parent, fileName)));
end

function fileList = filterHiddenFile(folder, fileList)
Expand Down

0 comments on commit c51ea49

Please sign in to comment.