Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Label BA1_exvivo does not exist in SUBJECTS_DIR fsaverage! The fsaverage link probably points to an older freesurfer version #3258

Open
WangYunHong98 opened this issue Mar 22, 2024 · 8 comments
Labels

Comments

@WangYunHong98
Copy link

What happened?

I am running fmriprep-23.2.1 with singularity on Slurm and am getting the error described in the title. This error occurs for most subjects. What should I do about it?

What command did you use?

TEMPLATEFLOW_HOST_HOME=$HOME/.cache/templateflow
FMRIPREP_HOST_CACHE=$HOME/.cache/fmriprep

export SINGULARITYENV_TEMPLATEFLOW_HOME="/templateflow"
export SINGULARITYENV_FS_LICENSE="/share/apps/imaging/freesurfer-7.3.2/license.txt"

singularity run \
        --cleanenv \
        -B $PROJECT:/rootdir \
        -B $BIDS_DIR:/data \
        -B $DERIVS_DIR:/output \
        -B $WORK_DIR:/work \
        -B ${TEMPLATEFLOW_HOST_HOME}:${SINGULARITYENV_TEMPLATEFLOW_HOME} \
        -B ${SINGULARITYENV_FS_LICENSE}:/freesurfer_license \
    ${FMRIPREP} /data /output \
    participant --participant_label $subject \
    -w /work \
    -vv \
    --fs-license-file /freesurfer_license \
    --mem-mb 32000 \
    --n-cpus 8 \
    --write-graph \
    --output-spaces MNI152NLin2009cAsym:res-2 \
    --return-all-components

exitcode=$?

What version of fMRIPrep are you running?

23.2.1

How are you running fMRIPrep?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

/output/sourcedata/freesurfer/sub-023023/label
#--------------------------------------------
#@# BA_exvivo Labels lh Thu Mar 21 08:20:45 EDT 2024
-------------------------------------------------------------------------
ERROR: Label BA1_exvivo does not exist in SUBJECTS_DIR fsaverage!
The fsaverage link probably points to an older freesurfer version
-------------------------------------------------------------------------

Additional information / screenshots

No response

@effigies
Copy link
Member

So the issue is that in your $DERIVS_DIR/freesurfer, there's a copy of fsaverage that comes from an older FreeSurfer version. You probably just want to delete that.

@tsalo
Copy link
Collaborator

tsalo commented Apr 2, 2024

I just got the same error with 23.2.1. I used empty output and working directories, so I don't think there's an old fsaverage copy in $DERIVS_DIR/freesurfer in my case.

@effigies
Copy link
Member

effigies commented Apr 2, 2024

Is it possible there's a race and two processes are creating the freesurfer/ directory?

@tsalo
Copy link
Collaborator

tsalo commented Apr 2, 2024

I'm running fMRIPrep with a job array (one job for each of 8 subjects), but that's all that's writing to the freesurfer/ directory. I did just clear out the working and output directories and resubmitted my jobs with --contain-all, so maybe that will fix it. If it doesn't I'll follow up here.

@tsalo
Copy link
Collaborator

tsalo commented Apr 3, 2024

Adding --contain-all seems to have resolved the issue for me.

@WangYunHong98 did clearing out the working and output directories fix the problem for you?

@WangYunHong98
Copy link
Author

Hi @tsalo

I cleaned out all directories and added --fs-subjects-dir /output/freesurfer. It works for me.

@WangYunHong98
Copy link
Author

Hi @effigies

Is there a possibility that if I first submit the fmriprep job for dataset 1 in slurm, and at the same time I submit another freesurfer job in terminal (no it's with slurm), setting the environment variable $SUBJECTS_DIR. So would this situation cause this error to be reported?

Best,
Yunhong

@effigies
Copy link
Member

If you're submitting FreeSurfer and fMRIPrep jobs that both use the same subject directory, yes, I would expect conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants