function main(model,task,subtask)
disp('RUN');
switch task
case 'pre'
preprocess(model,subtask);
case 'decode'
decode(model,subtask);
case 'plot'
decode_plot(model,subtask);
end
end
% disp('all warnings OFF')
% warn = warning('off','all');
function preprocess(model,task)
% parse the GUI and pass parameters as structure
timeLine = getTimeLineParams(model);
subjects = getSubjectCellList(model);
classDef = parseClassDef(model);
mask = ['^' cell2mat(getImageFileMask(model)) '.*\.img$'];
psthOpts = struct;
psthOpts.colBias = getColumnBiasRemoveOption(model);
psthOpts.psthNorm = getPsthNormalizationMethod(model);
switch task
case 'COORD'
disp('COORD');
out = struct;
out.header = struct;
out.header.type = 'COORD';
out.header.timeline = timeLine;
out.header.classDef = classDef;
coordargs = struct;
coordargs.subjects = subjects;
coordargs.timeline = timeLine;
coordargs.basedir = model.baseDir;
coordargs.sessionList = 1:3;
coordargs.eventList = classDef.eventMatrix;
coordargs.coords = parseCoordinateTextField(model);
coordargs.mask = mask;
coordargs.psthOpts = psthOpts;
out.subjectdata = runCoordTable(coordargs);