Skip to content

Commit

Permalink
Added example dataset for annotations and nested derivatives.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andesha committed Oct 11, 2019
1 parent e012a07 commit 9893043
Show file tree
Hide file tree
Showing 921 changed files with 114,741 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eeg_face13/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Face13 Dataset

Data used for JofV Deconstructing the early visual electrocortical response to face and house stimuli:
https://jov.arvojournals.org/article.aspx?articleid=2121634
21 changes: 21 additions & 0 deletions eeg_face13/code/BIDS-Init-Face13-EEGLAB/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# BIDS-Init-Face13-EEGLAB
Root BIDS level initialization and BIDSification tool suite

## How to Run
This installation assumes familiarity with the bash terminal, paths, and Matlab console use.
1. Download Face13 sourcedata folder, [here](https://drive.google.com/open?id=1xq85woDpAYXhCtzdgjkXpjjjggiWSKtc)
2. Create a project folder: `mkdir Face13`
3. Move the sourcedata into the project folder and rename as `sourcedata`. This step may differ based on download location and platform.
4. Enter the project folder: `cd Face13`
5. Create a code folder: `mkdir code`
6. Enter code folder: `cd code`
7. Use: `git clone --recursive https://github.com/BUCANL/BIDS-Init-Face13-EEGLAB.git` inside of the code folder
8. Point Matlab to project folder. In our case, Face13.
9. In the Matlab console execute: `addpath code/BIDS-Init-Face13-EEGLAB`
10. In the Matlab console execute: `addpath code/BIDS-Init-Face13-EEGLAB/eeglab`
11. In the Matlab console execute: `eeglab`
12. At this point the familiar eeglab window should appear.
13. To merge and relabel bdf files run: `init_script.m`
14. To BIDSify run: `bids_face13.m`
15. Select the project directory with the file chooser
16. Visualize your data!
105 changes: 105 additions & 0 deletions eeg_face13/code/BIDS-Init-Face13-EEGLAB/bids_face13.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
% Global settings
bidsOpt.FileExt = 'edf';
bidsOpt.InteralUse = true;

% Data
data(1).file = {'./sourcedata/eeg/sub-s01_task-faceFO_eeg.set'};
data(1).session = 1;
data(1).run = 1;

data(2).file = {'./sourcedata/eeg/sub-s02_task-faceFO_eeg.set'};
data(2).session = 1;
data(2).run = 1;

data(3).file = {'./sourcedata/eeg/sub-s03_task-faceFO_eeg.set'};
data(3).session = 1;
data(3).run = 1;

data(4).file = {'./sourcedata/eeg/sub-s04_task-faceFO_eeg.set'};
data(4).session = 1;
data(4).run = 1;

data(5).file = {'./sourcedata/eeg/sub-s05_task-faceFO_eeg.set'};
data(5).session = 1;
data(5).run = 1;

data(6).file = {'./sourcedata/eeg/sub-s06_task-faceFO_eeg.set'};
data(6).session = 1;
data(6).run = 1;

data(7).file = {'./sourcedata/eeg/sub-s07_task-faceFO_eeg.set'};
data(7).session = 1;
data(7).run = 1;

data(8).file = {'./sourcedata/eeg/sub-s08_task-faceFO_eeg.set'};
data(8).session = 1;
data(8).run = 1;

data(9).file = {'./sourcedata/eeg/sub-s09_task-faceFO_eeg.set'};
data(9).session = 1;
data(9).run = 1;

data(10).file = {'./sourcedata/eeg/sub-s10_task-faceFO_eeg.set'};
data(10).session = 1;
data(10).run = 1;

% general information for dataset_description.json file
% -----------------------------------------------------
generalInfo.Name = 'faceFO';
generalInfo.License = 'ODbL (https://opendatacommons.org/licenses/odbl/summary/)';
generalInfo.Authors = {'James A. Desjardins', 'Sidney J. Segalowitz'};
generalInfo.HowToAcknowledge = 'Desjardins, J. A., & Segalowitz, S. J. (2013). Deconstructing the early visual electrocortical responses to face and house stimuli. Journal of Vision, 13(5), 22-22.';
generalInfo.Funding = {'NSERC funding to Sidney Segalowitz'};
generalInfo.ReferencesAndLinks = {'http://jov.arvojournals.org/article.aspx?articleid=2121634'};
generalInfo.DatasetDOI = '10.1167/13.5.22';

% Readme and changes
% -----------------------------------------------------
README = sprintf('# Face13 Dataset\n\nData used for JofV Deconstructing the early visual electrocortical response to face and house stimuli:\nhttps://jov.arvojournals.org/article.aspx?articleid=2121634');
% CHANGES = sprintf();

% Task information for xxxx-eeg.json file
% -----------------------------------------------------
tInfo.TaskName = 'FaceHouseCheck';
tInfo.TaskDescription = 'Visual presentation of oval cropped face and house images both upright and inverted. Rare left or right half oval checkerboards were presetned as targets for keypress response.';
tInfo.InstitutionName = 'Brock University';
tInfo.InstitutionAddress = '500 Glenridge Ave, St.Catharines, Ontario';
tInfo.EOGChannelCount = 7;
tInfo.EMGChannelCount = 0;
tInfo.MiscChannelCount = 0;
tInfo.TriggerChannelCount = 0;
tInfo.PowerLineFrequency = 60;
tInfo.EEGPlacementScheme = 'Custom equidistant 128 channel BioSemi montage established in coordination with Judith Schedden McMaster Univertisy';
tInfo.Manufacturer = 'BioSemi';
tInfo.ManufacturersModelName = 'ActiveTwo';
tInfo.HardwareFilters = 'n/a';
tInfo.SoftwareFilters = 'n/a';
tInfo.SoftwareVersions = 'NI ActiView 532-Lores';
tInfo.CapManufacturer = 'ElectroCap International';
tInfo.CapManufacturersModelName = '10032';

% channel location file
% ---------------------
chanlocs = 'sourcedata/misc/BioSemi_BUCANL_EEGLAB.sfp';

% coordsystem string
% This string will be placed in each coordsystem.json
% ---------------------
coordsys = '{"EEGCoordinateSystem":"Other","EEGCoordinateUnits":"metres"}';

% call to the export function
% ---------------------------
bids_export(data, 'targetdir', uigetdir, 'taskName', ...
generalInfo.Name, 'gInfo', generalInfo, 'coordsys', coordsys, ...
'chanlocs', chanlocs, 'README', README, 'bidsOpt', bidsOpt,'tInfo',tInfo);

disp('Done');

% bids_export(data, 'targetdir', '/Users/arno/temp/bids_meditation_export', 'taskName', ...
% 'meditation', 'trialtype', trialTypes, 'gInfo', generalInfo, 'pInfo', pInfo, ...
% 'pInfoDesc', pInfoDesc, 'eInfoDesc', eInfoDesc, 'README', README, ...
% 'CHANGES', CHANGES, 'stimuli', stimuli, 'codefiles', code, 'tInfo', tInfo, 'chanlocs', chanlocs);


% init_bids_sub_script('.','',... 'TaskName', 'FaceHouseCheck', ... 'TaskDescription', 'Visual presentation of oval cropped face and house images both upright and inverted. Rare left or right half oval checkerboards were presetned as targets for keypress response.', ... 'InstitutionName', 'Brock University', ... 'InstitutionAddress', '500 Glenridge Ave, St.Catharines, Ontario', ... 'EOGChannelCount', 7, ... 'EMGChannelCount', 0, ... 'MiscChannelCount', 0, ... 'TriggerChannelCount', 0, ... 'PowerLineFrequency', 60, ... 'EEGPlacementScheme', 'Custom equidistant 128 channel BioSemi montage established in coordination with Judith Schedden McMaster Univertisy', ... 'Manufacturer', 'BioSemi', ... 'ManufacturersModelName', 'ActiveTwo', ... 'HardwareFilters', 'n/a', ... 'SoftwareFilters', 'n/a', ... 'SoftwareVersions', 'NI ActiView 532-Lores', ... 'CapManufacturer', 'ElectroCap International', ... 'CapManufacturersModelName', '10032');

63 changes: 63 additions & 0 deletions eeg_face13/code/BIDS-Init-Face13-EEGLAB/bids_face13_min.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
% Preface:

% Global settings
bidsOpt.FileExt = 'edf';
bidsOpt.InteralUse = true;

data(1).file = {'./sourcedata/eeg/sub-s01_task-faceFO_eeg.set'};
data(1).session = 1;
data(1).run = 1;

% general information for dataset_description.json file
% -----------------------------------------------------
generalInfo.Name = 'faceFO';
generalInfo.License = 'ODbL (https://opendatacommons.org/licenses/odbl/summary/)';
generalInfo.Authors = {'James A. Desjardins', 'Sidney J. Segalowitz'};
generalInfo.HowToAcknowledge = 'Desjardins, J. A., & Segalowitz, S. J. (2013). Deconstructing the early visual electrocortical responses to face and house stimuli. Journal of Vision, 13(5), 22-22.';
generalInfo.Funding = {'NSERC funding to Sidney Segalowitz'};
generalInfo.ReferencesAndLinks = {'http://jov.arvojournals.org/article.aspx?articleid=2121634'};
generalInfo.DatasetDOI = '10.1167/13.5.22';

README = sprintf('# Face13 Dataset\n\nData used for JofV Deconstructing the early visual electrocortical response to face and house stimuli:\nhttps://jov.arvojournals.org/article.aspx?articleid=2121634');

% Task information for xxxx-eeg.json file
% -----------------------------------------------------
tInfo.TaskName = 'FaceHouseCheck';
tInfo.TaskDescription = 'Visual presentation of oval cropped face and house images both upright and inverted. Rare left or right half oval checkerboards were presetned as targets for keypress response.';
tInfo.InstitutionName = 'Brock University';
tInfo.InstitutionAddress = '500 Glenridge Ave, St.Catharines, Ontario';
tInfo.EOGChannelCount = 7;
tInfo.EMGChannelCount = 0;
tInfo.MiscChannelCount = 0;
tInfo.TriggerChannelCount = 0;
tInfo.PowerLineFrequency = 60;
tInfo.EEGPlacementScheme = 'Custom equidistant 128 channel BioSemi montage established in coordination with Judith Schedden McMaster Univertisy';
tInfo.Manufacturer = 'BioSemi';
tInfo.ManufacturersModelName = 'ActiveTwo';
tInfo.HardwareFilters = 'n/a';
tInfo.SoftwareFilters = 'n/a';
tInfo.SoftwareVersions = 'NI ActiView 532-Lores';
tInfo.CapManufacturer = 'ElectroCap International';
tInfo.CapManufacturersModelName = '10032';

% channel location file
% ---------------------
chanlocs = './sourcedata/misc/BioSemi_BUCANL_EEGLAB.sfp';

% coordsystem string
% This string will be placed in each coordsystem.json
% ---------------------
coordsys = '{"EEGCoordinateSystem":"Other","EEGCoordinateUnits":"metres"}';

% call to the export function
% ---------------------------
bids_export(data, 'targetdir', uigetdir, 'taskName', ...
generalInfo.Name, 'gInfo', generalInfo, 'coordsys', coordsys, ...
'chanlocs', chanlocs, 'README', README, 'bidsOpt', bidsOpt,'tInfo',tInfo);

disp('Done!');

% bids_export(data, 'targetdir', '/Users/arno/temp/bids_meditation_export', 'taskName', ...
% 'meditation', 'trialtype', trialTypes, 'gInfo', generalInfo, 'pInfo', pInfo, ...
% 'pInfoDesc', pInfoDesc, 'eInfoDesc', eInfoDesc, 'README', README, ...
% 'CHANGES', CHANGES, 'stimuli', stimuli, 'codefiles', code, 'tInfo', tInfo, 'chanlocs', chanlocs);
126 changes: 126 additions & 0 deletions eeg_face13/code/BIDS-Init-Face13-EEGLAB/eeg_init.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
function eeg_init(inbdffiles,outsetfile)

%loop through inbdffiles
for i=1:length(inbdffiles);
%import bdf file
ALLEEG(i) = pop_biosig(inbdffiles{i}, 'channels', 1:128 );

%resample to 512
ALLEEG(i) = pop_resample( ALLEEG(i), 512);
end

%merge files
EEG = pop_mergeset( ALLEEG, 1:length(ALLEEG), 0);

%load average BUCANL BioSemi head channel coordinates
EEG=pop_chanedit(EEG, 'load',{'sourcedata/misc/BioSemi_BUCANL_EEGLAB.sfp' 'filetype' 'autodetect'});

% Make sure each channel has the EEG type written in it for future BIDS
for i=1:length(EEG.chanlocs)
EEG.chanlocs(i).type = 'eeg';
end

%rename events
for i=1:length(EEG.event);
if isnumeric(EEG.event(i).type);
EEG.event(i).type=num2str(EEG.event(i).type);
end
if strcmp(EEG.event(i).type,'11');
EEG.event(i).type='house-upright-f1';
elseif strcmp(EEG.event(i).type,'12');
EEG.event(i).type='house-upright-f2';
elseif strcmp(EEG.event(i).type,'13');
EEG.event(i).type='house-upright-f3';
elseif strcmp(EEG.event(i).type,'14');
EEG.event(i).type='house-upright-f4';
elseif strcmp(EEG.event(i).type,'15');
EEG.event(i).type='house-upright-f5';
elseif strcmp(EEG.event(i).type,'16');
EEG.event(i).type='house-upright-f6';
elseif strcmp(EEG.event(i).type,'21');
EEG.event(i).type='house-inverted-f1';
elseif strcmp(EEG.event(i).type,'22');
EEG.event(i).type='house-inverted-f2';
elseif strcmp(EEG.event(i).type,'23');
EEG.event(i).type='house-inverted-f3';
elseif strcmp(EEG.event(i).type,'24');
EEG.event(i).type='house-inverted-f4';
elseif strcmp(EEG.event(i).type,'25');
EEG.event(i).type='house-inverted-f5';
elseif strcmp(EEG.event(i).type,'26');
EEG.event(i).type='house-inverted-f6';
elseif strcmp(EEG.event(i).type,'31');
EEG.event(i).type='face-upright-f1';
elseif strcmp(EEG.event(i).type,'32');
EEG.event(i).type='face-upright-f2';
elseif strcmp(EEG.event(i).type,'33');
EEG.event(i).type='face-upright-f3';
elseif strcmp(EEG.event(i).type,'34');
EEG.event(i).type='face-upright-f4';
elseif strcmp(EEG.event(i).type,'35');
EEG.event(i).type='face-upright-f5';
elseif strcmp(EEG.event(i).type,'36');
EEG.event(i).type='face-upright-f6';
elseif strcmp(EEG.event(i).type,'41');
EEG.event(i).type='face-inverted-f1';
elseif strcmp(EEG.event(i).type,'42');
EEG.event(i).type='face-inverted-f2';
elseif strcmp(EEG.event(i).type,'43');
EEG.event(i).type='face-inverted-f3';
elseif strcmp(EEG.event(i).type,'44');
EEG.event(i).type='face-inverted-f4';
elseif strcmp(EEG.event(i).type,'45');
EEG.event(i).type='face-inverted-f5';
elseif strcmp(EEG.event(i).type,'46');
EEG.event(i).type='face-inverted-f6';
elseif strcmp(EEG.event(i).type,'51');
EEG.event(i).type='checker-f1';
elseif strcmp(EEG.event(i).type,'52');
EEG.event(i).type='checker-f2';
elseif strcmp(EEG.event(i).type,'53');
EEG.event(i).type='checker-f3';
elseif strcmp(EEG.event(i).type,'54');
EEG.event(i).type='checker-f4';
elseif strcmp(EEG.event(i).type,'55');
EEG.event(i).type='checker-f5';
elseif strcmp(EEG.event(i).type,'56');
EEG.event(i).type='checker-f6';
elseif strcmp(EEG.event(i).type,'211');
EEG.event(i).type='face-upright';
elseif strcmp(EEG.event(i).type,'212');
EEG.event(i).type='face-inverted';
elseif strcmp(EEG.event(i).type,'213');
EEG.event(i).type='house-upright';
elseif strcmp(EEG.event(i).type,'214');
EEG.event(i).type='house-inverted';
elseif strcmp(EEG.event(i).type,'215');
EEG.event(i).type='checker-left';
elseif strcmp(EEG.event(i).type,'216');
EEG.event(i).type='checker-right';
elseif strcmp(EEG.event(i).type,'201');
EEG.event(i).type='press-left';
elseif strcmp(EEG.event(i).type,'204');
EEG.event(i).type='press-right';
elseif strcmp(EEG.event(i).type,'boundary');
EEG.event(i).duration=0;
else
EEG.event(i).type=['e-',num2str(EEG.event(i).type)];
end
end

% Special casing for parallel port issue
if strcmp(outsetfile,'sourcedata/eeg/sub-s07_task-faceFO_eeg.set')
eind=find([EEG.event.latency]>789010 & [EEG.event.latency]<828844);
reAccum = [];
for i=1:length(eind)
if ~strcmp(EEG.event(eind(i)).type,'boundary')
reAccum = [reAccum; eind(i)];
end
end
EEG.event(reAccum) = [];
end

%save output set file
EEG = pop_saveset( EEG, 'filename',outsetfile);


Loading

0 comments on commit 9893043

Please sign in to comment.