Skip to content

Commit ce55f5d

Browse files
authored
Merge pull request #822 from Remi-Gau/boilerplate_cli
[ENH] add boilerplate to CLI
2 parents d82c0e2 + 8bc7d4e commit ce55f5d

24 files changed

+100
-92
lines changed

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
*_report.md
21

3-
src/batches/cfg
42

53
# General
64
.DS_Store
@@ -11,24 +9,27 @@ src/batches/cfg
119
*.html
1210
*.ps
1311

14-
.vscode/settings.json
1512

1613
tmp
1714

15+
# logs and options
16+
error_logs
17+
*_report.md
18+
src/batches/cfg
19+
options_task*[0-9][0-9].json
20+
1821
# created by tests
1922
CHANGES
2023
README
2124

2225
# Project specific
23-
options_task-*date*.json
2426
onsets*_events.mat
2527

2628
## virtual env
2729
env
2830
venv
2931

3032
## from running tests in root dir
31-
*/cfg/*
3233
*/group/*
3334
models/*
3435

bidspm.m

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,20 @@ function preprocess(args)
304304

305305
try
306306

307-
reportBIDS(opt);
307+
saveOptions(opt);
308+
309+
bidsReport(opt);
308310
bidsCopyInputFolder(opt);
309311
if opt.dummy_scans > 0
310312
bidsRemoveDummies(opt, ...
311313
'dummyScans', opt.dummy_scans, ...
312314
'force', false);
313315
end
316+
317+
boilerplate(opt, ...
318+
'outputPath', fullfile(opt.dir.output, 'reports'), ...
319+
'pipelineType', 'preproc', ...
320+
'verbosity', opt.verbosity);
314321
if opt.useFieldmaps && ~opt.anatOnly
315322
bidsCreateVDM(opt);
316323
end
@@ -337,6 +344,7 @@ function default_model(args)
337344
opt = checkOptions(opt);
338345

339346
try
347+
saveOptions(opt);
340348
createDefaultStatsModel(opt.dir.raw, opt, lower(args.Results.ignore));
341349
catch ME
342350
bugReport(opt, ME);
@@ -368,13 +376,19 @@ function stats(args)
368376

369377
try
370378

379+
saveOptions(opt);
380+
381+
boilerplate(opt, ...
382+
'outputPath', fullfile(opt.dir.output, 'reports'), ...
383+
'pipelineType', 'stats', ...
384+
'verbosity', opt.verbosity);
385+
371386
if opt.glm.roibased.do
372387

373388
bidsFFX('specify', opt);
374389
if ~opt.model.designOnly
375390
bidsRoiBasedGLM(opt);
376391
end
377-
378392
else
379393

380394
if estimate

demos/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
*/outputs/
33
*/inputs/
44
*/*.nii
5-
*/cfg
5+
*.png

