-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcvnpath.m
70 lines (66 loc) · 1.97 KB
/
cvnpath.m
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function p = cvnpath(whichpath)
% p = cvnpath(whichpath)
%
% Return the path specified in 'whichpath'
% Hardcode common paths here, then call this function elsewhere to maximize
% flexibility.
%
% Possibilities:
% 'code' (common cvnlab code on Dropbox)
% 'ppresults' (cvnlab pre-processing results on Dropbox)
% 'freesurfer' (FreeSurfer subjects directory)
% 'fmridata' (fmridata directory on stone)
% 'anatomicals' (anatomicals directory on stone)
% 'workbench' (location of HCP wb_command)
%
% eg: fsdir=sprintf('%s/%s',cvnpath('freesurfer'),subjectid)
% instead of hardcoding in every function
%
% Note: If you have /stone/ext1 followed by /home/stone-ext1, this ensures
% that you can access it from any machine, and if we ARE on stone, it
% will use the faster local route /stone/ext1
switch(lower(whichpath))
case 'code'
testpaths={
'/home/stone/generic/Dropbox/cvnlabsmall/code'
};
case 'commonmatlab'
testpaths={
'/home/stone/software/commonmatlabcode'
};
case 'ppresults'
testpaths={
'/home/stone-ext4/generic/cvnlabbig/ppresults'
};
case 'freesurfer'
testpaths={
getenv('SUBJECTS_DIR')
'/stone/ext1/freesurfer/subjects'
'/home/stone-ext1/freesurfer/subjects'
};
case 'fmridata'
testpaths={
'/stone/ext1/fmridata'
'/home/stone-ext1/fmridata'
};
case 'anatomicals'
testpaths={
'/stone/ext1/anatomicals'
'/home/stone-ext1/anatomicals'
};
case 'workbench'
testpaths={
'/home/stone/software/workbench_v1.1.1/bin_rh_linux64'
'/Applications/workbench/bin_macosx64'
};
end
p='';
for i = 1:numel(testpaths)
if(exist(testpaths{i},'dir'))
p=testpaths{i};
break;
end
end
if(isempty(p))
warning('No path found for %s',whichpath);
end