Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] use python based CLI to run bidspm with octave #832

Merged
merged 13 commits into from
Nov 24, 2022
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
},
{
"login": "yyang1234",
"name": "YingYang",
"name": "Ying Yang",
"avatar_url": "https://avatars.githubusercontent.com/u/59220868?v=4",
"profile": "https://github.com/yyang1234",
"contributions": [
Expand Down
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ body:
- type: textarea
attributes:
label: Operating system version
render: markdown
value: |
- Linux Ubuntu 18.04 "bionic beaver"
- Mac OS Version 12 "monterey"
Expand Down Expand Up @@ -68,8 +67,7 @@ body:
- type: textarea
attributes:
label: Platform version
render: markdown
placeholder: |
value: |
- MATLAB 2017a
- Octave 4.2.2

Expand All @@ -85,6 +83,7 @@ body:

Or check the content of CITATION.cff.
options:
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
Expand Down Expand Up @@ -134,7 +133,7 @@ body:
Describe what you got instead.
If possible paste below the error message you encountered.
Also add the error.log that might have been generated.
placeholder: |
value: |
```matlab
% this is the error I got

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tmp
error_logs
*_report.md
src/batches/cfg
options_task*[0-9][0-9].json
options_*[0-9][0-9].json
skipped_roi_*.tsv

# created by tests
Expand Down
1 change: 1 addition & 0 deletions bidspm.m
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ function initBidspm(dev)

for i = 1:numel(libList)
BIDSPM_PATHS = cat(2, BIDSPM_PATHS, ...
pathSep, ...
genpath(fullfile(thisDirectory, 'lib', libList{i})));
end

Expand Down
45 changes: 45 additions & 0 deletions demos/MoAE/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,48 @@ In the `models` shows the BIDS statistical model used to run the GLM of this
demo.

You can use the makefile to run all the main scripts with `make all`

## CLI commands

### Create model

```bash
bidspm \
/home/remi/github/bidspm/demos/MoAE/inputs/raw \
/home/remi/github/bidspm/demos/MoAE/outputs/derivatives \
dataset \
--action default_model \
--space IXI549Space \
--task auditory \
--verbosity 0 \
--ignore transformations
```

### Preprocessing

```bash
bidspm \
/home/remi/github/bidspm/demos/MoAE/inputs/raw \
/home/remi/github/bidspm/demos/MoAE/outputs/derivatives \
subject \
--action preprocess \
--participant_label 01 \
--space individual IXI549Space \
--task auditory \
--verbosity 2 \
--fwhm 6 \
--ignore unwarp slicetiming
```

### GLM

```bash
bidspm \
/home/remi/github/bidspm/demos/MoAE/inputs/raw \
/home/remi/github/bidspm/demos/MoAE/outputs/derivatives \
subject \
--action stats \
--preproc_dir /home/remi/github/bidspm/demos/MoAE/outputs/derivatives/bidspm-preproc \
--model_file /home/remi/github/bidspm/demos/MoAE/models/model-MoAE_smdl.json \
--fwhm 6
```
29 changes: 29 additions & 0 deletions demos/face_repetition/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Face repetition demo

## CLI commands

### Preprocessing

```bash
bidspm \
/home/remi/github/bidspm/demos/face_repetition/outputs/raw \
/home/remi/github/bidspm/demos/face_repetition/outputs/derivatives \
subject \
--action preprocess \
--participant_label 01 \
--space individual IXI549Space \
--task facerepetition \
--skip_validation \
--dummy_scans 5
```

```bash
bidspm \
/home/remi/github/bidspm/demos/face_repetition/outputs/raw \
/home/remi/github/bidspm/demos/face_repetition/outputs/derivatives \
subject \
--action preprocess \
--space individual IXI549Space \
--anat_only \
--skip_validation
```
3 changes: 2 additions & 1 deletion demos/face_repetition/face_rep_01_anat_only.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@
bidspm(bids_dir, output_dir, 'subject', ...
'action', 'preprocess', ...
'space', {'individual', 'IXI549Space'}, ...
'anat_only', true);
'anat_only', true, ...
'skip_validation', true);
8 changes: 4 additions & 4 deletions demos/openneuro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ data: data_ds000001 data_ds000114 data_ds001168
data_ds000001:
mkdir -p inputs
cd inputs && datalad install ///openneuro/ds000001
datalad -d inputs/ds000001 get inputs/ds000001/sub-0[12]
cd inputs/ds000001 && datalad get sub-0[12]

data_ds000114:
mkdir -p inputs
cd inputs && datalad install ///openneuro/ds000114
datalad -d inputs/ds000114 get inputs/ds000114/sub-0[12]
cd inputs/ds000114 && datalad get sub-0[12]

data_ds001168:
datalad install ///openneuro/ds001168 inputs/ds001168
datalad -d inputs/ds001168 get inputs/ds001168/sub-0[12]
cd inputs/ds001168 && datalad get ds001168/sub-0[12]

data_ds002799:
datalad install ///openneuro/ds002799 inputs/ds002799
cd inputs/ds002799/derivatives/fmriprep
datalad -d get sub-292/*/func/*MNI152NLin2009cAsym*
datalad get sub-292/*/func/*MNI152NLin2009cAsym*
datalad get sub-292/*/func/*tsv
datalad get sub-30[27]/*/func/*MNI152NLin2009cAsym*
datalad get sub-30[27]/*/func/*tsv
2 changes: 1 addition & 1 deletion lib/bids-matlab
Submodule bids-matlab updated 2 files
+1 −1 +bids/report.m
+1 −1 schema.json
2 changes: 1 addition & 1 deletion lib/spmup
Submodule spmup updated 1 files
+7 −3 QA/spmup_realign_qa.m
6 changes: 1 addition & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ zip_safe = False

[options.entry_points]
console_scripts =
bidspm = src.cli:main
bidspm_low = src.cli:low
bidspm_preproc = src.cli:preproc
bidspm_stats = src.cli:stats
bidspm_default_model = src.cli:default_model
bidspm = src.bidspm:cli
validate_model = src.validate:main

[options.extras_require]
Expand Down
3 changes: 2 additions & 1 deletion src/QA/anatomicalQA.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function anatomicalQA(opt)
% (C) Copyright 2020 bidspm developers

if isOctave()
warning('\nanatomicalQA is not yet supported on Octave. This step will be skipped.');
fprintf('\n');
warning('anatomicalQA is not yet supported on Octave. This step will be skipped.');
opt.QA.anat.do = false;
end

Expand Down
4 changes: 2 additions & 2 deletions src/bids/validate.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function validate(args)
pathToPrint(args.Results.bids_dir)));

[sts_data, msg_data] = bids.validate(args.Results.bids_dir);
if sts_data == 1 && ~startsWith(msg_data, 'Require')
msg_data = sprintf('\nBIDS validation of %s failed:\n\n%s\n\nCheck with\n: %s\n\n', ...
if sts_data == 1 && ~bids.internal.starts_with(msg_data, 'Require')
msg_data = sprintf('\nBIDS validation of %s failed:\n\n%s\n\nCheck with:\n %s\n\n', ...
args.Results.bids_dir, ...
msg_data, ...
'https://bids-standard.github.io/bids-validator/');
Expand Down
Loading