Skip to content

Commit c24992b

Browse files
committed
FIX: Correct template inputs
1 parent b98d29d commit c24992b

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

niworkflows/interfaces/mni.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,34 +344,31 @@ def _get_ants_args(self):
344344
# Set the template resolution.
345345
resolution = self.inputs.template_resolution
346346

347+
_template_fmt = op.join(mni_template, '%dmm_%s.nii.gz')
347348
# If explicit masking is enabled...
348349
if self.inputs.explicit_masking:
349350
# Mask the template image with the template mask.
350351
# Do not use a fixed mask during registration.
351-
_template_fmt = op.join(mni_template, '%dmm_%s.nii.gz')
352352
args['fixed_image'] = mask(
353353
_template_fmt % (resolution, self.inputs.reference),
354-
_template_fmt % (resolution, 'brainmask.nii.gz'),
354+
_template_fmt % (resolution, 'brainmask'),
355355
"fixed_masked.nii.gz")
356356

357357
# If a lesion mask is provided...
358358
if isdefined(self.inputs.lesion_mask):
359359
# Create a cost function mask with the form: [global mask]
360360
# Use this as the fixed mask.
361361
args['fixed_image_mask'] = create_cfm(
362-
op.join(mni_template, '%dmm_brainmask.nii.gz' % resolution),
362+
_template_fmt % (resolution, 'brainmask'),
363363
lesion_mask=None,
364364
global_mask=True)
365365

366366
# If explicit masking is disabled...
367367
else:
368368
# Use the raw template as the fixed image.
369-
args['fixed_image'] = op.join(
370-
mni_template,
371-
'%dmm_%s.nii.gz' % (resolution, self.inputs.reference))
369+
args['fixed_image'] = _template_fmt % (resolution, self.inputs.reference)
372370
# Use the template mask as the fixed mask.
373-
args['fixed_image_mask'] = op.join(
374-
mni_template, '%dmm_brainmask.nii.gz' % resolution)
371+
args['fixed_image_mask'] = _template_fmt % (resolution, 'brainmask')
375372

376373
return args
377374

0 commit comments

Comments
 (0)