Skip to content

Commit 24539c4

Browse files
committed
update to keep track of the last version of bids-matlab
1 parent 2cc9a6c commit 24539c4

22 files changed

+85
-156
lines changed

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
7272
- name: Run tests
7373
run: |
74-
octave $OCTFLAGS --eval "runTests"
74+
octave $OCTFLAGS --eval "run_tests"
7575
cat test_report.log | grep 0
7676
bash <(curl -s https://codecov.io/bash)
7777

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ envs/*
2020
# visual studio code stuff
2121
.vscode
2222

23-
23+
demos/*/*.json
24+
demos/*/*/*.json
25+
demos/*/derivatives
2426

2527

2628

demos/atlas/create_roi_from_atlas.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
% (C) Copyright 2021 CPP ROI developers
2+
13
opt.roi.atlas = 'wang';
24
opt.roi.name = {'V1v', 'V1d'};
35
opt.roi.dir = fullfile(pwd, 'derivatives', 'cpp_roi', 'group');

demos/roi/other_demo.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
% change the label entity and remove the hs one
1616
leftRoiImage = renameFile(leftRoiImage, ...
17-
struct('label', 'ns left motion', ...
18-
'hs', ''));
17+
struct('entities', struct( ...
18+
'label', 'ns left motion', ...
19+
'hs', '')));
1920
rightRoiImage = renameFile(rightRoiImage, ...
20-
struct('label', 'ns right motion', ...
21-
'hs', ''));
21+
struct('entities', struct( ...
22+
'label', 'ns right motion', ...
23+
'hs', '')));

miss_hit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html)
22
line_length: 100
3+
34
regex_function_name: "[a-z]+(_*([a-zA-Z0-9]){1}[A-Za-z]+)*" # almost anything goes in the root folder
5+
regex_script_name: "[a-z0-9]+(_[a-z0-9]+)*"
6+
47
exclude_dir: "lib"
8+
59
copyright_entity: "CPP ROI developers"
610

711
tab_width: 2
File renamed without changes.

src/atlas/extractRoiByLabel.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
p = bids.internal.parse_filename(sourceImage);
1212
p.label = labelStruct.ROI;
1313
p.suffix = 'mask';
14-
newName = createFilename(p);
14+
p.use_schema = false;
15+
16+
newName = bids.create_filename(p);
1517
hdr.fname = spm_file(hdr.fname, 'filename', newName);
1618

1719
% Cluster labels as their size.
1820
spm_write_vol(hdr, outputVol);
1921
outputImage = hdr.fname;
2022

23+
json = bids.derivatives_json(outputImage);
24+
bids.util.jsonencode(json.filename, json.content);
25+
2126
end

src/atlas/extractRoiFromAtlas.m

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
% (C) Copyright 2021 CPP ROI developers
2-
31
function roiImage = extractRoiFromAtlas(roiDir, atlas, roiName, hemisphere)
2+
%
3+
% (C) Copyright 2021 CPP ROI developers
44

55
if strcmp(atlas, 'wang')
66

@@ -23,15 +23,21 @@
2323
roiImage = extractRoiByLabel(sourceImage, labelStruct);
2424

2525
entities = struct('space', 'MNI', ...
26-
'hemi', hemisphere, ...
27-
'desc', atlas, ...
28-
'label', roiName);
29-
nameStructure = struct('entities', entities, ...
26+
'hemi', hemisphere, ...
27+
'desc', atlas, ...
28+
'label', roiName);
29+
nameStructure = struct('entities', entities, ...
3030
'suffix', 'mask', ...
3131
'ext', '.nii');
32-
newName = createFilename(nameStructure);
32+
33+
nameStructure.use_schema = false;
34+
35+
newName = bids.create_filename(nameStructure);
3336

3437
movefile(roiImage, fullfile(roiDir, newName));
3538

3639
roiImage = fullfile(roiDir, newName);
40+
41+
json = bids.derivatives_json(roiImage);
42+
bids.util.jsonencode(json.filename, json.content);
3743
end

src/atlas/getRetinoProbaAtlas.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
% (C) Copyright 2021 CPP ROI developers
2-
31
function [maxProbaFiles, roiLabels] = getRetinoProbaAtlas()
42
%
53
% Loads the volumetric data from the
@@ -15,6 +13,7 @@
1513
% PMID: 25452571
1614
% Probabilistic Maps of Visual Topography in Human Cortex
1715
%
16+
% (C) Copyright 2021 CPP ROI developers
1817

1918
unzipAtlas('wang');
2019

src/atlas/getRoiLabelLookUpTable.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
% (C) Copyright 2021 CPP ROI developers
2-
31
function roiLabelLUT = getRoiLabelLookUpTable(atlas)
2+
%
3+
% (C) Copyright 2021 CPP ROI developers
44

55
if exist(atlas, 'file')
66
roiLabelLUT = spm_load(atlas);

0 commit comments

Comments
 (0)