Qsiprep: Cannot run qsiprep. Missing dependencies:

Hi everyone!

I have problem with running qsiprep with --do-reconall flag. It returns an error that there are missing dependencies.

I run qsiprep with the next .sbatch file on my HPC using slurm for one subject:

#!/bin/bash
#SBATCH --time=3-0:0
#SBATCH --cpus-per-task=4
#SBATCH --nodes=1

export FREESURFER_HOME=/home/elevchenko/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.sh
module load singularity
singularity run --cleanenv ~/qsiprep-0.15.1.sif ~/Entropy/raw_data/patients/ ~/Entropy/derivatives_qsiprep/patients/ participant --participant-label $(awk "NR==$SUBJ_I" ~/Entropy/patients_dwi_list.txt) -w ~/Entropy/work_qsiprep/patients/ --fs-license-file ~/freesurfer/license.txt --skip_bids_validation --output-resolution 1.2 --resource-monitor --do-reconall

As a result, I have an error:

[WARNING] This document format requires a nonempty <title> element.
  Please specify either 'title' or 'pagetitle' in the metadata.
  Falling back to 'CITATION'
Cannot run qsiprep. Missing dependencies:
	mri_label2vol (Interface: Label2Vol)
	mri_label2vol (Interface: Label2Vol)
	mri_convert (Interface: MRIConvert)
	mri_convert (Interface: MRIConvert)
	mris_convert (Interface: MRIsConvert)
	mris_expand (Interface: MakeMidthickness)
	recon-all (Interface: ReconAll)
	recon-all (Interface: ReconAll)
	recon-all (Interface: ReconAll)
	recon-all (Interface: ReconAll)
	recon-all (Interface: ReconAllRPT)

Looks like that qsiprep can’t find the FreeSurfer, but I am pretty sure that it is installed because when I am login to my HPC and setup freesurfer paths I can see that is works fine:

[elevchenko@sms ~]$ export FREESURFER_HOME=/home/elevchenko/freesurfer
[elevchenko@sms ~]$ source $FREESURFER_HOME/SetUpFreeSurfer.sh
-------- freesurfer-linux-centos6_x86_64-7.2.0-20210720-aa8f76b --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME   /home/elevchenko/freesurfer
FSFAST_HOME       /home/elevchenko/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR      /home/elevchenko/freesurfer/subjects
MNI_DIR           /home/elevchenko/freesurfer/mni
[elevchenko@sms ~]$ which freeview
~/freesurfer/bin/freeview

I am not sure what could be the solution for this, I tried to insert freesurfer setup to my sbtach file, but it doesn’t help. Any advice is helpful :slight_smile:

Best,
Egor

Hello,

The --cleanenv will make anything you do in your environment (e.g. install freesurfer) not brought into the container. I know that QSIPrep dramatically reduced its container size, maybe in doing so they deleted some recon-all dependencies.

Is there a reason you want to run FreeSurfer here? It is only used in the reconstruction pipelines, and you do not seem to be doing any reconstruction.

If you want to use freesurfer in QSIPrep (only used for the HSVS reconstruction options) would try the following:

  1. Remove the --cleanenv flag for singularity
  2. If that doesn’t work, run freesurfer or sMRIPrep (the structural workflow for fmriprep which includes freesurfer) on your subjects, and then pass in the fs-subjects-dir argument for qsiprep.

Best,
Steven

Oh yea, sure! It works for me!

Thank you, Steven!

1 Like