|
14 | 14 | from nipype.interfaces import utility as niu, freesurfer as fs
|
15 | 15 | from nipype.interfaces.fsl import Split as FSLSplit
|
16 | 16 |
|
17 |
| -from niworkflows.data import get_template, TEMPLATE_ALIASES |
| 17 | +from templateflow.api import get as get_template |
18 | 18 | from niworkflows.engine.workflows import LiterateWorkflow as Workflow
|
19 | 19 | from niworkflows.interfaces.fixes import FixHeaderApplyTransforms as ApplyTransforms
|
20 | 20 | from niworkflows.interfaces.freesurfer import (
|
@@ -282,13 +282,7 @@ def _aslist(in_value):
|
282 | 282 |
|
283 | 283 | gen_ref = pe.Node(GenerateSamplingReference(), name='gen_ref',
|
284 | 284 | mem_gb=0.3) # 256x256x256 * 64 / 8 ~ 150MB)
|
285 |
| - # Account for template aliases |
286 |
| - template_name = TEMPLATE_ALIASES.get(template, template) |
287 |
| - # Template path |
288 |
| - template_dir = get_template(template_name) |
289 |
| - |
290 |
| - gen_ref.inputs.fixed_image = str( |
291 |
| - template_dir / ('tpl-%s_space-MNI_res-01_T1w.nii.gz' % template_name)) |
| 285 | + gen_ref.inputs.fixed_image = get_template(template, '_res-01_T1w.nii.gz') |
292 | 286 |
|
293 | 287 | mask_mni_tfm = pe.Node(
|
294 | 288 | ApplyTransforms(interpolation='MultiLabel', float=True),
|
@@ -348,12 +342,10 @@ def _aslist(in_value):
|
348 | 342 | ])
|
349 | 343 | elif template_out_grid in ['1mm', '2mm']:
|
350 | 344 | res = int(template_out_grid[0])
|
351 |
| - mask_mni_tfm.inputs.reference_image = str( |
352 |
| - template_dir / |
353 |
| - ('tpl-%s_space-MNI_res-%02d_brainmask.nii.gz' % (template_name, res))) |
354 |
| - bold_to_mni_transform.inputs.reference_image = str( |
355 |
| - template_dir / |
356 |
| - ('tpl-%s_space-MNI_res-%02d_T1w.nii.gz' % (template_name, res))) |
| 345 | + mask_mni_tfm.inputs.reference_image = get_template( |
| 346 | + template, '_res-%02d_desc-brain_mask.nii.gz' % res) |
| 347 | + bold_to_mni_transform.inputs.reference_image = get_template( |
| 348 | + template, '_res-%02d_T1w.nii.gz' % res) |
357 | 349 | else:
|
358 | 350 | mask_mni_tfm.inputs.reference_image = template_out_grid
|
359 | 351 | bold_to_mni_transform.inputs.reference_image = template_out_grid
|
@@ -382,12 +374,10 @@ def _aslist(in_value):
|
382 | 374 | ])
|
383 | 375 | elif template_out_grid in ['1mm', '2mm']:
|
384 | 376 | res = int(template_out_grid[0])
|
385 |
| - aseg_mni_tfm.inputs.reference_image = str( |
386 |
| - template_dir / |
387 |
| - ('tpl-%s_space-MNI_res-%02d_brainmask.nii.gz' % (template_name, res))) |
388 |
| - aparc_mni_tfm.inputs.reference_image = str( |
389 |
| - template_dir / |
390 |
| - ('tpl-%s_space-MNI_res-%02d_T1w.nii.gz' % (template_name, res))) |
| 377 | + aseg_mni_tfm.inputs.reference_image = get_template( |
| 378 | + template, '_res-%02d_desc-brain_mask.nii.gz' % res) |
| 379 | + aparc_mni_tfm.inputs.reference_image = get_template( |
| 380 | + template, '_res-%02d_desc-brain_mask.nii.gz' % res) |
391 | 381 | else:
|
392 | 382 | aseg_mni_tfm.inputs.reference_image = template_out_grid
|
393 | 383 | aparc_mni_tfm.inputs.reference_image = template_out_grid
|
|
0 commit comments