demos/MoAE/moae_01_bids_app.ipynb

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@
55
"id": "13de9b92",
66
"metadata": {},
77
"source": [
8-
"# MoAE demo"
9-
]
10-
},
11-
{
12-
"cell_type": "markdown",
13-
"id": "074b10dd",
14-
"metadata": {},
15-
"source": [
8+
"# MoAE demo\n",
9+
"\n",
1610
"This script shows how to use the bidspm BIDS app\n",
1711
"\n",
1812
"- **Download**\n",

demos/MoAE/moae_01_bids_app.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% # MoAE demo
2-
2+
%
33
% This script shows how to use the bidspm BIDS app
44
%
55
% - **Download**

demos/renaming/spm_2_bids_filenames.ipynb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"id": "27817b7d",
6-
"metadata": {},
7-
"source": [
8-
"(C) Copyright 2022 Remi Gau"
9-
]
10-
},
113
{
124
"cell_type": "markdown",
135
"id": "748352c4",
@@ -45,12 +37,17 @@
4537
"\n",
4638
"- **prefixes are not a thing in official BIDS names**\n",
4739
"\n",
48-
"BIDS has a number of [officially recognised entities](https://bids-specification.readthedocs.io/en/stable/99-appendices/04-entity-table.html) \n",
40+
"BIDS has a number of officially recognised entities \n",
4941
"(`sub`, `ses`, `task`...) that must come in a specific order for each data type.\n",
5042
"\n",
43+
"https://bids-specification.readthedocs.io/en/stable/99-appendices/04-entity-table.html\n",
44+
"\n",
5145
"BIDS derivatives adds a few more entities (`desc`, `space`, `res`...)\n",
5246
"and suffixes (`pseg`, `dseg`, `mask`...)\n",
53-
"that can be used to name and describe preprocessed data."
47+
"that can be used to name and describe preprocessed data.\n",
48+
"\n",
49+
"\n",
50+
"(C) Copyright 2022 Remi Gau"
5451
]
5552
},
5653
{

demos/renaming/spm_2_bids_filenames.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
% (C) Copyright 2022 Remi Gau
2-
31
% # BIDS filenames
42
%
53
% Ideally we would like to have the same pipeline for statistical analysis
@@ -32,12 +30,17 @@
3230
%
3331
% - **prefixes are not a thing in official BIDS names**
3432
%
35-
% BIDS has a number of (https://bids-specification.readthedocs.io/en/stable/99-appendices/04-entity-table.html)
33+
% BIDS has a number of officially recognised entities
3634
% (`sub`, `ses`, `task`...) that must come in a specific order for each data type.
3735
%
36+
% https://bids-specification.readthedocs.io/en/stable/99-appendices/04-entity-table.html
37+
%
3838
% BIDS derivatives adds a few more entities (`desc`, `space`, `res`...)
3939
% and suffixes (`pseg`, `dseg`, `mask`...)
4040
% that can be used to name and describe preprocessed data.
41+
%
42+
%
43+
% (C) Copyright 2022 Remi Gau
4144

4245
% The toolbox BIDS Matlab has some function to help you create bids valid names.
4346

@@ -210,8 +213,6 @@
210213

211214
demo_dir = fullfile(pwd, '..', 'MoAE');
212215

213-
opt.taskName = 'auditory';
214-
215216
opt.dir.derivatives = fullfile(demo_dir, 'outputs', 'derivatives');
216217
opt.dir.preproc = fullfile(opt.dir.derivatives, 'bidspm-preproc');
217218

docs/print_boilerplate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
opt = checkOptions(opt);
3232

3333
% dataset descriptor
34-
reportBIDS(opt);
34+
bidsReport(opt);
3535

3636
% preprocessing
3737
boilerplate(opt, 'outputPath', fullfile(WK, 'source', 'examples'), ...

docs/source/dev_doc.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ workflows
8080
.. autofunction:: src.workflows.bidsRsHrf
8181
.. _bidsChangeSuffix:
8282
.. autofunction:: src.workflows.bidsChangeSuffix
83+
.. _bidsReport:
84+
.. autofunction:: src.workflows.bidsReport
8385
.. _setUpWorkflow:
8486
.. autofunction:: src.workflows.setUpWorkflow
8587
.. _cleanUpWorkflow:
@@ -234,8 +236,6 @@ reports
234236
.. autofunction:: src.reports.copyFigures
235237
.. _boilerplate:
236238
.. autofunction:: src.reports.boilerplate
237-
.. _reportBIDS:
238-
.. autofunction:: src.reports.reportBIDS
239239

240240

241241
.. _infra:
@@ -244,6 +244,8 @@ infra
244244
=====
245245
.. _checkToolbox:
246246
.. autofunction:: src.infra.checkToolbox
247+
.. _returnBsmDocURL:
248+
.. autofunction:: src.infra.returnBsmDocURL
247249
.. _getRepoInfo:
248250
.. autofunction:: src.infra.getRepoInfo
249251
.. _elapsedTime:
@@ -266,6 +268,8 @@ infra
266268
.. autofunction:: src.infra.getVersion
267269
.. _isOctave:
268270
.. autofunction:: src.infra.isOctave
271+
.. _returnRtdURL:
272+
.. autofunction:: src.infra.returnRtdURL
269273

270274

271275
.. _QA:

docs/source/method_section.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Methods section
44
Dataset description
55
===================
66

7-
Use the :func:`src.reports.reportBIDS` function to description of your dataset
7+
Use the :func:`src.workflows.bidsReport` function to description of your dataset
88
that can be used for your methods section
99

1010
Preprocessing & GLM

0 commit comments

Comments
 (0)