Skip to content

Commit 52e07d0

Browse files
authored
Merge pull request #404 from cpp-lln-lab/rc-1.1.0
[REL] rc 1.1.0
2 parents 826c531 + 29c9611 commit 52e07d0

File tree

151 files changed

+17684
-17333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+17684
-17333
lines changed

.gitignore

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,60 @@
1-
1+
# General
22
.DS_Store
3-
*.asv
4-
*.m~
5-
*.mat
3+
64
*.xml
75
*.log
8-
*.html
96
*.zip
7+
*.html
108
*.ps
9+
*.png
1110

11+
# Project specific
1212
options_task-*date*.json
1313
onsets*_events.mat
1414

15-
# files in the demo folder related to running the demo analysis
16-
demos/*/outputs/
17-
demos/*/inputs/
18-
demos/*/*.nii
19-
demos/*/cfg/*.json
20-
21-
# test folder and dummy data
22-
tests/*.png
23-
tests/group/*
24-
tests/*/*.json
25-
tests/dummyData/derivatives/cpp_spm*/sub-*/
26-
27-
# ignore content of the build folder of the doc
28-
docs/build/*
29-
30-
# ignore virtual env
15+
## virtual env
3116
cpp_spm/*
3217
env/*
18+
venv/*
3319

34-
# visual studio code stuff
20+
## visual studio code
3521
.vscode
3622

23+
## MATLAB / OCTAVE gitignore template
24+
25+
# From : https://github.com/github/gitignore/blob/master/Global/MATLAB.gitignore
26+
27+
28+
# Windows default autosave extension
29+
*.asv
30+
31+
# OSX / *nix default autosave extension
32+
*.m~
33+
34+
# Compiled MEX binaries (all platforms)
35+
*.mex*
36+
37+
# Packaged app and toolbox files
38+
*.mlappinstall
39+
*.mltbx
40+
41+
# Generated helpsearch folders
42+
helpsearch*/
43+
44+
# Simulink code generation folders
45+
slprj/
46+
sccprj/
47+
48+
# Matlab code generation folders
49+
codegen/
50+
51+
# Simulink autosave extension
52+
*.autosave
53+
54+
# Simulink cache files
55+
*.slxc
3756

57+
# Octave session info
58+
octave-workspace
3859

3960

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
repos:
2+
3+
- repo: local
4+
5+
hooks:
6+
7+
- id: mh_style
8+
name: mh_style
9+
entry: mh_style
10+
args: [--process-slx, --fix]
11+
files: ^(.*\.(m|slx))$
12+
language: python
13+
additional_dependencies: [miss_hit_core]
14+
15+
- id: mh_metric
16+
name: mh_metric
17+
entry: mh_metric
18+
args: [--ci]
19+
files: ^(.*\.(m|slx))$
20+
language: python
21+
additional_dependencies: [miss_hit_core]
22+
23+
- id: mh_lint
24+
name: mh_lint
25+
entry: mh_lint
26+
files: ^(.*\.(m|slx))$
27+
language: python
28+
additional_dependencies: [miss_hit]

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
**Documentation**
44

