Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHysIO #180 #166: Removing fieldtrip paths instead of spm #181

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PhysIO/code/readin/tapas_physio_read_physlogfiles.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
case 'siemens_hcp'
[c, r, t, cpulse, acq_codes, verbose] = ...
tapas_physio_read_physlogfiles_siemens_hcp(log_files, cardiac_modality, verbose);
otherwise
error('Invalid vendor "%s". See tapas_physio_new for supported vendors',...
nbeliy marked this conversation as resolved.
Show resolved Hide resolved
log_files.vendor);
end

% Do not prepend for Siemens Tics, since can be as long as a day
Expand Down
29 changes: 18 additions & 11 deletions PhysIO/code/tapas_physio_main_create_regressors.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@
%% 0. Set Default parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Remove SPM subfolders from path to avoid conflicts with Matlab in-built
% functions used in PhysIO
doCorrectPath = true;
tapas_physio_check_spm(doCorrectPath);
% Silently check proper Batch Editor integration, if SPM exists,
% but don't complain, if there is no SPM installed
isVerbose = false;
tapas_physio_check_spm_batch_editor_integration(isVerbose);
oldPath = path();

% Include subfolders of code to path as well
pathThis = fileparts(mfilename('fullpath'));
addpath(genpath(pathThis));
ft_paths = which('ft_defaults', '-all')
nbeliy marked this conversation as resolved.
Show resolved Hide resolved

try
for p = 1:size(ft_paths, 1)
to_remove = fileparts(ft_paths{p});
warning('off', 'MATLAB:rmpath:DirNotFound')
rmpath(genpath(to_remove));
warning('on', 'MATLAB:rmpath:DirNotFound')
end
ft_paths = which('ft_defaults', '-all')

% These parameters could become toolbox inputs...
minConstantIntervalAlertSeconds = 0.2;
Expand Down Expand Up @@ -448,6 +449,12 @@

[physio.verbose] = tapas_physio_print_figs_to_file(physio.verbose);

catch ME
path(oldPath);
rethrow(ME);
end
path(oldPath);

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand All @@ -459,4 +466,4 @@
R = [R, regressors];
names = [names, repmat({name}, 1, size(regressors, 2))];

end
end