-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunchSPM.m
More file actions
30 lines (24 loc) · 811 Bytes
/
Copy pathlaunchSPM.m
File metadata and controls
30 lines (24 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%% add SPM path correctly
% check which mac we are using to get the correct username
whichMac = char(java.lang.System.getProperty('user.name'));
if strcmpi(whichMac,'spmic')
spmdir = '/Users/spmic/Documents/MATLAB/spm/';
elseif strcmpi(whichMac,'ppzma')
spmdir = '/Users/ppzma/Documents/spm12/';
else
error('this is setup for ppzma or spmic - check username in launchSPM.m')
end
fprintf('\nSPM12 dir is: %s\n',spmdir)
% check if spm path is already loaded, otherwise remove it and relaunch it
pathCell = regexp(path, pathsep, 'split');
onPath = any(contains(pathCell,spmdir));
if onPath == 1
spm_rmpath
end
% addpaths
addpath(spmdir)
addpath(genpath([spmdir 'toolbox/ArtRepair']));
%addpath(genpath([spmdir 'toolbox/jubrain-anatomy-toolbox']));
disp('adding spm path')
% now launch it
spm