Skip to content

Commit

Permalink
Merge pull request #27 from thomas-vincent/fix_csaps
Browse files Browse the repository at this point in the history
Add more checks & warnings about csaps
  • Loading branch information
thomas-vincent authored May 8, 2018
2 parents 17dadc8 + db3b8d3 commit d3a6188
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bst_plugin/process_nst_get_data_perform_2018.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
bst_error('Fluence data installation failed');
end

bst_progress('start', 'Check dependencies', 'Checking dependencies...', 1, 2);
bst_progress('start', 'Check dependencies', 'Checking dependencies...', 1, 3);
%% Check CPLEX
try
cplx = Cplex();
Expand All @@ -178,7 +178,13 @@
if ~license('test', 'Curve_Fitting_Toolbox')
bst_report('Warning', sProcess, sInputs, 'Curve Fitting Toolbox not available. Motion correction will not work.');
else
bst_report('Info', sProcess, sInputs, 'Curve Fitting Toolbox found');
if isempty(which('csaps'))
bst_report('Warning', sProcess, sInputs, ...
['Curve Fitting Toolbox OK but function csaps not found.<BR>' ...
'Try refreshing matlab cache using command: rehash toolboxcache']);
else
bst_report('Info', sProcess, sInputs, 'Curve Fitting Toolbox found');
end
end
bst_progress('inc', 1);

Expand Down
10 changes: 10 additions & 0 deletions bst_plugin/process_nst_motion_correction.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@

%% ===== RUN =====
function OutputFile = Run(sProcess, sInputs) %#ok<DEFNU>
OutputFile = {};

if ~license('test', 'Curve_Fitting_Toolbox')
bst_error('Curve Fitting Toolbox not available');
return
elseif isempty(which('csaps'))
bst_error(['Curve Fitting Toolbox OK but function csaps not found.<BR>' ...
'Try refreshing matlab cache using command: rehash toolboxcache']);
return
end

% Get selected events
event_name = strtrim(sProcess.options.option_event_name.Value);
Expand Down

0 comments on commit d3a6188

Please sign in to comment.