Skip to content

Commit f93daa7

Browse files
authored
Merge pull request #111 from cpp-lln-lab/bids_matlab
[MAINT] use bids matlab main (remove atlas entity), update RTD config
2 parents 5334bc5 + ddeb124 commit f93daa7

21 files changed

+43
-36
lines changed

.readthedocs.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
# Required
77
version: 2
88

9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: '3.12'
13+
914
# Build documentation in the docs/ directory with Sphinx
1015
sphinx:
1116
configuration: docs/source/conf.py
@@ -14,6 +19,5 @@ sphinx:
1419

1520
# Optionally set the version of Python and requirements required to build your docs
1621
python:
17-
version: '3.8'
1822
install:
1923
- requirements: requirements.txt

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ clean_lib:
88
rm -rf lib/bids-matlab
99

1010
install_dev:
11-
git clone https://github.com/bids-standard/bids-matlab.git --branch dev --depth 1 lib/bids-matlab
11+
git clone https://github.com/bids-standard/bids-matlab.git --branch main --depth 1 lib/bids-matlab
1212

1313
version.txt: CITATION.cff
1414
grep -w "^version" CITATION.cff | sed "s/version: /v/g" > version.txt

src/atlas/copyAtlasToSpmDir.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,22 @@ function copyAtlasToSpmDir(varargin)
9494
sourceAtlasXml = fullfile(returnAtlasDir(), 'HCPex.xml');
9595

9696
case 'visfatlas'
97-
sourceAtlasImage = fullfile(returnAtlasDir(atlas), 'space-MNI_atlas-visfAtlas_dseg.nii');
98-
sourceAtlasXml = fullfile(returnAtlasDir(atlas), 'space-MNI_atlas-visfAtlas_dseg.xml');
97+
sourceAtlasImage = fullfile(returnAtlasDir(atlas), 'space-MNI_seg-visfAtlas_dseg.nii');
98+
sourceAtlasXml = fullfile(returnAtlasDir(atlas), 'space-MNI_seg-visfAtlas_dseg.xml');
9999

100100
case 'glasser'
101101

102102
sourceAtlasImage = fullfile(returnAtlasDir(atlas), ...
103-
'space-MNI152ICBM2009anlin_atlas-glasser_dseg.nii');
103+
'space-MNI152ICBM2009anlin_seg-glasser_dseg.nii');
104104
sourceAtlasXml = fullfile(returnAtlasDir(atlas), ...
105-
'space-MNI152ICBM2009anlin_atlas-glasser_dseg.xml');
105+
'space-MNI152ICBM2009anlin_seg-glasser_dseg.xml');
106106

107107
case 'wang'
108108
sourceAtlasImage = fullfile(returnAtlasDir(atlas), ...
109109
'subj_vol_all', ...
110-
'space-MNI_atlas-wang_dseg.nii');
110+
'space-MNI_seg-wang_dseg.nii');
111111
sourceAtlasXml = fullfile(returnAtlasDir(), ...
112-
'space-MNI_atlas-wang_dseg.xml');
112+
'space-MNI_seg-wang_dseg.xml');
113113

