|
15 | 15 | % PMID: 25452571 |
16 | 16 | % Probabilistic Maps of Visual Topography in Human Cortex |
17 | 17 | % |
18 | | - % If the data is not present in the ``cpp_spm/atlas/ProbAtlas_v4`` of the repo, it will be |
19 | | - % downloaded and unzipped |
20 | 18 |
|
21 | | - README_URL = 'http://scholar.princeton.edu/sites/default/files/napl/files/readme.txt'; |
22 | | - ATLAS_URL = 'http://scholar.princeton.edu/sites/default/files/napl/files/probatlas_v4.zip'; |
| 19 | + unzipAtlas('wang'); |
23 | 20 |
|
24 | | - ATLAS_FOLDER = fullfile( ... |
25 | | - fileparts(mfilename('fullpath')), ... |
26 | | - '..', '..', 'atlas'); |
| 21 | + atlasDir = returnAtlasDir('wang'); |
27 | 22 |
|
28 | | - if ~exist(fullfile(ATLAS_FOLDER, 'ProbAtlas_v4'), 'dir') |
| 23 | + maxProbaFiles = spm_select('FPList', fullfile(atlasDir, 'subj_vol_all'), '^.*_dseg.nii$'); |
29 | 24 |
|
30 | | - mkdir(ATLAS_FOLDER); |
31 | | - |
32 | | - try |
33 | | - urlwrite(ATLAS_URL, 'probatlas_v4.zip'); |
34 | | - unzip('probatlas_v4.zip', ATLAS_FOLDER); |
35 | | - catch |
36 | | - system(sprintf('curl -L %s -o probatlas_v4.zip', ATLAS_URL)); |
37 | | - unzip('probatlas_v4.zip', ATLAS_FOLDER); |
38 | | - end |
39 | | - |
40 | | - end |
41 | | - |
42 | | - % urlwrite(README_URL, fullfile(ATLAS_FOLDER, 'ProbAtlas_v4', 'README.txt')); |
43 | | - % urlread(README_URL) |
44 | | - |
45 | | - maxProbaFiles = spm_select('FPListRec', ... |
46 | | - fullfile(ATLAS_FOLDER, 'ProbAtlas_v4'), ... |
47 | | - '^max.*.nii$'); |
48 | | - |
49 | | - if size(maxProbaFiles, 1) < 2 |
50 | | - |
51 | | - gunzip(fullfile(pwd, 'atlas', 'ProbAtlas_v4', 'subj_vol_all', 'max*.nii.gz')); |
52 | | - |
53 | | - maxProbaFiles = spm_select('FPListRec', ... |
54 | | - fullfile(ATLAS_FOLDER, 'ProbAtlas_v4'), ... |
55 | | - '^max.*.nii$'); |
56 | | - |
57 | | - end |
58 | | - |
59 | | - if size(maxProbaFiles, 1) < 2 |
60 | | - error('no atlas present'); |
61 | | - end |
62 | | - |
63 | | - % the label file was created manually to be easier to load into SPM |
64 | | - roiLabels = spm_load(spm_select('FPListRec', ... |
65 | | - fullfile(ATLAS_FOLDER), ... |
66 | | - '^ROI_labels_ProbAtlas_v4.csv$')); |
| 25 | + roiLabels = getRoiLabelLookUpTable('wang'); |
67 | 26 |
|
68 | 27 | end |
0 commit comments