Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
function BIDS = make_BIDS(input_dir)
%function BIDS = make_BIDS(input_dir, output_dir)
%
% Prepare datasets for BIDS format
%
% Required fields of make_BIDS:
%
% input_dir - location of the GE data
%
% data must have passed consistency checks using
% consistency.m in MICHA_TEST/FA_consistency
% the script is expecting a file named
% "biomax_out_*_VERIFIED*.txt" or
% "biomax_out_*_MODIFIED*.txt"
% to be present in the subjects main directory
%
% output_dir - location of the final BIDS data
%
%
% structure BIDS
% input.dir - directory with verified data
% e.g. BIDS.input.dir = '/run/media/spectro/DATAPART1/MICHA_TEST/FOR0015'
% input.biomax - biomax_out filename
%
% file history:
% created M. Czisch & F. Binder 7.11.2017
% last modified 31.1.2018 M. Czisch
clear BIDS
BIDS.input.dir = input_dir;
BIDS.output.dir = '';
% have the data being for consistency checked already?
BIDS = check_BIOMAX(BIDS);
% check and prepare temporary BIDS directory structure
pathInfo = what(BIDS.input.dir);
current_dir = pathInfo.path;
BIDS.output.dir = [current_dir,'/BIDS'];
check_BIDS(BIDS.input.dir);
mkdir_BIDS(BIDS.output.dir);
%cd(BIDS.input.dir);
% load and format biomax_out info
biomax = load(BIDS.input.biomax);
biomax_table = array2table(biomax,...
'VariableNames',{'Ser','Log','EDF','PPG','Analyzer','Blood'},...
'RowNames',{'Loc';'T1w';'Cal';'rest1';...
'EPI1';'TET';'FLAIR';'Reward';...
'DTI';'Pepolar';'nback';'Loc2';...
'Cal2';'faces';'EPI2';'rest2';...
'IST';'Loc3';'rest3'});
% read content of GE EXAM and SERIES files
BIDS = read_GE_BIDS(BIDS);
% do the conversion to BIDS format
%convert_GE_BIDS(BIDS, biomax_table);
%cd([BIDS.input.dir]);
% do the conversion of logfiles to BIDS format
convert_LOG_BIDS(BIDS,biomax_table);
%cd([BIDS.input.dir]);
% do tsv conversion of logfiles
Hariri_logfile_bids(BIDS);
NBack_logfile_bids(BIDS);
TET_logfile_bids(BIDS);
% for the IST, this is a bit more tricky due to 2 different versions
% this differentiation is based on Anne Kuehnels script
% 24.1.2018
IST_logfile_bids(BIDS)
cd([BIDS.input.dir]);