114114
otherwise
115115
error(['Only the following atlases can be copied to SPM atlas folder:\n', ...

src/atlas/extractRoiFromAtlas.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
% rename file
123123
entities = struct('hemi', hemisphere, ...
124124
'space', 'MNI', ...
125-
'atlas', lower(atlasName), ...
125+
'seg', lower(atlasName), ...
126126
'label', roiName);
127127
nameStructure = struct('entities', entities, ...
128128
'suffix', 'mask', ...

src/atlas/getAtlasFilename.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939

4040
case 'visfatlas'
4141

42-
atlasFilename = fullfile(atlasDir, 'space-MNI_atlas-visfAtlas_dseg.nii');
42+
atlasFilename = fullfile(atlasDir, 'space-MNI_seg-visfAtlas_dseg.nii');
4343

4444
case 'hcpex'
4545

4646
atlasFilename = fullfile(atlasDir, 'HCPex.nii');
4747

4848
case 'glasser'
4949

50-
atlasFilename = fullfile(atlasDir, 'space-MNI152ICBM2009anlin_atlas-glasser_dseg.nii');
50+
atlasFilename = fullfile(atlasDir, 'space-MNI152ICBM2009anlin_seg-glasser_dseg.nii');
5151

5252
end
5353

src/atlas/getLookUpTable.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
roiLabelLUT = fullfile(atlasDir, 'Anatomy_v22c_MPM.txt');
4242

4343
if ~exist(roiLabelLUT, 'file')
44-
error('Did you install the spm Anatomy toolbox?\n\nDownload it from: %s', ...
44+
error(['Could not find look up table: %s.\n'...
45+
'Did you install the spm Anatomy toolbox?\n\n', ...
46+
'Download it from: %s'], ...
47+
roiLabelLUT, ...
4548
anat_tb_URL);
4649
end
4750

src/atlas/unzipAtlas.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ function unzipAtlas(atlas)
3030
end
3131

3232
case 'glasser'
33-
file = fullfile(atlasDir, 'Glasser', 'space-MNI152ICBM2009anlin_atlas-glasser_dseg.nii');
33+
file = fullfile(atlasDir, 'Glasser', 'space-MNI152ICBM2009anlin_seg-glasser_dseg.nii');
3434
gunzipAtlasIfNecessary(file);
3535

3636
case 'visfatlas'
37-
file = fullfile(atlasDir, 'visfAtlas', 'space-MNI_atlas-visfAtlas_dseg.nii');
37+
file = fullfile(atlasDir, 'visfAtlas', 'space-MNI_seg-visfAtlas_dseg.nii');
3838
gunzipAtlasIfNecessary(file);
3939

4040
case 'hcpex'

src/roi/createRoi.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333
%
3434
% :roiImage: - :string: fullpath of the roi image for ``'mask'``
3535
%
36-
% :sphere: - :structure: defines the charateristic for ``'sphere'``
36+
% :sphere: - :structure: defines the characteristic for ``'sphere'``
3737
% - ``sphere.location``: X Y Z coordinates in millimeters
3838
% - ``spehere.radius``: radius in millimeters
3939
%
40-
% :specification: - :structure: defines the charateristic for ``'intersection'`` and ``'expand'``
40+
% :specification: - :structure: defines the characteristic for ``'intersection'`` and ``'expand'``
4141
% - ``sphere.location``: X Y Z coordinates in millimeters
4242
% - ``sphere.radius``: radius in millimeters
4343
%

src/roi/renameNeuroSynth.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
parts = strsplit(basename, '_');
4242

43-
p.entities.atlas = 'neurosynth';
43+
p.entities.seg = 'neurosynth';
4444

4545
p.entities.label = bids.internal.camel_case(parts{1});
4646

tests/test_copyAtlasToSpmDir.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function test_copyAtlasToSpmDir_wang()
1212
copyAtlasToSpmDir('wang', 'verbose', false);
1313

1414
targetAtlasImage = fullfile(spmAtlasDir(), ...
15-
'space-MNI_atlas-wang_dseg.nii');
15+
'space-MNI_seg-wang_dseg.nii');
1616
targetAtlasXml = fullfile(spmAtlasDir(), ...
17-
'space-MNI_atlas-wang_dseg.xml');
17+
'space-MNI_seg-wang_dseg.xml');
1818

1919
assertEqual(exist(targetAtlasImage, 'file'), 2);
2020
assertEqual(exist(targetAtlasXml, 'file'), 2);
@@ -28,9 +28,9 @@ function test_copyAtlasToSpmDir_visfatlas()
2828
copyAtlasToSpmDir('visfatlas', 'verbose', false);
2929

3030
targetAtlasImage = fullfile(spmAtlasDir(), ...
31-
'space-MNI_atlas-visfAtlas_dseg.nii');
31+
'space-MNI_seg-visfAtlas_dseg.nii');
3232
targetAtlasXml = fullfile(spmAtlasDir(), ...
33-
'space-MNI_atlas-visfAtlas_dseg.xml');
33+
'space-MNI_seg-visfAtlas_dseg.xml');
3434

