FMRIPREP: N4BiasFieldCorrection fails

Dear fmripreppers,

I am experiencing weird EPI to T1 registrations for some FMRI sessions:


(this ‘was’ a whole brain scan of a healthy subject)

After going through the working directory, I think this comes from N4BiasFieldCorrection, because after this stage the output looks like the image above. Furthermore, calling N4BiasFieldCorrection with the fmriprep arguments and additionally –shrinkage-factor 3 seems to solve the problem.

This only happens for some of the MRI sessions, while others work fine.

I uploaded the command.txt and the input and output files for the N4BiasFieldCorrection call here.

I am happy to provide more information if needed,
onu

EDIT: I am using fmriprep version v1.3.1 with call
singularity run -B /data/pt_01994,/data/pt_01756/tmp/fmriprep_wd:/wd
/data/pt_01994/fmriprep-latest.simg
/data/pt_01994/bids
/data/pt_01994/fmriprep/output/
–fs-license-file /data/pt_01994/fmriprep/license.txt
participant --participant-label 01 02 03 04
–t2s-coreg
–output-space T1w template
–nthreads 10
-w /wda/
–fs-no-reconall

Does the dataset have Single Band references? (sbref)

Hello Oscar,

no we did not save sbrefs.
In the meantime I reran fmriprep for the subjects that had failed in the first go with –force-bbr and this ‘solved’ the problem.

Glad you got that sorted out. Could you share the output log from fMRIPrep for the failing case? we would be interested in investigating the original cause of failure.

There was no error detected, so there is no log directory in the fmriprep/sub-04 folder.
Or do you refer to the .html report?

I could ralso erun fmriprep with the –verbose flag if that helps.

Yes, I meant the output from fMRIPrep. I think the argument -vvv will give us enough verbosity. Thanks!

I am experiencing the same issue as described above.

Re-running fmriprep with --force-bbr did not fix the N4 bias field correction. Outside of fmriprep, I called N4BiasFieldCorrection with the fmriprep arguments with the addition of --shrink-factor 3. That manages to produce a reasonable image.
Is it possible to run the N4BiasFieldCorrection inside the fmriprep call with the --shrink-factor 3 included?

Hi @oesteban,

We are experiencing a similar issue to @Alexander_Barnett, where in some subjects N4BiasFieldCorrection has failed, is there any update on a solution?

We have run reconall, BBR, and here is the output log for this sub:

[environment]
cpu_count = 4
exec_docker_version = “19.03.8”
exec_env = “fmriprep-docker”
free_mem = 11.6
overcommit_policy = “always”
overcommit_limit = “50%”
nipype_version = “1.5.0”
templateflow_version = “0.6.2”
version = “20.1.1”

[execution]
bids_dir = “/data”
bids_description_hash = “6ea419db713e2f79c762b87939f581089c1ed3aa5fb14688b2fe6ba629b5048d”
boilerplate_only = false
debug = false
fs_license_file = “/opt/freesurfer/license.txt”
fs_subjects_dir = “/out/freesurfer”
layout = “BIDS Layout: …/data | Subjects: 23 | Sessions: 46 | Runs: 0”
log_dir = “/out/fmriprep/logs”
log_level = 25
low_mem = false
md_only_boilerplate = false
notrack = false
output_dir = “/out”
output_spaces = “MNI152NLin2009cAsym:res-native”
reports_only = false
run_uuid = “20200806-075542_26cb7f18-f6e5-42ac-bda2-523910558694”
participant_label = [ “001”, “002”, “003”, “004”, “005”, “007”, “008”, “009”, “010”, “011”, “012”, “013”, “014”, “016”, “017”, “018”, “019”, “020”, “021”, “022”, “024”, “025”, “026”,]
templateflow_home = “/home/fmriprep/.cache/templateflow”
work_dir = “/scratch”
write_graph = false

[workflow]
anat_only = false
aroma_err_on_warn = false
aroma_melodic_dim = -200
bold2t1w_dof = 6
bold2t1w_init = “register”
cifti_output = false
fmap_bspline = false
force_syn = false
hires = true
ignore = []
longitudinal = false
medial_surface_nan = false
regressors_all_comps = false
regressors_dvars_th = 1.5
regressors_fd_th = 0.5
run_reconall = true
skull_strip_fixed_seed = false
skull_strip_template = “OASIS30ANTs”
skull_strip_t1w = “force”
spaces = “MNI152NLin2009cAsym:res-native”
use_aroma = false
use_syn_sdc = false

[nipype]
crashfile_format = “txt”
get_linked_libs = false
nprocs = 4
omp_nthreads = 3
plugin = “MultiProc”
resource_monitor = false
stop_on_first_crash = false

[seeds]
master = 56708
ants = 4767

[nipype.plugin_args]
maxtasksperchild = 1
raise_insufficient = false

Thanks!