|
1 |
| -# -*- coding: utf-8 -*- |
2 | 1 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
|
3 | 2 | # vi: set ft=python sts=4 ts=4 sw=4 et:
|
4 | 3 | """
|
|
44 | 43 |
|
45 | 44 | DEFAULT_MEMORY_MIN_GB = 0.01
|
46 | 45 | LOGGER = logging.getLogger('nipype.workflow')
|
47 |
| - |
| 46 | +FSAVERAGE_DENSITY = { |
| 47 | + '642': 'fsaverage3', |
| 48 | + '2562': 'fsaverage4', |
| 49 | + '10k': 'fsaverage5', |
| 50 | + '41k': 'fsaverage6', |
| 51 | + '164k': 'fsaverage7', |
| 52 | +} |
48 | 53 |
|
49 | 54 | def init_func_preproc_wf(
|
50 | 55 | aroma_melodic_dim,
|
@@ -395,7 +400,10 @@ def init_func_preproc_wf(
|
395 | 400 | name='summary', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True)
|
396 | 401 |
|
397 | 402 | # CIfTI output: currently, we only support fsaverage{5,6}
|
398 |
| - cifti_spaces = [s for s in output_spaces.keys() if s in ('fsaverage5', 'fsaverage6')] |
| 403 | + cifti_spaces = set([s for s in output_spaces.keys() if s in ('fsaverage5', 'fsaverage6')]) |
| 404 | + fsaverage_den = output_spaces.get('fsaverage', {}).get('den') |
| 405 | + if fsaverage_den: |
| 406 | + cifti_spaces.add(FSAVERAGE_DENSITY[fsaverage_den]) |
399 | 407 | cifti_output = cifti_output and cifti_spaces
|
400 | 408 | func_derivatives_wf = init_func_derivatives_wf(
|
401 | 409 | bids_root=layout.root,
|
@@ -848,20 +856,28 @@ def init_func_preproc_wf(
|
848 | 856 | ])
|
849 | 857 |
|
850 | 858 | if cifti_output:
|
| 859 | + from niworkflows.interfaces.utility import KeySelect |
851 | 860 | bold_surf_wf.__desc__ += """\
|
852 | 861 | *Grayordinates* files [@hcppipelines], which combine surface-sampled
|
853 | 862 | data and volume-sampled data, were also generated.
|
854 | 863 | """
|
| 864 | + select_std = pe.Node(KeySelect(fields=['bold_std']), |
| 865 | + name='select_std', run_without_submitting=True) |
| 866 | + select_std.inputs.key = 'MNI152NLin2009cAsym' |
| 867 | + |
855 | 868 | gen_cifti = pe.MapNode(GenerateCifti(), iterfield=["surface_target", "gifti_files"],
|
856 | 869 | name="gen_cifti")
|
857 | 870 | gen_cifti.inputs.TR = metadata.get("RepetitionTime")
|
858 |
| - gen_cifti.inputs.surface_target = cifti_spaces |
| 871 | + gen_cifti.inputs.surface_target = list(cifti_spaces) |
859 | 872 |
|
860 | 873 | workflow.connect([
|
| 874 | + (bold_std_trans_wf, select_std, [ |
| 875 | + ('outputnode.templates', 'keys'), |
| 876 | + ('outputnode.bold_std', 'bold_std')]), |
861 | 877 | (bold_surf_wf, gen_cifti, [
|
862 | 878 | ('outputnode.surfaces', 'gifti_files')]),
|
863 | 879 | (inputnode, gen_cifti, [('subjects_dir', 'subjects_dir')]),
|
864 |
| - (bold_std_trans_wf, gen_cifti, [('outputnode.bold_std', 'bold_file')]), |
| 880 | + (select_std, gen_cifti, [('bold_std', 'bold_file')]), |
865 | 881 | (gen_cifti, outputnode, [('out_file', 'bold_cifti'),
|
866 | 882 | ('variant', 'cifti_variant'),
|
867 | 883 | ('variant_key', 'cifti_variant_key')]),
|
|
0 commit comments