Skip to content

Commit b6be0ec

Browse files
committed
add tests, pre commit and doc
1 parent ff17e6a commit b6be0ec

30 files changed

+556
-189
lines changed

.pre-commit-config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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]
29+
30+
- repo: https://github.com/pre-commit/pre-commit-hooks
31+
rev: v2.0.0
32+
hooks:
33+
- id: trailing-whitespace
34+
- id: end-of-file-fixer
35+
- id: check-yaml
36+
- id: check-added-large-files

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ TODO
8585

8686
- Can help generate ROI based on:
8787
- the SPM Anatomy toolbox (INSERT URL)
88+
- the SPM neuromorphometric atlas
8889
- neurosynth probabilty maps
8990
- the probabilistic maps of visual topography in human cortex:
9091
- https://scholar.princeton.edu/napl/resources
@@ -98,6 +99,8 @@ Also includes:
9899
- Yeo's 7 networks "atlas"
99100
- add REF and URL
100101

102+
103+
101104
## Contributing
102105

103106
## Contributors
-2.02 MB
Binary file not shown.

atlas/space-IXI549Space_desc-neuromorphometrics_mask.json

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

docs/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ help:
1818
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
1919
%: Makefile
2020
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
23+
doc:
24+
@$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Function description
2+
********************
3+
4+
ROI
5+
===
6+
7+
.. automodule:: src.roi
8+
9+
.. autofunction:: createRoi
10+
11+
Atlas
12+
=====
13+
14+
.. automodule:: src.atlas
15+
16+
.. autofunction:: returnAtlasDir
17+
18+
Utilities
19+
=========
20+
21+
.. automodule:: src.utils
22+
23+
.. autofunction:: renameFile

docs/source/index.rst

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,11 @@
1-
.. cpp_bids_spm documentation master file, created by
2-
sphinx-quickstart on Tue Oct 13 11:38:30 2020.
3-
You can adapt this file completely to your liking, but it should at least
4-
contain the root `toctree` directive.
5-
6-
Welcome to CPP SPM BIDS pipeline documentation!
7-
***********************************************
1+
Welcome to CPP_ROI documentation!
2+
*********************************
83

94
.. toctree::
105
:maxdepth: 2
116
:caption: Content
127

13-
set_up
14-
workflows
15-
QA
16-
defaults
17-
batches
188
function_description
19-
method_section_boilerplate
20-
mancoreg
21-
docker
22-
contributing
23-
24-
This pipeline contains a set of functions to run fMRI analysis on a
25-
[BIDS data set](https://bids.neuroimaging.io/) using SPM12.
26-
27-
This can perform:
28-
29-
- slice timing correction,
30-
- spatial preprocessing:
31-
32-
- realignment, coregistration `func` to `anat`, `anat` segmention,
33-
normalization to MNI space
34-
- realignm and unwarp, coregistration `func` to `anat`, `anat` segmention
35-
36-
- smoothing,
37-
- Quality analysis:
38-
39-
- for anatomical data
40-
- for functional data
41-
- GLM at the subject level
42-
- GLM at the group level à la SPM (meaning using a summary statistics approach).
43-
44-
It can also prepare the data to run an MVPA analysis by running a GLM for each
45-
subject on non-normalized images and get one beta image for each condition to be
46-
used in the MVPA.
47-
48-
49-
Assumptions
50-
===========
51-
52-
At the moment this pipeline makes some assumptions:
53-
54-
- it assumes that the dummy scans have been removed from the BIDS data set and
55-
it can jump straight into pre-processing,
56-
- it assumes the metadata for a given task are the same as those the first run
57-
of the first subject this pipeline is being run on,
58-
- it assumes that group are defined in the subject field (eg `sub-ctrl01`,
59-
`sub-blind01`, ...) and not in the `participants.tsv` file.
60-
619

6210

6311
Indices and tables

lib/miss_hit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# This is here to keep pre-commit-ci from going ape and running on the content
2+
# of this folder.
3+
enable: false

miss_hit.cfg

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
project_root
2+
13
# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html)
2-
line_length: 100
4+
line_length: 120
35

46
regex_function_name: "[a-z]+(_*([a-zA-Z0-9]){1}[A-Za-z]+)*" # almost anything goes in the root folder
57
regex_script_name: "[a-z0-9]+(_[a-z0-9]+)*"
@@ -13,5 +15,5 @@ tab_width: 2
1315
# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)
1416
metric "cnest": limit 4
1517
metric "file_length": limit 400
16-
metric "cyc": limit 12
17-
metric "parameters": limit 6
18+
metric "cyc": limit 16
19+
metric "parameters": limit 7

src/atlas/extractRoiFromAtlas.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
else
1212
sourceImage = maxProbaFiles(2, :);
1313
end
14-
14+
1515
elseif strcmp(atlas, 'neuromorphometrics')
16-
17-
sourceImage = fullfile(returnAtlasDir(), 'space-IXI549Space_desc-neuromorphometrics_dseg.nii');
18-
19-
roiLabels = getRoiLabelLookUpTable(atlas);
20-
16+
17+
sourceImage = fullfile(returnAtlasDir(), 'space-IXI549Space_desc-neuromorphometrics_dseg.nii');
18+
19+
roiLabels = getRoiLabelLookUpTable(atlas);
20+
2121
end
2222

2323
roiIdx = strcmp(roiName, roiLabels.ROI);

0 commit comments

Comments
 (0)