Preprocessing takes 76 hours in fMRIPrep!

Hi everybody! My labmate and I are first time fMRIPrep users and we’re working with macOS Monterey:M2, 24 GB, Docker: 4.12.0, fMRIprep: 20.2.7. The problem is that it takes 76 hours for fMRIPrep to do preprocessing for one subject! Is there anything that we can do to make this step any shorter?

The code we’re using: fmriprep-docker /Users/User/Desktop/resting/sub-01 /Users/User/Desktop/resting/sub-01 participant --output-spaces func fsnative MNI152NLin2009cAsym:res-2 MNI152Lin:res-2 MNI152NLin6Asym:res-2 --skip_bids_validation --use-aroma --ignore fieldmaps --cifti-output --use-syn-sdc --fs-license-file /Users/User/Desktop/resting/license.txt --low-mem

Thank you in advance for your help!

Hi,

You can add more CPUS (depending on your machine). You also have a ton of output spaces and extra steps. Do you really need each one of those? Also, subsequent runs should be quicker since FreeSurfer outputs can be reused. It is also not clear from your question how much data there are per participant.

Best,
Steven

Thank you for your reply Steven. We tried doing preprocessing of the same participant with the same code and it takes 8 hours on another Mac with Intel 2,8 GHz Quad-Core i7 but it takes 76 hours on the Mac with M2 chip. How is that possible? We are already using 8 (highest) CPUs on Docker.

What do you mean by “how much data per participant”? I also attached the related file for one subject (fMRIprep4 image):

Thank you in advance for your help :slight_smile:

Were you reusing FreeSurfer outputs? And as I said in the last answer, you have a lot of extra processing steps (e.g. lots of output spaces, cifti, AROMA, syn-sdc). I do not know why M2 would take that much longer, but it could be because the apps that fMRIPrep uses are not optimized for Mac silicon yet.

If you are worried about time, you can try processing your data on Brainlife.io. It’s free, and you can process large amounts of data simultaneously on the cloud.

Best,
Steven

Hi Steven! I apologize for the lack of reply. Thank you very much for the suggestion! I’ve tried using Brainlife for the preprocessing part of my resting-state fMRI data but I encountered a strange problem. I downloaded the fMRI-prep output files but most of the files can’t be unzipped. I even transfer them to Windows and it says the zipped file is broken. There was no error message in the analysis. What could be the source of the problem here?

Are you referring to the .nii.gz files? You are not supposed to unzip those. Most neuroimaging softwares will work with them in compressed form.

No, I’m referring to the fmriprep.tar files. I added the SS of the output files (7 fmriprep output files I’m trying to download).

The error message I’m getting: Unable to expand “636aa44d6408745da7bfd42e.63bdc236933e5bfae48a04d6.out.fmriprep.tar” into Downloads.

Do you have a file uncompresser that can handle .tar files?

Macbook’s using Archive Utility and I also tried to unzip them with the Unarchiver but I am not sure about the source of the problem. Six of my tar files expanded with no problem but 36 of them didn’t. Is there any other program that works better with .tar files?

How are you downloading the files off of brainlife?

By clicking the download button under the fmriprep file, next to “7 files/dirs”.

I would reach out to the brainlife team. They are active on their Slack channel, see here: Contact - brainlife Documentation

1 Like

Thank you for the help, Steven.