3535
assertEqual(exist(targetAtlasImage, 'file'), 2);
3636
assertEqual(exist(targetAtlasXml, 'file'), 2);
@@ -44,9 +44,9 @@ function test_copyAtlasToSpmDir_glasser()
4444
copyAtlasToSpmDir('Glasser', 'verbose', false);
4545

4646
targetAtlasImage = fullfile(spmAtlasDir(), ...
47-
'space-MNI152ICBM2009anlin_atlas-glasser_dseg.nii');
47+
'space-MNI152ICBM2009anlin_seg-glasser_dseg.nii');
4848
targetAtlasXml = fullfile(spmAtlasDir(), ...
49-
'space-MNI152ICBM2009anlin_atlas-glasser_dseg.xml');
49+
'space-MNI152ICBM2009anlin_seg-glasser_dseg.xml');
5050

5151
assertEqual(exist(targetAtlasImage, 'file'), 2);
5252
assertEqual(exist(targetAtlasXml, 'file'), 2);

tests/test_createRoi.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function test_createRoi_intersection_mask_sphere()
4949

5050
mask = createRoi('intersection', specification, volumeDefiningImage, outputDir, saveImg);
5151

52-
basename = 'space-MNI_atlas-neurosynth_label-visualMotionIntersection_desc-p10pt00_mask';
52+
basename = 'space-MNI_seg-neurosynth_label-visualMotionIntersection_desc-p10pt00_mask';
5353

5454
assertEqual(exist(fullfile(thisDir(), [basename '.nii']), 'file'), 2);
5555
assertEqual(exist(fullfile(thisDir(), [basename '.json']), 'file'), 2);
@@ -75,7 +75,7 @@ function test_createRoi_intersection_mask_sphere()
7575

7676
mask = createRoi('expand', specification, volumeDefiningImage, outputDir, saveImg);
7777

78-
basename = 'space-MNI_atlas-neurosynth_label-visualMotionExpandVox57_desc-p10pt00_mask';
78+
basename = 'space-MNI_seg-neurosynth_label-visualMotionExpandVox57_desc-p10pt00_mask';
7979

8080
assertEqual(mask.roi.size, 57);
8181

tests/test_extractRoiFromAtlas.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function test_extractRoiFromAtlas_glasser()
1212

1313
roiImage = extractRoiFromAtlas(pwd, 'Glasser', 'FEF', 'L');
1414

15-
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_atlas-glasser_label-FEF_mask.nii'), ...
15+
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_seg-glasser_label-FEF_mask.nii'), ...
1616
'file'), ...
1717
2);
1818

@@ -28,7 +28,7 @@ function test_extractRoiFromAtlas_wang()
2828

2929
roiImage = extractRoiFromAtlas(pwd, 'wang', 'V1v', 'L');
3030

31-
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_atlas-wang_label-V1v_mask.nii'), ...
31+
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_seg-wang_label-V1v_mask.nii'), ...
3232
'file'), ...
3333
2);
3434

@@ -45,7 +45,7 @@ function test_extractRoiFromAtlas_neuromorphometrics()
4545
roiImage = extractRoiFromAtlas(pwd, 'neuromorphometrics', 'Amygdala', 'L');
4646

4747
assertEqual(exist(fullfile(pwd, ...
48-
'hemi-L_space-MNI_atlas-neuromorphometrics_label-Amygdala_mask.nii'), ...
48+
'hemi-L_space-MNI_seg-neuromorphometrics_label-Amygdala_mask.nii'), ...
4949
'file'), ...
5050
2);
5151

