Skip to content

Commit ec2ffd1

Browse files
authored
Merge branch 'master' into circleci_print_skippingDoc
2 parents 750b1b9 + 13f088c commit ec2ffd1

File tree

9 files changed

+106
-35
lines changed

9 files changed

+106
-35
lines changed

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,11 @@
106106
"affiliation": "University College London",
107107
"orcid": "0000-0002-9699-9052"
108108
},
109+
{
110+
"name": "Halchenko, Yaroslav O.",
111+
"affiliation": "Dartmouth College: Hanover, NH, United States",
112+
"orcid": "0000-0003-3456-2493"
113+
},
109114
{
110115
"name": "Rivera-Dompenciel, Adriana",
111116
"affiliation": "Neuroscience Program, University of Iowa",

CONTRIBUTING.md

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,30 +111,57 @@ is so useful to everyone involved.
111111
This is now your own unique copy of ``fMRIPrep``.
112112
Changes here won't effect anyone else's work, so it's a safe space to explore edits to the code!
113113

114-
Make sure to [keep your fork up to date][link_updateupstreamwiki] with the master repository.
114+
**3. [Clone][link_clone] your forked fMRIPrep repository to your machine/computer**
115115

116-
**3. Make the changes you've discussed, following the [fMRIPrep coding style guide](#fMRIPrep-coding-style-guide).**
116+
While you can edit files [directly on github][link_githubedit], sometimes the changes
117+
you want to make will be complex and you will want to use a [text editor][link_texteditor]
118+
that you have installed on your local machine/computer.
119+
(One great text editor is [vscode][link_vscode]).
120+
121+
In order to work on the code locally, you must clone your forked repository.
122+
123+
To keep up with changes in the fmriprep repository,
124+
add the ["upstream" fmriprep repository as a remote][link_addremote]
125+
to your locally cloned repository.
126+
127+
```Shell
128+
git remote add upstream https://github.com/poldracklab/fmriprep.git
129+
```
130+
131+
Make sure to [keep your fork up to date][link_updateupstreamwiki] with the upstream repository.
132+
133+
For example, to update your master branch on your local cloned repository:
134+
135+
```Shell
136+
git fetch upstream
137+
git checkout master
138+
git merge upstream/master
139+
```
140+
141+
**4. Make the changes you've discussed, following the [fMRIPrep coding style guide](#fMRIPrep-coding-style-guide).**
117142

118143
Try to keep the changes focused.
119144
If you feel tempted to "branch out" then please make a [new branch][link_branches].
120145
It can also be helpful to test your changes locally,
121146
using an [fMRIPrep development environment][link_devel].
147+
Once you are satisfied with your local changes, [add/commit/push them][link_add_commit_push]
148+
to the branch on your forked repository.
122149

123-
**4. Submit a [pull request][link_pullrequest].**
150+
**5. Submit a [pull request][link_pullrequest].**
124151

125152
A member of the development team will review your changes to confirm
126153
that they can be merged into the main code base.
127154

128155
Pull requests titles should begin with a descriptive prefix:
129156

130-
* ``ENH``: enhancements or new features
131-
* ``FIX``: bug fixes
132-
* ``TST``: new or updated tests
133-
* ``DOC``: new or updated documentation
134-
* ``STY``: style changes
135-
* ``REF``: refactoring existing code
136-
* ``CI``: updates to continous integration infrastructure
137-
* ``MAINT``: general maintenance
157+
* ``ENH``: enhancements or new features ([example][enh_ex])
158+
* ``FIX``: bug fixes ([example][fix_ex])
159+
* ``TST``: new or updated tests ([example][tst_ex])
160+
* ``DOC``: new or updated documentation ([example][doc_ex])
161+
* ``STY``: style changes ([example][sty_ex])
162+
* ``REF``: refactoring existing code ([example][ref_ex])
163+
* ``CI``: updates to continous integration infrastructure ([example][ci_ex])
164+
* ``MAINT``: general maintenance ([example][maint_ex])
138165

139166
For example: `[ENH] Support for SB-reference in multi-band datasets`
140167

@@ -229,11 +256,26 @@ You're awesome. :wave::smiley:
229256
[link_helpwanted]: https://github.com/poldracklab/fmriprep/labels/help%20wanted
230257
[link_feature]: https://github.com/poldracklab/fmriprep/labels/feature
231258

232-
[link_pullrequest]: https://help.github.com/articles/creating-a-pull-request/
259+
[link_pullrequest]: https://help.github.com/articles/creating-a-pull-request-from-a-fork
233260
[link_fork]: https://help.github.com/articles/fork-a-repo/
261+
[link_clone]: https://help.github.com/articles/cloning-a-repository
262+
[link_githubedit]: https://help.github.com/articles/editing-files-in-your-repository
263+
[link_texteditor]: https://en.wikipedia.org/wiki/Text_editor
264+
[link_vscode]: https://code.visualstudio.com/
265+
[link_addremote]: https://help.github.com/articles/configuring-a-remote-for-a-fork
234266
[link_pushpullblog]: https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/
235267
[link_branches]: https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/
268+
[link_add_commit_push]: https://help.github.com/articles/adding-a-file-to-a-repository-using-the-command-line
236269
[link_updateupstreamwiki]: https://help.github.com/articles/syncing-a-fork/
237270
[link_stemmrolemodels]: https://github.com/KirstieJane/STEMMRoleModels
238271
[link_zenodo]: https://github.com/poldracklab/fmriprep/blob/master/.zenodo.json
239272
[link_devel]: https://fmriprep.readthedocs.io/en/latest/contributors.html
273+
274+
[enh_ex]: https://github.com/poldracklab/fmriprep/pull/1508
275+
[fix_ex]: https://github.com/poldracklab/fmriprep/pull/1378
276+
[tst_ex]: https://github.com/poldracklab/fmriprep/pull/1098
277+
[doc_ex]: https://github.com/poldracklab/fmriprep/pull/1515
278+
[sty_ex]: https://github.com/poldracklab/fmriprep/pull/675
279+
[ref_ex]: https://github.com/poldracklab/fmriprep/pull/816
280+
[ci_ex]: https://github.com/poldracklab/fmriprep/pull/1048
281+
[maint_ex]: https://github.com/poldracklab/fmriprep/pull/1239

docs/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies:
2727
- doctest-ignore-unicode
2828
- svgutils
2929
- nitime
30-
- nilearn
30+
- nilearn!=0.5.0,!=0.5.1
3131
- niworkflows<0.9.0a0,>=0.8.1
3232
- smriprep
3333
- tedana>=0.0.5

docs/workflows.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ in a multiscale, mutual-information based, nonlinear registration scheme.
126126
In particular, spatial normalization is done using the `ICBM 2009c Nonlinear
127127
Asymmetric template (1×1×1mm) <http://nist.mni.mcgill.ca/?p=904>`_ [Fonov2011]_.
128128

129+
.. figure:: _static/T1MNINormalization.svg
130+
:scale: 100%
131+
132+
Animation showing T1w to MNI normalization
133+
134+
Cost function masking during spatial normalization
135+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136+
129137
When processing images from patients with focal brain lesions (e.g. stroke, tumor
130138
resection), it is possible to provide a lesion mask to be used during spatial
131139
normalization to MNI-space [Brett2001]_.
@@ -137,11 +145,12 @@ in the same space and resolution as the T1 image, and follow the naming conventi
137145
(e.g. ``sub-001_T1w_label-lesion_roi.nii.gz``).
138146
This file should be placed in the ``sub-*/anat`` directory of the BIDS dataset
139147
to be run through ``fmriprep``.
148+
Because lesion masks are not currently part of the BIDS specification, it is also necessary to
149+
include a ``.bidsignore`` file in the root of your dataset directory. This will prevent
150+
`bids-validator <https://github.com/bids-standard/bids-validator#bidsignore>`_ from complaining that your dataset not BIDS valid, which prevents
151+
``fmriprep`` from running. Your ``.bidsignore`` file should include the following line::
140152

141-
.. figure:: _static/T1MNINormalization.svg
142-
:scale: 100%
143-
144-
Animation showing T1w to MNI normalization
153+
*lesion_roi.nii.gz
145154
146155

147156
Longitudinal processing

fmriprep/__about__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@
8686
REQUIRES = [
8787
'indexed_gzip>=0.8.8',
8888
'nibabel>=2.2.1',
89-
'nilearn',
89+
'nilearn!=0.5.0,!=0.5.1',
9090
'nipype>=1.1.6',
9191
'nitime',
92-
'niworkflows<0.9.0a0,>=0.8.1',
92+
'niworkflows',
9393
'numpy',
9494
'pandas',
9595
'psutil>=5.4',
@@ -104,6 +104,8 @@
104104

105105

106106
LINKS_REQUIRES = [
107+
'git+https://github.com/poldracklab/niworkflows.git@'
108+
'b7d111c8fd36a099c74be5e7671677eedb175533#egg=niworkflows',
107109
'git+https://github.com/poldracklab/smriprep.git@'
108110
'423bcc43ab7300177eb3b98da62817b2cad8eb87#egg=smriprep-0.1.0',
109111
]

fmriprep/cli/run.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,18 @@ def build_workflow(opts, retval):
786786
boilerplate = retval['workflow'].visit_desc()
787787

788788
if boilerplate:
789-
(logs_path / 'CITATION.md').write_text(boilerplate)
789+
# To please git-annex users and also to guarantee consistency
790+
# among different renderings of the same file, first remove any
791+
# existing one
792+
citation_files = {
793+
ext: logs_path / ('CITATION.%s' % ext)
794+
for ext in ('bib', 'tex', 'md', 'html')
795+
}
796+
for citation_file in citation_files.values():
797+
if citation_file.exists() or citation_file.is_symlink():
798+
citation_file.unlink()
799+
800+
citation_files['md'].write_text(boilerplate)
790801
logger.log(25, 'Works derived from this fMRIPrep execution should '
791802
'include the following boilerplate:\n\n%s', boilerplate)
792803

@@ -795,8 +806,8 @@ def build_workflow(opts, retval):
795806
pkgrf('fmriprep', 'data/boilerplate.bib'),
796807
'--filter', 'pandoc-citeproc',
797808
'--metadata', 'pagetitle="fMRIPrep citation boilerplate"',
798-
str(logs_path / 'CITATION.md'),
799-
'-o', str(logs_path / 'CITATION.html')]
809+
str(citation_files['md']),
810+
'-o', str(citation_files['html'])]
800811
try:
801812
check_call(cmd, timeout=10)
802813
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
@@ -806,16 +817,16 @@ def build_workflow(opts, retval):
806817
# Generate LaTex file resolving citations
807818
cmd = ['pandoc', '-s', '--bibliography',
808819
pkgrf('fmriprep', 'data/boilerplate.bib'),
809-
'--natbib', str(logs_path / 'CITATION.md'),
810-
'-o', str(logs_path / 'CITATION.tex')]
820+
'--natbib', str(citation_files['md']),
821+
'-o', str(citation_files['tex'])]
811822
try:
812823
check_call(cmd, timeout=10)
813824
except (FileNotFoundError, CalledProcessError, TimeoutExpired):
814825
logger.warning('Could not generate CITATION.tex file:\n%s',
815826
' '.join(cmd))
816827
else:
817828
copyfile(pkgrf('fmriprep', 'data/boilerplate.bib'),
818-
(logs_path / 'CITATION.bib'))
829+
citation_files['bib'])
819830

