Skip to content

Commit f1113df

Browse files
committed
fix(@effigies' review): address several comments not deferred to docs/revise-1596
1 parent 58b8865 commit f1113df

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

fmriprep/cli/run.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,14 @@ def get_parser():
130130
g_conf.add_argument(
131131
'--output-spaces', nargs='+', action=ParseTemplates,
132132
help="""\
133-
Paths or keywords prescribing standard spaces to which normalize the input T1w image \
134-
and nonstandard spaces in which BOLD runs will be resampled (valid keywords are: \
135-
%s and paths poing to templates) with modifiers (optional parameters).
136-
Output spaces may be templates with modifiers or dataset-specific references. \
137-
Templates take the form ``<TEMPLATE>[:res-<resolution>][:cohort-<label>][...]``, \
138-
with optional, colon-separated parameters, while dataset-specific references imply \
139-
a specific orientation and sampling grid.\
140-
""" % ', '.join('"%s"' % s for s in templates() + NONSTANDARD_REFERENCES))
133+
Standard and non-standard spaces to resample anatomical and functional images to. \
134+
Standard spaces may be specified by the form \
135+
``<TEMPLATE>[:res-<resolution>][:cohort-<label>][...]``, where ``<TEMPLATE>`` is \
136+
a keyword (valid keywords: %s) or path pointing to a user-supplied template, and \
137+
may be followed by optional, colon-separated parameters. \
138+
Non-standard spaces (valid keywords: %s) imply specific orientations and sampling \
139+
grids""" % (', '.join('"%s"' % s for s in templates()),
140+
', '.join(NONSTANDARD_REFERENCES)))
141141

142142
g_conf.add_argument(
143143
'--output-space', required=False, action='store', type=str, nargs='+',
@@ -209,7 +209,7 @@ def get_parser():
209209
# FreeSurfer options
210210
g_fs = parser.add_argument_group('Specific options for FreeSurfer preprocessing')
211211
g_fs.add_argument(
212-
'--fs-license-file', type=Path,
212+
'--fs-license-file', metavar='PATH', type=Path,
213213
help='Path to FreeSurfer license key file. Get it (for free) by registering'
214214
' at https://surfer.nmr.mgh.harvard.edu/registration.html')
215215

@@ -688,8 +688,8 @@ def parse_spaces(opts):
688688
if 'MNI152NLin2009cAsym' not in output_spaces:
689689
output_spaces['MNI152NLin2009cAsym'] = {'res': 2}
690690
print("""Option ``--cifti-output`` requires functional images to be resampled to \
691-
``MNI152NLin6Asym`` space. Such template identifier has been automatically added to the list \
692-
of output spaces (option "--output-space").""", file=stderr)
691+
``MNI152NLin2009cAsym`` space. Such template identifier has been automatically added to the \
692+
list of output spaces (option "--output-space").""", file=stderr)
693693
if not [s for s in output_spaces if s in ('fsaverage5', 'fsaverage6')]:
694694
output_spaces['fsaverage5'] = {}
695695
print("""Option ``--cifti-output`` requires functional images to be resampled to \

fmriprep/interfaces/reports.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
31
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
42
# vi: set ft=python sts=4 ts=4 sw=4 et:
53
"""
@@ -28,7 +26,8 @@
2826
\t\t<li>Structural images: {n_t1s:d} T1-weighted {t2w}</li>
2927
\t\t<li>Functional series: {n_bold:d}</li>
3028
{tasks}
31-
\t\t<li>Standard output spaces: {output_spaces}</li>
29+
\t\t<li>Standard output spaces: {std_spaces}</li>
30+
\t\t<li>Non-standard output spaces: {nstd_spaces}</li>
3231
\t\t<li>FreeSurfer reconstruction: {freesurfer_status}</li>
3332
\t</ul>
3433
"""
@@ -40,7 +39,6 @@
4039
\t\t\t<li>Slice timing correction: {stc}</li>
4140
\t\t\t<li>Susceptibility distortion correction: {sdc}</li>
4241
\t\t\t<li>Registration: {registration}</li>
43-
\t\t\t<li>Functional series resampled to spaces: {output_spaces}</li>
4442
\t\t\t<li>Confounds collected: {confounds}</li>
4543
\t\t</ul>
4644
"""
@@ -81,7 +79,8 @@ class SubjectSummaryInputSpec(BaseInterfaceInputSpec):
8179
bold = InputMultiObject(traits.Either(
8280
File(exists=True), traits.List(File(exists=True))),
8381
desc='BOLD functional series')
84-
output_spaces = InputMultiObject(Str, desc='list of standard spaces')
82+
std_spaces = InputMultiObject(Str, desc='list of standard spaces')
83+
nstd_spaces = InputMultiObject(Str, desc='list of non-standard spaces')
8584

8685

8786
class SubjectSummaryOutputSpec(SummaryOutputSpec):
@@ -138,7 +137,8 @@ def _generate_segment(self):
138137
t2w=t2w_seg,
139138
n_bold=len(bold_series),
140139
tasks=tasks,
141-
output_spaces=', '.join(self.inputs.output_spaces),
140+
std_spaces=', '.join(self.inputs.std_spaces),
141+
nstd_spaces=', '.join(self.inputs.nstd_spaces),
142142
freesurfer_status=freesurfer_status)
143143