@@ -61,7 +61,7 @@ function test_extractRoiFromAtlas_visfAtlas()
6161

6262
roiImage = extractRoiFromAtlas(pwd, 'visfatlas', 'pFus', 'L');
6363

64-
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_atlas-visfatlas_label-pFus_mask.nii'), ...
64+
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_seg-visfatlas_label-pFus_mask.nii'), ...
6565
'file'), ...
6666
2);
6767

@@ -79,7 +79,7 @@ function test_extractRoiFromAtlas_hcpex()
7979

8080
roiImage = extractRoiFromAtlas(pwd, 'hcpex', 'MT', 'L');
8181

82-
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_atlas-hcpex_label-MT_mask.nii'), ...
82+
assertEqual(exist(fullfile(pwd, 'hemi-L_space-MNI_seg-hcpex_label-MT_mask.nii'), ...
8383
'file'), ...
8484
2);
8585

tests/test_keepHemisphere.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function test_keepHemisphere_basic()
2121
leftRoiImage = keepHemisphere(zMap, 'L');
2222
rightRoiImage = keepHemisphere(zMap, 'R');
2323

24-
basename = 'space-MNI_atlas-neurosynth_label-visualMotion_probseg.nii';
24+
basename = 'space-MNI_seg-neurosynth_label-visualMotion_probseg.nii';
2525

2626
assertEqual(exist(fullfile(inputDir, 'inputs', ...
2727
['hemi-L_' basename]), ...

tests/test_labelClusters.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
labeledClusters = labelClusters(zMap, peakThreshold, extendThreshold);
2020

21-
expected = 'space-MNI_atlas-neurosynth_label-visualMotion_dseg.nii';
21+
expected = 'space-MNI_seg-neurosynth_label-visualMotion_dseg.nii';
2222
assertEqual(exist(fullfile(demoDir(), expected), 'file'), 2);
2323

2424
labelStruct = struct('ROI', 'ns left MT', ...
2525
'label', 1);
2626

2727
roiName = extractRoiByLabel(labeledClusters, labelStruct);
2828

29-
expected = 'space-MNI_atlas-neurosynth_label-nsLeftMT_mask.nii';
29+
expected = 'space-MNI_seg-neurosynth_label-nsLeftMT_mask.nii';
3030
assertEqual(exist(fullfile(demoDir(), expected), 'file'), 2);
3131

3232
end

tests/test_unit_renameNeuroSynth.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function test_renameNeuroSynth()
2727

2828
outputImage = renameNeuroSynth(inputImage);
2929

30-
expected = fullfile(pwd, 'space-MNI_atlas-neurosynth_label-motion_probseg.nii.gz');
30+
expected = fullfile(pwd, 'space-MNI_seg-neurosynth_label-motion_probseg.nii.gz');
3131
assertEqual(exist(outputImage, 'file'), 2);
3232

3333
assertEqual(outputImage, expected);
@@ -43,7 +43,7 @@ function test_renameNeuroSynth_unzipped()
4343

4444
outputImage = renameNeuroSynth(inputImage);
4545

46-
expected = fullfile(pwd, 'space-MNI_atlas-neurosynth_label-motion_probseg.nii');
46+
expected = fullfile(pwd, 'space-MNI_seg-neurosynth_label-motion_probseg.nii');
4747
assertEqual(exist(outputImage, 'file'), 2);
4848

4949
assertEqual(outputImage, expected);

tests/test_unzipAtlas.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function test_unzipAtlas_glasser()
1313
unzipAtlas('Glasser');
1414

1515
expectedFile = fullfile(returnAtlasDir('Glasser'), ...
16-
'space-MNI152ICBM2009anlin_atlas-glasser_dseg.nii');
16+
'space-MNI152ICBM2009anlin_seg-glasser_dseg.nii');
1717

1818
assertEqual(exist(expectedFile, 'file'), 2);
1919

0 commit comments

Comments
 (0)