Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
47bbde8
add option for mean image output save
CerenB Feb 3, 2021
b3db0f3
Merge branch 'cer-segment_img' into cer-skullstrip_output
CerenB Feb 4, 2021
9f00704
fix for getMeanImage
CerenB Feb 5, 2021
8371f23
explanation added
CerenB Feb 5, 2021
5fc729c
Merge branch 'dev' into cer-skullstrip_output
CerenB Feb 8, 2021
646562f
add normalised option in mean image prefix
CerenB Feb 8, 2021
3dc7adc
save run and condition provenance when concatenating betamaps
Remi-Gau Apr 2, 2021
500de90
update demo 114
Remi-Gau Apr 2, 2021
0895c96
improve help section
Remi-Gau Apr 2, 2021
5dbd585
Merge pull request #338 from Remi-Gau/remi-save_info_concatenation
Remi-Gau Apr 7, 2021
7633da6
add workflows for LesionAbnormalitiesDetection and LesionOverlapMap
mwmaclean Apr 8, 2021
8b7c651
modify lesion script and demo
mwmaclean Apr 8, 2021
8c10d10
add ALE defaults file
mwmaclean Apr 8, 2021
7bcd1f8
rename ALE
mwmaclean Apr 8, 2021
e09430b
Update src/batches/setBatchSkullStripping.m
CerenB Apr 12, 2021
a917b13
remove global variable
mwmaclean Apr 12, 2021
e6cf093
add ALI toolbox to opt structure
mwmaclean Apr 12, 2021
94c3882
add output argument
mwmaclean Apr 12, 2021
82c1a4c
Merge branch 'dev' into cer-skullstrip_output
CerenB Apr 12, 2021
d8c9707
subID to subLabel fix
CerenB Apr 12, 2021
1a44678
add make mean functional image mask
CerenB Apr 12, 2021
7caa156
mh fix
CerenB Apr 12, 2021
eb9368b
change default options
Remi-Gau Apr 12, 2021
1aa56aa
update other tests
Remi-Gau Apr 12, 2021
254ab0b
minor update
CerenB Apr 12, 2021
7179580
Merge remote-tracking branch 'CerenB/cer-skullstrip_output' into cer-…
CerenB Apr 12, 2021
50233bb
add copyright
CerenB Apr 12, 2021
76dd1cc
Merge pull request #288 from CerenB/cer-skullstrip_output
Remi-Gau Apr 12, 2021
fc6348f
Merge remote-tracking branch 'cpp-lln-lab/dev' into remi-prepare_rele…
Remi-Gau Apr 13, 2021
bebca72
Merge pull request #351 from Remi-Gau/remi-prepare_release_1.0.0
Remi-Gau Apr 13, 2021
8315013
add mean func mask into workflow
CerenB Apr 12, 2021
d699cfa
fix functional image input
CerenB Apr 12, 2021
8fa2d4d
reimplement demo
Remi-Gau Apr 13, 2021
d9736f1
mh fix
Remi-Gau Apr 13, 2021
fb13f01
update set up workflow
Remi-Gau Apr 13, 2021
114ba84
Merge branch 'dev' into rel_0.3.0
Remi-Gau Apr 13, 2021
7c44995
Merge pull request #355 from cpp-lln-lab/rel_0.3.0
Remi-Gau Apr 13, 2021
1f9fe1c
change default to not close parallelization at the end of a workflow
Remi-Gau Apr 13, 2021
9161c73
Merge pull request #358 from Remi-Gau/remi_parallel
Remi-Gau Apr 13, 2021
1864ae4
make sure that workflow returns to current directory upon finishing
Remi-Gau Apr 13, 2021
1ec200f
Merge pull request #359 from Remi-Gau/remi_parallel
Remi-Gau Apr 13, 2021
7f6f11c
refactor gitignore
Remi-Gau Apr 14, 2021
6884275
Merge pull request #360 from Remi-Gau/remi_parallel
Remi-Gau Apr 14, 2021
13bf10a
set up pre-commit
Remi-Gau Apr 14, 2021
cbd144f
Merge pull request #361 from Remi-Gau/remi-pre_commit
Remi-Gau Apr 14, 2021
29c89e9
update README with pre-commit install info
Remi-Gau Apr 14, 2021
a01b57f
Merge pull request #362 from Remi-Gau/remi-pre_commit
Remi-Gau Apr 14, 2021
600af63
make and save all possible masks
CerenB Apr 26, 2021
b3629ec
related to the issue #365
CerenB Apr 26, 2021
ac7e992
Merge branch 'dev' into cer-imcalcDefaultOpt
CerenB Apr 26, 2021
ce12187
mh fix
CerenB Apr 26, 2021
ecc8909
Merge branch 'dev' of https://github.com/cpp-lln-lab/CPP_SPM into dev
mwmaclean May 5, 2021
9f79e99
update lesion demos
mwmaclean Apr 12, 2021
48e0bf3
some changes
mwmaclean May 5, 2021
50177ab
fix segmentation step
mwmaclean May 17, 2021
9132b99
fix abnormalities detection
mwmaclean May 17, 2021
c4093c8
removed old code
mwmaclean May 18, 2021
bd29a91
remove old code
mwmaclean May 18, 2021
610f9e4
modify prefix abnormalities detection
mwmaclean May 21, 2021
c7a324d
add 2 classes of tissue in script
mwmaclean May 25, 2021
46ad7ec
clean up
Remi-Gau Jun 1, 2021
b567062
add checks to see if the toolbox is present
Remi-Gau Jun 1, 2021
64f6713
refactor
Remi-Gau Jun 1, 2021
f6c7a4e
revert commenting of parallelization by checking presence of toolbox
Remi-Gau Jun 1, 2021
6e2a954
fix bugs
Remi-Gau Jun 1, 2021
bed26b9
bids lesion workflow
mwmaclean Jun 3, 2021
c80228d
merge prep
mwmaclean Jun 3, 2021
87bbdbc
test precommit
Remi-Gau Jun 13, 2021
590883b
mh fix
Remi-Gau Jun 14, 2021
531ac49
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 14, 2021
6696160
Merge pull request #353 from CerenB/cer-skullStrip-demo
Remi-Gau Jun 14, 2021
a9c35bd
fix merge conflict
Remi-Gau Jun 14, 2021
eda0a57
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 14, 2021
59b884e
fix mh
Remi-Gau Jun 14, 2021
74c8520
Merge branch 'michele-detect_lesion' of https://github.com/mwmaclean/…
Remi-Gau Jun 14, 2021
4138998
add old changes
mwmaclean Jun 14, 2021
f2f6190
add anatomicalQALesion function
mwmaclean Jun 14, 2021
12d0912
Merge branch 'michele-detect_lesion' of https://github.com/mwmaclean/…
mwmaclean Jun 14, 2021
82f501a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 14, 2021
56353f4
fix failing tests
Remi-Gau Jun 14, 2021
94883d9
remove erroneously added file
Remi-Gau Jun 14, 2021
73b687a
Merge pull request #345 from mwmaclean/michele-detect_lesion
Remi-Gau Jun 14, 2021
70a0e25
clean templates
Remi-Gau Jun 14, 2021
7db01a3
update doc [fix #292]
Remi-Gau Jun 14, 2021
5822992
lint
Remi-Gau Jun 14, 2021
198d61a
update test create onset file [fix 376]
Remi-Gau Jun 14, 2021
93c81d8
update miss hit
Remi-Gau Jun 14, 2021
a932cf7
update makefile for doc
Remi-Gau Jun 14, 2021
9690753
add expected output to test
Remi-Gau Jun 14, 2021
b0136f0
update variable names
Remi-Gau Jun 14, 2021
474d4e6
Merge pull request #378 from Remi-Gau/remi-clean_up
Remi-Gau Jun 14, 2021
b6e6c4f
Update setBatchSkullStripping.m
CerenB Jul 4, 2021
1d637af
Merge branch 'dev' into cer-imcalcDefaultOpt
Remi-Gau Aug 7, 2021
e0aecfe
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2021
1fcbb03
add data type argin to setBatchImageCalculation
Remi-Gau Aug 7, 2021
ce8ed4a
add input parser and refactor to setBatchImageCalculation
Remi-Gau Aug 7, 2021
031e1a6
update tests
Remi-Gau Aug 7, 2021
3c40283
refactor test setBatchSkullStripping
Remi-Gau Aug 7, 2021
5b88f6d
add option to skip slice timing correction
Remi-Gau Aug 7, 2021
8ee32f7
update getting STC prefixes
Remi-Gau Aug 7, 2021
dbb7ea6
update STC reference in setBatchSubjectLevelGLMSpec
Remi-Gau Aug 7, 2021
aa86c6e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2021
ce09ed3
remove parfor from spatial processing workflow
Remi-Gau Aug 7, 2021
f857934
add QA options
Remi-Gau Aug 7, 2021
313c742
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2021
e9bf630
fix doc
Remi-Gau Aug 7, 2021
c2fb978
Merge branch 'parallel' of https://github.com/Remi-Gau/CPP_BIDS_SPM_p…
Remi-Gau Aug 7, 2021
bf8d5be
default value change in setBatchImageCalculation
CerenB Aug 13, 2021
fd51df1
Merge pull request #371 from CerenB/cer-imcalcDefaultOpt
Remi-Gau Aug 13, 2021
a9d8c61
Merge pull request #392 from Remi-Gau/skip_stc
Remi-Gau Aug 14, 2021
8a0eef4
update initialization matlabbatch
Remi-Gau Aug 17, 2021
3eecaa2
[FIX] update default data type value related to image calculation batch
Remi-Gau Aug 17, 2021
946726a
Merge pull request #397 from Remi-Gau/update_init_matlabbatch
Remi-Gau Aug 18, 2021
f0aa0c0
Merge pull request #394 from Remi-Gau/parallel
Remi-Gau Sep 2, 2021
f40d2f6
Merge branch 'master' into rc-1.1.0
Remi-Gau Sep 13, 2021
058c8e9
update version
Remi-Gau Sep 13, 2021
c5564d0
Merge branch 'rc-1.1.0' of https://github.com/cpp-lln-lab/CPP_SPM int…
Remi-Gau Sep 13, 2021
5fc1ef5
fix dead links
Remi-Gau Sep 13, 2021
66b1f47
fix failing test
Remi-Gau Sep 13, 2021
29c9611
remove old travis link in README
Remi-Gau Sep 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 43 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,39 +1,60 @@

# General
.DS_Store
*.asv
*.m~
*.mat

*.xml
*.log
*.html
*.zip
*.html
*.ps
*.png

# Project specific
options_task-*date*.json
onsets*_events.mat

# files in the demo folder related to running the demo analysis
demos/*/outputs/
demos/*/inputs/
demos/*/*.nii
demos/*/cfg/*.json

# test folder and dummy data
tests/*.png
tests/group/*
tests/*/*.json
tests/dummyData/derivatives/cpp_spm*/sub-*/

# ignore content of the build folder of the doc
docs/build/*

# ignore virtual env
## virtual env
cpp_spm/*
env/*
venv/*

# visual studio code stuff
## visual studio code
.vscode

## MATLAB / OCTAVE gitignore template

# From : https://github.com/github/gitignore/blob/master/Global/MATLAB.gitignore


# Windows default autosave extension
*.asv

# OSX / *nix default autosave extension
*.m~

# Compiled MEX binaries (all platforms)
*.mex*

# Packaged app and toolbox files
*.mlappinstall
*.mltbx

# Generated helpsearch folders
helpsearch*/

# Simulink code generation folders
slprj/
sccprj/

# Matlab code generation folders
codegen/

# Simulink autosave extension
*.autosave

# Simulink cache files
*.slxc

# Octave session info
octave-workspace


28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
repos:

- repo: local

hooks:

- id: mh_style
name: mh_style
entry: mh_style
args: [--process-slx, --fix]
files: ^(.*\.(m|slx))$
language: python
additional_dependencies: [miss_hit_core]

- id: mh_metric
name: mh_metric
entry: mh_metric
args: [--ci]
files: ^(.*\.(m|slx))$
language: python
additional_dependencies: [miss_hit_core]

- id: mh_lint
name: mh_lint
entry: mh_lint
files: ^(.*\.(m|slx))$
language: python
additional_dependencies: [miss_hit]
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

**Documentation**

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

**Code quality and style**

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

**Unit tests and coverage**

[![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)
[![codecov](https://codecov.io/gh/Remi-Gau/CPP_SPM/branch/master/graph/badge.svg?token=8IoRQtbFUV)](https://codecov.io/gh/Remi-Gau/CPP_SPM)
[![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)

**How to cite**

Expand Down Expand Up @@ -62,7 +60,7 @@ initCppSpm
```

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

### Dependencies
Expand Down Expand Up @@ -111,7 +109,7 @@ This can perform:
The core functions are in the `src` folder.

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

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

Constant are written in `UPPERCASE`.

#### Pre-commit

There is a [pre-commit hook](https://pre-commit.com/) that you can use to
reformat files as you commit them.

Install pre-commit by using our `requirements.txt` file
```bash
pip install -r requirements.txt
```

Install the hook
```bash
pre-commit install
```

You're done. `mh_style --fix` will now be run every time you commit.

## Contributors

Thanks goes to these wonderful people
Expand Down
5 changes: 5 additions & 0 deletions demos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# files in the demo folder related to running the demo analysis
*/outputs/
*/inputs/
*/*.nii
*/cfg/*.json
25 changes: 14 additions & 11 deletions demos/MoAE/moae_run.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,29 @@
bidsCopyRawFolder(opt, 1);

% In case you just want to run segmentation and skull stripping
% bidsSegmentSkullStrip(opt);
%
% NOTE: skull stripping is also included in 'bidsSpatialPrepro'
bidsSegmentSkullStrip(opt);

bidsSTC(opt);

bidsSpatialPrepro(opt);

% The following do not run on octave for now (because of spmup)
anatomicalQA(opt);
bidsResliceTpmToFunc(opt);
functionalQA(opt);

% anatomicalQA(opt);
% bidsResliceTpmToFunc(opt);
% functionalQA(opt);

% create a whole brain functional mean image mask
% so the mask will be in the same resolution/space as the functional images
% one may not need it if they are running bidsFFX
% since it creates a mask.nii by default
opt.skullstrip.mean = 1;
mask = bidsWholeBrainFuncMask(opt);

% smoooth the funcitional images
bidsSmoothing(FWHM, opt);

% The following crash on CI
WD = pwd;
% The following crash on Travis CI
bidsFFX('specifyAndEstimate', opt, FWHM);
cd(WD);
bidsFFX('contrasts', opt, FWHM);
cd(WD);
bidsResults(opt, FWHM);
cd(WD);
20 changes: 0 additions & 20 deletions demos/lesion_detection/batch_lesion.m

This file was deleted.

7 changes: 4 additions & 3 deletions demos/lesion_detection/lesion_get_option.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
%
% USAGE::
%
% opt = Lesion_getOption()
% opt = lesion_get_option()
%
% :returns: - :optSource: (struct)
% :returns: - :opt: (struct)
%
% (C) Copyright 2021 CPP_SPM developers

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

%% DO NOT TOUCH
opt = checkOptions(opt);
Expand Down
32 changes: 32 additions & 0 deletions demos/lesion_detection/run_lesion.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
% (C) Copyright 2021 CPP_SPM developers

clear;
clc;

% This script will will run
% 1) lesion segmentation,
% 2) lesion abnormalities detection and
% 3) lesion overlapmap adapted from the ALI toolbox (SPM.)

% URL of the data set to download
% URL = https://gin.g-node.org/mwmaclean/CVI-Datalad/src/master/data

run ../../initCppSpm.m;

%% Set options
opt = lesion_get_option();

%% Run batches
reportBIDS(opt);

deleteZippedNii = true;
bidsCopyRawFolder(opt, deleteZippedNii, {'anat'});

% Step 1: segmentation
bidsLesionSegmentation(opt);

% % Step 2: lesion abnormalities
bidsLesionAbnormalitiesDetection(opt);

% % Step 3: overlap map
% bidsLesionOverlapMap(opt)
9 changes: 2 additions & 7 deletions demos/openneuro/ds000114_get_option.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
%
% (C) Copyright 2020 CPP_SPM developers

if nargin < 1
opt = [];
end

% The directory where the data are located
opt.dataDir = '/home/remi/openneuro/ds000114/raw';

Expand All @@ -21,7 +17,6 @@

opt.anatReference.type = 'T1w';
opt.anatReference.session = 'retest';

% Uncomment the lines below to run preprocessing
% - don't use realign and unwarp
% opt.realign.useUnwarp = false;
Expand All @@ -30,11 +25,11 @@

opt.model.file = fullfile(fileparts(mfilename('fullpath')), ...
'models', ...
'model-ds000114-linebisection_smdl.json');
'model-ds000114-lineBisectionRunLevel_smdl.json');

% specify the result to compute
opt.result.Steps(1) = struct( ...
'Level', 'subject', ...
'Level', 'run', ...
'Contrasts', struct( ...
'Name', 'Correct_Task', ... % has to match
'Mask', false, ...
Expand Down
23 changes: 23 additions & 0 deletions demos/openneuro/ds000114_run.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,31 @@

bidsSmoothing(FWHM, opt);

%% Run level analysis: as for MVPA

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

bidsConcatBetaTmaps(opt, FWHM, false, false);

%% Subject level analysis: for regular univariate

opt.model.file = fullfile(fileparts(mfilename('fullpath')), ...
'models', ...
'model-ds000114-linebisection_smdl.json');

bidsFFX('specifyAndEstimate', opt, FWHM);

opt.result.Steps(1) = struct( ...
'Level', 'subject', ...
'Contrasts', struct( ...
'Name', 'Correct_Task', ... % has to match
'Mask', false, ...
'MC', 'FWE', ... FWE, none, FDR
'p', 0.05, ...
'k', 0));

bidsFFX('contrasts', opt, FWHM);
bidsResults(opt, FWHM);

bidsRFX('smoothContrasts', opt, FWHM, conFWHM);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"Name": "run level",
"Description": "contrasts to compute for the line bisection task",
"Input": {
"task": "linebisection"
},
"Steps": [
{
"Level": "run",
"Model": {
"X": [
"trial_type.Correct_Task",
"trial_type.Incorrect_Task",
"trial_type.No_Response_Task",
"trial_type.Response_Control",
"trial_type.No_Response_Control",
"trans_x",
"trans_y",
"trans_z",
"rot_x",
"rot_y",
"rot_z"
]
},
"AutoContrasts": [
"trial_type.Correct_Task",
"trial_type.Incorrect_Task"
]
}
]
}
Loading