forked from BUNPC/AtlasViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetpaths.m
More file actions
116 lines (97 loc) · 3.09 KB
/
Copy pathgetpaths.m
File metadata and controls
116 lines (97 loc) · 3.09 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
function [paths, wspaths, paths_excl_str] = getpaths(options)
DEBUG = 0;
paths = {...
'/'; ...
'/Install'; ...
'/Axesv'; ...
'/Data'; ...
'/Data/Colin'; ...
'/Digpts'; ...
'/Digpts/Headsize'; ...
'/ForwardModel'; ...
'/ForwardModel/tMCimg'; ...
'/ForwardModel/tMCimg/bin/Darwin'; ...
'/ForwardModel/tMCimg/bin/Linux'; ...
'/ForwardModel/tMCimg/bin/Win'; ...
'/Group'; ...
'/Group/DataTree/'; ...
'/Group/DataTree/AcquiredData'; ...
'/Group/DataTree/AcquiredData/DataFiles'; ...
'/Group/DataTree/AcquiredData/DataFiles/Hdf5'; ...
'/Group/DataTree/AcquiredData/Snirf'; ...
'/Group/DataTree/ProcStream'; ...
'/Group/FuncRegistry'; ...
'/Guiobj'; ...
'/HbConc'; ...
'/Headsurf'; ...
'/Headvol'; ...
'/ImgRecon'; ...
'/Labelssurf'; ...
'/Pialsurf'; ...
'/Pialvol'; ...
'/Probe'; ...
'/Probe/NIRS_Probe_Designer_V1'; ...
'/Probe/NIRS_Probe_Designer_V1/functions'; ...
'/Probe/registerDigpts'; ...
'/Probe/registerSprings'; ...
'/Probe/SDgui'; ...
'/Probe/SDgui/lambda'; ...
'/Probe/SDgui/optode_tbls'; ...
'/Probe/SDgui/optode_tbls2'; ...
'/Probe/SDgui/probe_geometry_axes'; ...
'/Probe/SDgui/probe_geometry_axes2'; ...
'/Probe/SDgui/sample_data'; ...
'/Probe/SDgui/sd_data'; ...
'/Probe/SDgui/sd_file'; ...
'/Probe/SDgui/utils'; ...
'/Refpts'; ...
'/Utils'; ...
'/Utils/fs2viewer'; ...
'/freesurfer'; ...
'/iso2mesh'; ...
'/iso2mesh/bin'; ...
'/metch'; ...
};
wspaths = {};
paths_excl_str = {};
if options.conflcheck
% Get all workspace paths that have similar functions sets with current applications
appmainfunc = {'AtlasViewerGUI.m','Homer2_UI.m','Homer3.m','brainScape.m','AcqDataClass.m'};
kk=1;
wsidx = [];
for ii=1:length(appmainfunc)
while 1
[paths_excl, foo] = getactivewspace(appmainfunc{ii});
if isempty(paths_excl)
break;
end
wspaths{kk,1} = foo;
if pathscompare(wspaths{kk}, pwd)
wsidx = kk;
end
paths_excl_str{kk} = '';
for jj=1:length(paths_excl)
if DEBUG
fprintf('Removing path %s\n', paths_excl{jj});
end
if isempty(paths_excl_str{kk})
paths_excl_str{kk} = paths_excl{jj};
else
paths_excl_str{kk} = [paths_excl_str{kk}, delimiter, paths_excl{jj}];
end
end
rmpath(paths_excl_str{kk});
kk=kk+1;
end
end
% Change the order of precedence of all the conflicting workspaces to
% the current one as primary workspace
if ~isempty(wsidx)
strtmp = wspaths{1};
celltmp = paths_excl_str{1};
wspaths{1} = wspaths{wsidx};
paths_excl_str{1} = paths_excl_str{wsidx};
wspaths{wsidx} = strtmp;
paths_excl_str{wsidx} = celltmp;
end
end