Fmriprep --anat-only

Dear fmriprep experts,

I am running fmriprep --anat-only and in the mri folder it has appeared the following error.log that it says:
mghRead(/home/rosalia/Desktop/FREE_NEW/aseg.manedit.mgz, -1): could not open file

Should I be concerned about it?

Kind regards,

Hi Rosie,

Can you give us the command you are using to run fMRIPrep and which version?


Hi Steven,

The fmriprep version is: fmriprep-20.2.1.sing

The command I am running is:
singularity run -e -B /media /media/rosalia/Nuevo_vol/fmriprep-20.2.1.simg --participant-label sub-003 -w /media/rosalia/Nuevo_vol/ARTICO/work --anat-only --ignore fieldmaps sbref,flair --force-bbr --fd-spike-threshold 0.2 --use-syn-sdc --omp-nthreads 16 --nthreads 16 --cifti-output 91k --fs-license-file /media/rosalia/Nuevo_vol/license.txt /media/rosalia/Nuevo_vol/ARTICO/bids_dir /media/rosalia/Nuevo_vol/ARTICO/derivatives/ participant

It is taking forever to run FreeSurfer…


FreeSurfer does take a long time to run, how much memory, cpus, and time are you allotting fMRIprep?


32GB RAM, 8 CPUs, and 1TB of space.

How many days should I expect to run one subject (only T1 and T2, not FLAIR) ?


How are you running fmriprep? It’s possible that not all of those resources are being devoted to running it. For example, Docker has its own memory limitations which you have to change, separate from the overall machine. When I run fmriprep, the FreeSurfer part should not take anymore than 1 day, and I devote 20gb and 8 cpus. At what point does your original error occur, and does it cause the whole process to stop?

Hi Steven,

How could I change those memory limitations? Because the process is only using 1 cpu…and minimum percentage of the others. The process has not stopped but it is running from Tuesday, 8.30 am. The error occurred on Wednesday…

It would be nice if you tell me how to change the memory limitations…

Best wishes,

What operating system are you using? Are you just running singularity in your terminal or as a background job?

I am running singularity in my terminal.

My operating system is: Linux Mint 18.3 Cinnamon 64-bit.
Cinnamon version: 3.6.7

You can try submitting it as an sbatch job where you can explicitly state the memory usage and have it run in the background. Do you know how to do that?

Sorry, I do not know how to do it.

First confirm that you can do sbatch jobs by running which sbatch in the your terminal and seeing if you have a command for it.

If you do, you can make a text file called “” and in the top of the file add the following text (and change the parameters as needed).

#SBATCH --time=3-00:00:00
#SBATCH --mem=20GB
#SBATCH --cpus-per-task=8
#SBATCH -J fmriprep 

Then under that paste in your singularity command. Then in terminal, run sbatch and your job should begin running in the background. You will also notice a log file appear in the location you run the command which you can use to monitor your progress.

HI Steve,

Not sure what should I include in time.

Thank you,

How much data are there per subject? 3 days, as I put, should be enough. If not you can change it and resubmit the job.

Hi Steve,

Thank you very much.
A subject finished without error, however, after I checked it I saw that some anatomical regions (mainly frontal and temporal regions) were not fully covered

I wonder how I could fix this with fmriprep.

Kind regards,

Glad to hear it finished! Could you possibly post a screenshot of the HTML for that subject so I can see what you mean? And is the coverage there in the original T1 and fMRI file?

Hi Steve,

I did not use fMRI this time because the fMRI had problems. So, I thought just process the structural data for now…and once the fMRI problem is solved, include it.

How could I attach the data?

If you have a brain viewing program, such as FSLeyes (included with FSL), Freeview (included with Freesurfer), or Mango (standalone application Research Imaging Institute — Mango), you can view the T1 file to see if this is a problem with fMRIPrep or a problem with the T1 file.

Hi Steve,

No idea what I should look into.
Here it is my T1w using Freeview

The original T1 file should be in your bids directory and have a .nii.gz file extension. The .mgz you put here I think is a FreeSurfer derivative.