Skip to content

Commit

Permalink
Add quick fix check for FastSurfer
Browse files Browse the repository at this point in the history
Adds the check_fastsurfer function call to log FastSurfer outputs detected in subjects_dir and touch mri/aseg.auto_noCCseg.label_intensities.txt to prevent failure in surfaces.py as a temporary fix for nipreps#278
  • Loading branch information
pcamach2 authored Apr 23, 2022
1 parent 9b6251f commit f301f3a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from niworkflows.utils.misc import fix_multi_T1w_source_name, add_suffix
from niworkflows.anat.ants import init_brain_extraction_wf, init_n4_only_wf
from ..utils.bids import get_outputnode_spec
from ..utils.misc import apply_lut as _apply_bids_lut, fs_isRunning as _fs_isRunning
from ..utils.misc import apply_lut as _apply_bids_lut, fs_isRunning as _fs_isRunning, check_fastsurfer as _check_fastsurfer
from .norm import init_anat_norm_wf
from .outputs import init_anat_reports_wf, init_anat_derivatives_wf
from .surfaces import init_surface_recon_wf
Expand Down Expand Up @@ -514,14 +514,24 @@ def _check_img(img):
niu.Function(function=_fs_isRunning), overwrite=True, name="fs_isrunning"
)
fs_isrunning.inputs.logger = LOGGER


# check for FastSurfer .mgz files and
# touch mri/aseg.auto_noCCseg.label_intensities.txt to prevent failure in surfaces.py (temporary fix)
check_fastsurfer = pe.Node(
niu.Function(function=_check_fastsurfer), overwrite=True, name="check_fastsurfer"
)
check_fastsurfer.inputs.logger = LOGGER

# 5. Surface reconstruction (--fs-no-reconall not set)
surface_recon_wf = init_surface_recon_wf(
name="surface_recon_wf", omp_nthreads=omp_nthreads, hires=hires
)
applyrefined = pe.Node(fsl.ApplyMask(), name="applyrefined")
# fmt:off
workflow.connect([
(inputnode, check_fastsurfer, [
('subjects_dir', 'subjects_dir'),
('subject_id', 'subject_id')]),
(inputnode, fs_isrunning, [
('subjects_dir', 'subjects_dir'),
('subject_id', 'subject_id')]),
Expand Down

0 comments on commit f301f3a

Please sign in to comment.