Skip to content

Commit

Permalink
FIX: Revert to FAST for tissue probability maps
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Aug 31, 2021
1 parent 80f0c80 commit c470287
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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'),
Expand Down

0 comments on commit c470287

Please sign in to comment.