144144

@@ -154,7 +154,6 @@ class FunctionalSummaryInputSpec(BaseInterfaceInputSpec):
154154
fallback = traits.Bool(desc='Boundary-based registration rejected')
155155
registration_dof = traits.Enum(6, 9, 12, desc='Registration degrees of freedom',
156156
mandatory=True)
157-
output_spaces = traits.List(desc='Target spaces')
158157
confounds_file = File(exists=True, desc='Confounds file')
159158
tr = traits.Float(desc='Repetition time', mandatory=True)
160159

@@ -187,7 +186,6 @@ def _generate_segment(self):
187186
conflist = cfh.readline().strip('\n').strip()
188187
return FUNCTIONAL_TEMPLATE.format(
189188
pedir=pedir, stc=stc, sdc=self.inputs.distortion_correction, registration=reg,
190-
output_spaces=', '.join(self.inputs.output_spaces),
191189
confounds=re.sub(r'[\t ]+', ', ', conflist), tr=self.inputs.tr)
192190

193191

fmriprep/workflows/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,8 +475,10 @@ def init_single_subject_wf(
475475
bids_info = pe.Node(BIDSInfo(
476476
bids_dir=layout.root, bids_validate=False), name='bids_info')
477477

478-
summary = pe.Node(SubjectSummary(output_spaces=list(std_spaces.keys())),
479-
name='summary', run_without_submitting=True)
478+
summary = pe.Node(SubjectSummary(
479+
std_spaces=list(std_spaces.keys()),
480+
nstd_spaces=list(set(NONSTANDARD_REFERENCES).intersection(output_spaces.keys()))),
481+
name='summary', run_without_submitting=True)
480482

481483
about = pe.Node(AboutSummary(version=__version__,
482484
command=' '.join(sys.argv)),

fmriprep/workflows/bold/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,12 @@ def init_func_preproc_wf(
392392
boldbuffer = pe.Node(niu.IdentityInterface(fields=['bold_file']), name='boldbuffer')
393393

394394
summary = pe.Node(
395-
FunctionalSummary(output_spaces=list(output_spaces.keys()),
396-
slice_timing=run_stc,
397-
registration='FreeSurfer' if freesurfer else 'FSL',
398-
registration_dof=bold2t1w_dof,
399-
pe_direction=metadata.get("PhaseEncodingDirection"),
400-
tr=metadata.get("RepetitionTime")),
395+
FunctionalSummary(
396+
slice_timing=run_stc,
397+
registration='FreeSurfer' if freesurfer else 'FSL',
398+
registration_dof=bold2t1w_dof,
399+
pe_direction=metadata.get("PhaseEncodingDirection"),
400+
tr=metadata.get("RepetitionTime")),
401401
name='summary', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True)
402402

403403
# CIfTI output: currently, we only support fsaverage{5,6}

0 commit comments

Comments
 (0)