Skip to content

Commit 4532698

Browse files
authored
Merge branch 'master' into master
2 parents 9419f00 + ba4ebeb commit 4532698

File tree

4 files changed

+66
-21
lines changed

4 files changed

+66
-21
lines changed

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

fmriprep/__about__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
'git+https://github.com/rciric/nipype.git@'

fmriprep/workflows/bold/base.py

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

350350
inputnode = pe.Node(niu.IdentityInterface(
351-
fields=['bold_file', 'sbref_file', 'subjects_dir', 'subject_id',
351+
fields=['bold_file', 'subjects_dir', 'subject_id',
352352
't1_preproc', 't1_brain', 't1_mask', 't1_seg', 't1_tpms',
353353
't1_aseg', 't1_aparc',
354354
't1_2_mni_forward_transform', 't1_2_mni_reverse_transform',
355355
't1_2_fsnative_forward_transform', 't1_2_fsnative_reverse_transform']),
356356
name='inputnode')
357357
inputnode.inputs.bold_file = bold_file
358358
if sbref_file is not None:
359-
inputnode.inputs.sbref_file = sbref_file
359+
from niworkflows.interfaces.images import ValidateImage
360+
val_sbref = pe.Node(ValidateImage(in_file=sbref_file), name='val_sbref')
360361

361362
outputnode = pe.Node(niu.IdentityInterface(
362363
fields=['bold_t1', 'bold_t1_ref', 'bold_mask_t1', 'bold_aseg_t1', 'bold_aparc_t1',
@@ -427,6 +428,10 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
427428

428429
# Generate a tentative boldref
429430
bold_reference_wf = init_bold_reference_wf(omp_nthreads=omp_nthreads)
431+
if sbref_file is not None:
432+
workflow.connect([
433+
(val_sbref, bold_reference_wf, [('out_file', 'inputnode.sbref_file')]),
434+
])
430435

431436
# Top-level BOLD splitter
432437
bold_split = pe.Node(FSLSplit(dimension='t'), name='bold_split',
@@ -548,8 +553,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer,
548553
# MAIN WORKFLOW STRUCTURE #######################################################
549554
workflow.connect([
550555
# Generate early reference
551-
(inputnode, bold_reference_wf, [('bold_file', 'inputnode.bold_file'),
552-
('sbref_file', 'inputnode.sbref_file')]),
556+
(inputnode, bold_reference_wf, [('bold_file', 'inputnode.bold_file')]),
553557
# BOLD buffer has slice-time corrected if it was run, original otherwise
554558
(boldbuffer, bold_split, [('bold_file', 'in_file')]),
555559
# 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'),

0 commit comments

Comments
 (0)