Brain mask from FreeSurfer (refined brain mask) is missing parts of the brain

I’m using fMRIPrep v21.0.0 via singularity. It’s set to use both antsbrainextraction (OASIS30ANTs template) and FreeSurfer. Results through anat_preproc_wf/brain_extraction_wf/apply_mask/mapflow/_apply_mask0 look fine. However, after FreeSurfer is run, through “niworkflows.interfaces.freesurfer.RefineBrainMask” (fmriprep_wf.single_subject_SUBJECT_wf.anat_preproc_wf.anat_derivatives_wf.ds_t1w_mask), things fall apart. The brain mask in my anat folder often is missing sections of ventral frontal, temporal pole, etc. If I’m following the worflow correctly it looks like the outputs from FreeSurfer are refining my mask, causing this error. The results look quite variable depending on the subject.

If that is indeed the case, I assume that I can make the proper FreeSurfer/recon edits until I’m satisfied? Can I then somehow call fRMIPrep and have it recognize those changes and fix the files in my anat folder? If so, do I need to deleted any particular folders in my /work directory? Would I need to modify my singularity call to fMRIPrep?

You may be able to rerun with the same command and work directory, as fMRIPrep should detect that there have been changes to the FreeSurfer inputs. However, if it doesn’t detect the changes, you should be able to remove anat_preproc_wf/surface_recon_wf/refine to re-run that particular node.