Skip to content

Commit 6932215

Browse files
committed
fix other demos
1 parent 03b277e commit 6932215

File tree

11 files changed

+73
-47
lines changed

11 files changed

+73
-47
lines changed

demos/MoAE/moae_get_option.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
opt.dir.raw = fullfile(fileparts(mfilename('fullpath')), 'inputs', 'raw');
1515
opt.dir.preproc = fullfile(opt.dir.raw, '..', '..', 'outputs', 'derivatives');
1616

17-
opt.pipeline.type = 'preproc';
1817
opt.pipeline.name = 'cpp_spm-preproc';
1918

2019
% Uncomment the lines below to run preprocessing

demos/openneuro/ds000001_get_option.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
% task to analyze
1616
opt.taskName = 'balloonanalogrisktask';
1717

18+
opt.pipeline.type = 'preproc';
19+
opt.pipeline.name = 'cpp_spm-preproc';
20+
1821
% The directory where the data are located
1922
opt.dir.raw = '/home/remi/openneuro/ds000001/raw';
20-
opt.dir.derivatives = spm_file(fullfile(opt.dir.raw, ...
21-
'..', ...
22-
'derivatives', ...
23-
'cpp_spm-preprocess'), ...
24-
'cpath');
23+
opt.dir.preproc = spm_file(fullfile(opt.dir.raw, ...
24+
'..', ...
25+
'derivatives'), ...
26+
'cpath');
2527

2628
% Uncomment the lines below to run preprocessing
2729
% - don't use realign and unwarp

demos/openneuro/ds000001_run.m

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,28 @@
99
FWHM = 6;
1010
conFWHM = 6;
1111

12-
pipeline_name = 'cpp_spm-preprocess';
13-
1412
run ../../initCppSpm.m;
1513

1614
%% Set options
1715
opt = ds000001_get_option();
1816

1917
reportBIDS(opt);
2018

21-
% bidsCopyInputFolder(opt, pipeline_name);
22-
%
23-
% bidsSTC(opt);
24-
%
25-
% bidsSpatialPrepro(opt);
26-
%
27-
% anatomicalQA(opt);
28-
% bidsResliceTpmToFunc(opt);
29-
% functionalQA(opt);
30-
%
31-
% bidsSmoothing(FWHM, opt);
19+
bidsCopyInputFolder(opt);
20+
21+
bidsSegmentSkullStrip(opt);
22+
23+
bidsSTC(opt);
24+
25+
bidsSpatialPrepro(opt);
26+
27+
anatomicalQA(opt);
28+
bidsResliceTpmToFunc(opt);
29+
functionalQA(opt);
30+
31+
bidsSmoothing(FWHM, opt);
32+
33+
opt.pipeline.type = 'stats';
3234

3335
bidsFFX('specifyAndEstimate', opt, FWHM);
3436
bidsFFX('contrasts', opt, FWHM);

demos/openneuro/ds000114_get_option.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
% The directory where the data are located
1010
opt.dir.raw = '/home/remi/openneuro/ds000114/raw';
11+
opt.pipeline.name = 'cpp_spm-preprocess';
1112

1213
% suject to run in each group
1314
opt.subjects = {'01', '02'};

demos/openneuro/ds000114_run.m

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
FWHM = 6;
1010
conFWHM = 6;
1111

12-
pipeline_name = 'cpp_spm-preprocess';
13-
1412
run ../../initCppSpm.m;
1513

1614
%% Set options
@@ -20,13 +18,7 @@
2018

2119
reportBIDS(opt);
2220

23-
opt.dir.derivatives = spm_file(fullfile(opt.dir.raw, ...
24-
'..', ...
25-
'derivatives', ...
26-
pipeline_name), ...
27-
'cpath');
28-
29-
bidsCopyInputFolder(opt, pipeline_name);
21+
bidsCopyInputFolder(opt);
3022
bidsSTC(opt);
3123

3224
bidsSpatialPrepro(opt);
@@ -38,29 +30,20 @@
3830
bidsSmoothing(FWHM, opt);
3931

4032
%% Run level analysis: as for MVPA
41-
33+
opt.pipeline.type = 'stats';
4234
bidsFFX('specifyAndEstimate', opt, FWHM);
4335
bidsFFX('contrasts', opt, FWHM);
4436

4537
bidsConcatBetaTmaps(opt, FWHM, false, false);
4638

4739
%% Subject level analysis: for regular univariate
48-
40+
opt.pipeline.type = 'stats';
4941
opt.model.file = fullfile(fileparts(mfilename('fullpath')), ...
5042
'models', ...
5143
'model-ds000114-linebisection_smdl.json');
5244

