Skip to content

Commit fabab8b

Browse files
committed
fix: Report pre-computed bold2t1w registration
1 parent 8194063 commit fabab8b

File tree

2 files changed

+27
-14
lines changed

2 files changed

+27
-14
lines changed

fmriprep/interfaces/reports.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ class FunctionalSummaryInputSpec(TraitedSpec):
204204
desc='Phase-encoding direction detected',
205205
)
206206
registration = traits.Enum(
207-
'FSL', 'FreeSurfer', mandatory=True, desc='Functional/anatomical registration method'
207+
'FSL',
208+
'FreeSurfer',
209+
'Precomputed',
210+
mandatory=True,
211+
desc='Functional/anatomical registration method',
208212
)
209213
fallback = traits.Bool(desc='Boundary-based registration rejected')
210214
registration_dof = traits.Enum(
@@ -239,18 +243,21 @@ def _generate_segment(self):
239243
else:
240244
stc = 'n/a'
241245
# TODO: Add a note about registration_init below?
242-
reg = {
243-
'FSL': [
244-
'FSL <code>flirt</code> with boundary-based registration'
245-
f' (BBR) metric - {dof} dof',
246-
'FSL <code>flirt</code> rigid registration - 6 dof',
247-
],
248-
'FreeSurfer': [
249-
'FreeSurfer <code>bbregister</code> '
250-
f'(boundary-based registration, BBR) - {dof} dof',
251-
f'FreeSurfer <code>mri_coreg</code> - {dof} dof',
252-
],
253-
}[self.inputs.registration][self.inputs.fallback]
246+
if self.inputs.registration == 'Precomputed':
247+
reg = 'Precomputed affine transformation'
248+
else:
249+
reg = {
250+
'FSL': [
251+
'FSL <code>flirt</code> with boundary-based registration'
252+
f' (BBR) metric - {dof} dof',
253+
'FSL <code>flirt</code> rigid registration - 6 dof',
254+
],
255+
'FreeSurfer': [
256+
'FreeSurfer <code>bbregister</code> '
257+
f'(boundary-based registration, BBR) - {dof} dof',
258+
f'FreeSurfer <code>mri_coreg</code> - {dof} dof',
259+
],
260+
}[self.inputs.registration][self.inputs.fallback]
254261

255262
pedir = get_world_pedir(self.inputs.orientation, self.inputs.pe_direction)
256263

fmriprep/workflows/bold/fit.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,13 @@ def init_bold_fit_wf(
307307
summary = pe.Node(
308308
FunctionalSummary(
309309
distortion_correction='None', # Can override with connection
310-
registration=('FSL', 'FreeSurfer')[config.workflow.run_reconall],
310+
registration=(
311+
'Precomputed'
312+
if boldref2anat_xform
313+
else 'FreeSurfer'
314+
if config.workflow.run_reconall
315+
else 'FSL'
316+
),
311317
registration_dof=config.workflow.bold2anat_dof,
312318
registration_init=config.workflow.bold2anat_init,
313319
pe_direction=metadata.get('PhaseEncodingDirection'),

0 commit comments

Comments
 (0)