820831
return retval
821832

fmriprep/workflows/bold/base.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,15 +338,16 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
338338
"""
339339

340340
inputnode = pe.Node(niu.IdentityInterface(
341-
fields=['bold_file', 'sbref_file', 'subjects_dir', 'subject_id',
341+
fields=['bold_file', 'subjects_dir', 'subject_id',
342342
't1_preproc', 't1_brain', 't1_mask', 't1_seg', 't1_tpms',
343343
't1_aseg', 't1_aparc',
344344
't1_2_mni_forward_transform', 't1_2_mni_reverse_transform',
345345
't1_2_fsnative_forward_transform', 't1_2_fsnative_reverse_transform']),
346346
name='inputnode')
347347
inputnode.inputs.bold_file = bold_file
348348
if sbref_file is not None:
349-
inputnode.inputs.sbref_file = sbref_file
349+
from niworkflows.interfaces.images import ValidateImage
350+
val_sbref = pe.Node(ValidateImage(in_file=sbref_file), name='val_sbref')
350351

351352
outputnode = pe.Node(niu.IdentityInterface(
352353
fields=['bold_t1', 'bold_t1_ref', 'bold_mask_t1', 'bold_aseg_t1', 'bold_aparc_t1',
@@ -415,6 +416,10 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
415416

416417
# Generate a tentative boldref
417418
bold_reference_wf = init_bold_reference_wf(omp_nthreads=omp_nthreads)
419+
if sbref_file is not None:
420+
workflow.connect([
421+
(val_sbref, bold_reference_wf, [('out_file', 'inputnode.sbref_file')]),
422+
])
418423

419424
# Top-level BOLD splitter
420425
bold_split = pe.Node(FSLSplit(dimension='t'), name='bold_split',
@@ -533,8 +538,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
533538
# MAIN WORKFLOW STRUCTURE #######################################################
534539
workflow.connect([
535540
# Generate early reference
536-
(inputnode, bold_reference_wf, [('bold_file', 'inputnode.bold_file'),
537-
('sbref_file', 'inputnode.sbref_file')]),
541+
(inputnode, bold_reference_wf, [('bold_file', 'inputnode.bold_file')]),
538542
# BOLD buffer has slice-time corrected if it was run, original otherwise
539543
(boldbuffer, bold_split, [('bold_file', 'in_file')]),
540544
# HMC

fmriprep/workflows/bold/util.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, pre_mask=False,
115115

116116
gen_ref = pe.Node(EstimateReferenceImage(), name="gen_ref",
117117
mem_gb=1) # OE: 128x128x128x50 * 64 / 8 ~ 900MB.
118-
# Re-run validation; no effect if no sbref; otherwise apply same validation to sbref as bold
119-
validate_ref = pe.Node(ValidateImage(), name='validate_ref', mem_gb=DEFAULT_MEMORY_MIN_GB)
120118
enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf(
121119
omp_nthreads=omp_nthreads, pre_mask=pre_mask)
122120

@@ -125,12 +123,11 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, pre_mask=False,
125123
(inputnode, validate, [('bold_file', 'in_file')]),
126124
(inputnode, gen_ref, [('sbref_file', 'sbref_file')]),
127125
(validate, gen_ref, [('out_file', 'in_file')]),
128-
(gen_ref, validate_ref, [('ref_image', 'in_file')]),
129-
(validate_ref, enhance_and_skullstrip_bold_wf, [('out_file', 'inputnode.in_file')]),
126+
(gen_ref, enhance_and_skullstrip_bold_wf, [('ref_image', 'inputnode.in_file')]),
130127
(validate, outputnode, [('out_file', 'bold_file'),
131128
('out_report', 'validation_report')]),
132129
(gen_ref, outputnode, [('n_volumes_to_discard', 'skip_vols')]),
133-
(validate_ref, outputnode, [('out_file', 'raw_ref_image')]),
130+
(gen_ref, outputnode, [('ref_image', 'raw_ref_image')]),
134131
(enhance_and_skullstrip_bold_wf, outputnode, [
135132
('outputnode.bias_corrected_file', 'ref_image'),
136133
('outputnode.mask_file', 'bold_mask'),

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
niworkflows<0.9.0a0,>=0.8.1
1+
nilearn!=0.5.0,!=0.5.1
2+
git+https://github.com/poldracklab/niworkflows.git@b7d111c8fd36a099c74be5e7671677eedb175533#egg=niworkflows
23
git+https://github.com/poldracklab/smriprep.git@423bcc43ab7300177eb3b98da62817b2cad8eb87#egg=smriprep-0.1.0
34
templateflow<0.2.0a0,>=0.1.3

0 commit comments

Comments
 (0)