5345
bidsFFX('specifyAndEstimate', opt, FWHM);
5446

55-
opt.result.Steps(1) = struct( ...
56-
'Level', 'subject', ...
57-
'Contrasts', struct( ...
58-
'Name', 'Correct_Task', ... % has to match
59-
'Mask', false, ...
60-
'MC', 'FWE', ... FWE, none, FDR
61-
'p', 0.05, ...
62-
'k', 0));
63-
6447
bidsFFX('contrasts', opt, FWHM);
6548
bidsResults(opt, FWHM);
6649

demos/openneuro/ds001168_get_option.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
% task to analyze
2020
opt.taskName = 'rest';
2121

22+
opt.query.modality = {'anat', 'func', 'fmap'};
23+
2224
opt.anatReference.type = 'T1w';
2325
opt.anatReference.session = '1';
2426

demos/openneuro/ds001168_run.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
%% Run batches
1717

18-
reportBIDS(opt);
18+
% reportBIDS(opt);
1919

2020
bidsCopyInputFolder(opt);
2121

demos/openneuro/openneuro.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Download with datalad
1+
# Download with datalad
22

33
In case you use the python package for datalad, activate your virtual
44
environment (like conda).
@@ -7,6 +7,21 @@ environment (like conda).
77
conda activate datalad
88
```
99

10+
Datalad datasets can be accessed via their siblings on:
11+
https://github.com/OpenNeuroDatasets
12+
13+
Otherwise you can also get them by using the Datalad superdataset. For example:
14+
15+
```bash
16+
datalad clone ///
17+
cd datasets.datalad.org/
18+
datalad install openneuro datalad
19+
install openneuro/ds002790
20+
cd openneuro/ds002790
21+
# get rest data first subject
22+
datalad get /derivatives/fmriprep/sub-0001/func/sub-0001*task-restingstate_acq-seq*\*
23+
```
24+
1025
## ds000114
1126

1227
Multi-subject and multi-session dataset.
@@ -38,3 +53,25 @@ datalad get sub-0[12]/*/func/*linebisection*
3853
datalad get sub-0[12]/ses*/func/*fullbrain*
3954

4055
```
56+
57+
## frmriprep output from ds002790
58+
59+
```bash
60+
datalad clone ///
61+
cd datasets.datalad.org/
62+
datalad install openneuro datalad
63+
install openneuro/ds002790
64+
cd openneuro/ds002790
65+
# get resting state data first 2 subjects from MNI space
66+
ls derivatives/fmriprep/sub-000[12]/func/sub-000[12]_task-restingstate_acq-seq_*space-*MNI*_*
67+
datalad get derivatives/fmriprep/sub-000[12]/func/sub-000[12]_task-restingstate_acq-seq_*space-*MNI*_*
68+
# get their realignment parameters and other confounds
69+
ls derivatives/fmriprep/sub-000[12]/func/sub-000[12]_task-restingstate_*confounds*
70+
datalad get derivatives/fmriprep/sub-000[12]/func/sub-000[12]_task-restingstate_*confounds*
71+
# get normalization parameters
72+
ls derivatives/fmriprep/sub-000[12]/anat/*.h5
73+
datalad get derivatives/fmriprep/sub-000[12]/anat/*.h5
74+
# get anat data from MNI space
75+
ls derivatives/fmriprep/sub-0001/anat/*MNI*desc*
76+
datalad get derivatives/fmriprep/sub-0001/anat/*MNI*desc*
77+
```

src/getData.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
'task', opt.taskName, ...
8686
'sub', subjects{1}, ...
8787
'suffix', suffix, ...
88-
'extension', '.nii');
88+
'extension', {'.nii', '.nii.gz'});
8989

9090
case 'T1w'
9191
metadata = bids.query(BIDS, 'metadata', ...

src/workflows/bidsConcatBetaTmaps.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ function bidsConcatBetaTmaps(opt, funcFWHM, deleteIndBeta, deleteIndTmaps)
8080
% tsv
8181
nameStructure = struct( ...
8282
'ext', '.tsv', ...
83-
'type', 'labelfold', ...
84-
'sub', subLabel, ...
85-
'task', opt.taskName, ...
86-
'space', opt.space);
83+
'suffix', 'labelfold', ...
84+
'entities', struct('sub', subLabel, ...
85+
'task', opt.taskName, ...
86+
'space', opt.space));
8787
tsvName = createFilename(nameStructure);
8888

8989
tsvContent = struct('folds', runs, 'labels', {conditions});

0 commit comments

Comments
 (0)