From c470287f1843c9e2a4b39d9d6e60750eb23aac55 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 31 Aug 2021 08:03:40 -0400 Subject: [PATCH 1/2] FIX: Revert to FAST for tissue probability maps --- smriprep/workflows/anatomical.py | 37 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/smriprep/workflows/anatomical.py b/smriprep/workflows/anatomical.py index 932bc0460c..ade5e1f964 100644 --- a/smriprep/workflows/anatomical.py +++ b/smriprep/workflows/anatomical.py @@ -408,31 +408,28 @@ def _check_img(img): ]), ]) - if not freesurfer: # Flag --fs-no-reconall is set - return - # Brain tissue segmentation - FAST produces: 0 (bg), 1 (wm), 2 (csf), 3 (gm) - t1w_dseg = pe.Node(fsl.FAST(segments=True, no_bias=True, probability_maps=True), - name='t1w_dseg', mem_gb=3) - lut_t1w_dseg.inputs.lut = (0, 3, 1, 2) # Maps: 0 -> 0, 3 -> 1, 1 -> 2, 2 -> 3. - fast2bids = pe.Node(niu.Function(function=_probseg_fast2bids), name="fast2bids", - run_without_submitting=True) + # Brain tissue segmentation - FAST produces: 0 (bg), 1 (wm), 2 (csf), 3 (gm) + t1w_dseg = pe.Node(fsl.FAST(segments=True, no_bias=True, probability_maps=True), + name='t1w_dseg', mem_gb=3) + lut_t1w_dseg.inputs.lut = (0, 3, 1, 2) # Maps: 0 -> 0, 3 -> 1, 1 -> 2, 2 -> 3. + fast2bids = pe.Node(niu.Function(function=_probseg_fast2bids), name="fast2bids", + run_without_submitting=True) + workflow.connect([ + (buffernode, t1w_dseg, [('t1w_brain', 'in_files')]), + (t1w_dseg, lut_t1w_dseg, [('partial_volume_map', 'in_dseg')]), + (t1w_dseg, fast2bids, [('partial_volume_files', 'inlist')]), + (fast2bids, anat_norm_wf, [('out', 'inputnode.moving_tpms')]), + (fast2bids, outputnode, [('out', 't1w_tpms')]), + ]) + if not freesurfer: # Flag --fs-no-reconall is set - return workflow.connect([ (brain_extraction_wf, buffernode, [ (('outputnode.out_file', _pop), 't1w_brain'), ('outputnode.out_mask', 't1w_mask')]), - (buffernode, t1w_dseg, [('t1w_brain', 'in_files')]), - (t1w_dseg, lut_t1w_dseg, [('partial_volume_map', 'in_dseg')]), - (t1w_dseg, fast2bids, [('partial_volume_files', 'inlist')]), - (fast2bids, anat_norm_wf, [('out', 'inputnode.moving_tpms')]), - (fast2bids, outputnode, [('out', 't1w_tpms')]), ]) return workflow - # Map FS' aseg labels onto three-tissue segmentation - lut_t1w_dseg.inputs.lut = _aseg_to_three() - split_seg = pe.Node(niu.Function(function=_split_segments), - name='split_seg') - # check for older IsRunning files and remove accordingly fs_isrunning = pe.Node(niu.Function(function=_fs_isRunning), overwrite=True, name='fs_isrunning') @@ -460,12 +457,6 @@ def _check_img(img): (('outputnode.bias_corrected', _pop), 'in_file')]), (surface_recon_wf, applyrefined, [ ('outputnode.out_brainmask', 'mask_file')]), - (surface_recon_wf, lut_t1w_dseg, [ - ('outputnode.out_aseg', 'in_dseg')]), - (lut_t1w_dseg, split_seg, [('out', 'in_file')]), - (split_seg, anat_norm_wf, [ - ('out', 'inputnode.moving_tpms')]), - (split_seg, outputnode, [('out', 't1w_tpms')]), (surface_recon_wf, outputnode, [ ('outputnode.subjects_dir', 'subjects_dir'), ('outputnode.subject_id', 'subject_id'), From fc04f8a2977871c7494603cb9115882080e500fe Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 31 Aug 2021 12:22:08 -0400 Subject: [PATCH 2/2] PIN: nilearn ~= 0.6.2 --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index c2e9b26384..44f66fef68 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,6 +23,7 @@ install_requires = matplotlib >= 2.2.0 nibabel >= 3.0.1 nipype >= 1.5.1 + nilearn ~= 0.6.2 niworkflows ~= 1.3.1 numpy packaging