5-
[![Documentation Status: stable](https://readthedocs.org/projects/cpp-bids-spm/badge/?version=stable)](https://cpp-bids-spm.readthedocs.io/en/stable/?badge=stable)
5+
[![Documentation Status: stable](https://readthedocs.org/projects/cpp_spm/badge/?version=stable)](https://cpp_spm.readthedocs.io/en/stable/?badge=stable)
66

77
**Code quality and style**
88

9-
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_BIDS_SPM_pipeline/actions)
10-
![](https://github.com/cpp-lln-lab/CPP_BIDS_SPM_pipeline/workflows/CI/badge.svg)
9+
[![](https://img.shields.io/badge/Octave-CI-blue?logo=Octave&logoColor=white)](https://github.com/cpp-lln-lab/CPP_SPM/actions)
10+
![](https://github.com/cpp-lln-lab/CPP_SPM/workflows/CI/badge.svg)
1111

1212
**Unit tests and coverage**
13-
14-
[![Build Status](https://travis-ci.com/cpp-lln-lab/CPP_BIDS_SPM_pipeline.svg?branch=master)](https://travis-ci.com/cpp-lln-lab/CPP_BIDS_SPM_pipeline)
15-
[![codecov](https://codecov.io/gh/Remi-Gau/CPP_SPM/branch/master/graph/badge.svg?token=8IoRQtbFUV)](https://codecov.io/gh/Remi-Gau/CPP_SPM)
13+
[![codecov](https://codecov.io/gh/cpp-lln-lab/CPP_SPM/branch/master/graph/badge.svg?token=8IoRQtbFUV)](https://codecov.io/gh/cpp-lln-lab/CPP_SPM)
1614

1715
**How to cite**
1816

@@ -62,7 +60,7 @@ initCppSpm
6260
```
6361

6462
Please see our
65-
[documentation](https://cpp-bids-spm.readthedocs.io/en/latest/index.html) for
63+
[documentation](https://cpp_spm.readthedocs.io/en/latest/index.html) for
6664
more detailed instructions.
6765

6866
### Dependencies
@@ -111,7 +109,7 @@ This can perform:
111109
The core functions are in the `src` folder.
112110

113111
Please see our
114-
[documentation](https://cpp-bids-spm.readthedocs.io/en/latest/index.html) for
112+
[documentation](https://cpp_spm.readthedocs.io/en/latest/index.html) for
115113
more info.
116114

117115
## Octave compatibility
@@ -145,6 +143,23 @@ Scripts names in general and as well functions related to the demos use a
145143

146144
Constant are written in `UPPERCASE`.
147145

146+
#### Pre-commit
147+
148+
There is a [pre-commit hook](https://pre-commit.com/) that you can use to
149+
reformat files as you commit them.
150+
151+
Install pre-commit by using our `requirements.txt` file
152+
```bash
153+
pip install -r requirements.txt
154+
```
155+
156+
Install the hook
157+
```bash
158+
pre-commit install
159+
```
160+
161+
You're done. `mh_style --fix` will now be run every time you commit.
162+
148163
## Contributors
149164

150165
Thanks goes to these wonderful people

demos/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# files in the demo folder related to running the demo analysis
2+
*/outputs/
3+
*/inputs/
4+
*/*.nii
5+
*/cfg/*.json

demos/MoAE/moae_run.m

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,29 @@
2727
bidsCopyRawFolder(opt, 1);
2828

2929
% In case you just want to run segmentation and skull stripping
30-
% bidsSegmentSkullStrip(opt);
31-
%
3230
% NOTE: skull stripping is also included in 'bidsSpatialPrepro'
31+
bidsSegmentSkullStrip(opt);
3332

3433
bidsSTC(opt);
3534

3635
bidsSpatialPrepro(opt);
3736

3837
% The following do not run on octave for now (because of spmup)
39-
anatomicalQA(opt);
40-
bidsResliceTpmToFunc(opt);
41-
functionalQA(opt);
42-
38+
% anatomicalQA(opt);
39+
% bidsResliceTpmToFunc(opt);
40+
% functionalQA(opt);
41+
42+
% create a whole brain functional mean image mask
43+
% so the mask will be in the same resolution/space as the functional images
44+
% one may not need it if they are running bidsFFX
45+
% since it creates a mask.nii by default
46+
opt.skullstrip.mean = 1;
47+
mask = bidsWholeBrainFuncMask(opt);
48+
49+
% smoooth the funcitional images
4350
bidsSmoothing(FWHM, opt);
4451

45-
% The following crash on CI
46-
WD = pwd;
52+
% The following crash on Travis CI
4753
bidsFFX('specifyAndEstimate', opt, FWHM);
48-
cd(WD);
4954
bidsFFX('contrasts', opt, FWHM);
50-
cd(WD);
5155
bidsResults(opt, FWHM);
52-
cd(WD);

demos/lesion_detection/batch_lesion.m

Lines changed: 0 additions & 20 deletions
This file was deleted.

demos/lesion_detection/lesion_get_option.m

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
%
66
% USAGE::
77
%
8-
% opt = Lesion_getOption()
8+
% opt = lesion_get_option()
99
%
10-
% :returns: - :optSource: (struct)
10+
% :returns: - :opt: (struct)
1111
%
1212
% (C) Copyright 2021 CPP_SPM developers
1313

1414
% The directory where the data are located
15-
opt.dataDir = '/home/remi/gin/CVI-Datalad/data';
15+
opt.dataDir = 'C:\Users\michm\Data\myphdproject\MRI\CVI-DataLad\data';
16+
opt.derivativesDir = fullfile(opt.dataDir, '..', 'outputs');
1617

1718
%% DO NOT TOUCH
1819
opt = checkOptions(opt);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
% (C) Copyright 2021 CPP_SPM developers
2+
3+
clear;
4+
clc;
5+
6+
% This script will will run
7+
% 1) lesion segmentation,
8+
% 2) lesion abnormalities detection and
9+
% 3) lesion overlapmap adapted from the ALI toolbox (SPM.)
10+
11+
% URL of the data set to download
12+
% URL = https://gin.g-node.org/mwmaclean/CVI-Datalad/src/master/data
13+
14+
run ../../initCppSpm.m;
15+
16+
%% Set options
17+
opt = lesion_get_option();
18+
19+
%% Run batches
20+
reportBIDS(opt);
21+
22+
deleteZippedNii = true;
23+
bidsCopyRawFolder(opt, deleteZippedNii, {'anat'});
24+
25+
% Step 1: segmentation
26+
bidsLesionSegmentation(opt);
27+
28+
% % Step 2: lesion abnormalities
29+
bidsLesionAbnormalitiesDetection(opt);
30+
31+
% % Step 3: overlap map
32+
% bidsLesionOverlapMap(opt)

demos/openneuro/ds000114_get_option.m

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
%
77
% (C) Copyright 2020 CPP_SPM developers
88

9-
if nargin < 1
10-
opt = [];
11-
end
12-
139
% The directory where the data are located
1410
opt.dataDir = '/home/remi/openneuro/ds000114/raw';
1511

@@ -21,7 +17,6 @@
2117

2218
opt.anatReference.type = 'T1w';
2319
opt.anatReference.session = 'retest';
24-
2520
% Uncomment the lines below to run preprocessing
2621
% - don't use realign and unwarp
2722
% opt.realign.useUnwarp = false;
@@ -30,11 +25,11 @@
3025

3126
opt.model.file = fullfile(fileparts(mfilename('fullpath')), ...
3227
'models', ...
33-
'model-ds000114-linebisection_smdl.json');
28+
'model-ds000114-lineBisectionRunLevel_smdl.json');
3429

3530
% specify the result to compute
3631
opt.result.Steps(1) = struct( ...
37-
'Level', 'subject', ...
32+
'Level', 'run', ...
3833
'Contrasts', struct( ...
3934
'Name', 'Correct_Task', ... % has to match
4035
'Mask', false, ...

demos/openneuro/ds000114_run.m

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,31 @@
3030

3131
bidsSmoothing(FWHM, opt);
3232

33+
%% Run level analysis: as for MVPA
34+
3335
bidsFFX('specifyAndEstimate', opt, FWHM);
3436
bidsFFX('contrasts', opt, FWHM);
37+
38+
bidsConcatBetaTmaps(opt, FWHM, false, false);
39+
40+
%% Subject level analysis: for regular univariate
41+
42+
opt.model.file = fullfile(fileparts(mfilename('fullpath')), ...
43+
'models', ...
44+
'model-ds000114-linebisection_smdl.json');
45+
46+
bidsFFX('specifyAndEstimate', opt, FWHM);
47+
48+
opt.result.Steps(1) = struct( ...
49+
'Level', 'subject', ...
50+
'Contrasts', struct( ...
51+
'Name', 'Correct_Task', ... % has to match
52+
'Mask', false, ...
53+
'MC', 'FWE', ... FWE, none, FDR
54+
'p', 0.05, ...
55+
'k', 0));
56+
57+
bidsFFX('contrasts', opt, FWHM);
3558
bidsResults(opt, FWHM);
3659

3760
bidsRFX('smoothContrasts', opt, FWHM, conFWHM);

0 commit comments

Comments
 (0)