Aslprep error with freesurfer pre-existing outputs

Summary of what happened:

Hello!!

We are processing pcasl data with aslprep version 0.6.0 with pre-existing freesurfer outputs, and get the following error.

If I use –fs-no-reconall it works. Which are the main differences regarding the outputs? How can I solve the error and use pre-existing freesurfer outputs?

Thank you in advance,
Lucía

Command used (and if a helper script was used, a link to the helper script or the command generated):

aslprep \
aslprep_Lucia/prueba_209 \
aslprep_Lucia/prueba_209/derivatives \
participant \
--participant-label sub-209 \
--basil \
--force-bbr \
--fs-subjects-dir freesurfer/outputs \
--fs-license-file aslprep_Lucia/prueba_209/license.txt

Version:

0.6.0

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

 ERROR: It appears that this subject ID is an existing
               base/template from longitudinal processing (-base):
               sub-209
               If you are trying to re-run a -base template you
               need to pass the -base and all -tp flags: 

               \' -base <templateid> -tp <tpNid> ... -all \'

               (Instead of -all you can pass other flags, such
               as -autorecon2 -autorecon3 to run only parts.)
Stderr:

Traceback:
        RuntimeError: subprocess exited with code 1

Screenshots / relevant information:


Hi @lucia_sanchez_aranda,

Can you share the structure of your FS subjects directory, for example with the tree command?

Best,
Steven

sub-209_ses-1/
        scripts/
        stats/
        surf/
        tmp/
        touch/
        trash/
sub-209_ses-1.long.sub-209/
    scripts/
    stats/
    surf/
    tmp/
    touch/
    trash/
sub-209_ses-6/
 scripts/
    stats/
    surf/
    tmp/
    touch/
sub-209_ses-6.long.sub-209/
    scripts/
    stats/
    surf/
    tmp/
    touch/
    trash/

Hi @lucia_sanchez_aranda,

Xcp_d is not designed to work with longitudinal freesurfer outputs. In general, BIDS apps expect to find freesurfer outputs in $SUBJECTS_DIR/$SUB. So, if you want to try using a longitudinal output, you would have to reorganize to match that convention. That is, move the set of freesurfer outputs you want to use into its own subjects dir, and rename it as sub-209 with no additional text.

Best,
Steven

Could you show an example of how to organize the freesurfer outputs? We have have tried with the following structure and it doesn’t work:

sub-209/
label
mri
scripts
stats
surf
tmp
touch
trash

Did you mean that we have to include this folders in the bids directory?

Hi @lucia_sanchez_aranda,

It would help to know all the changes you made and the resulting error.

For example,

BIDS
- - derivatives
- - - - freesurfer
- - - - - - session_x
- - - - - - - - sub-209
- - - - - - - - - - label
- - - - - - - - - - mri
- - - - - - - - - - etc....

with your fs_subjects_dir in ASLPREP being BIDS/derivatives/freesurfer/session_x

Best,
Steven

Thanks for your answer!

I did what you suggested and I structured my data like this:

BIDS/
   derivatives/
      freesurfer/
          session_1/
              sub-209/
                  scripts/
                  stats/
                  surf/
                  tmp/
                  touch/
                  trash/
           session_6/
               sub-209/
                  scripts/
                  stats/
                  surf/
                  tmp/
                  touch/
                  trash/

At first it seemed to work, but then crashed again with the following errors:

ERROR: Flag -rh-only unrecognized.
	-autorecon-hemi rh -noparcstats -noparcstats2 -noparcstats3 -nohyporelabel -nobalabels -rh-only -openmp 8 -subjid sub-209 -sd /neurodesktop-storage/Agueda/BIDS/derivatives/aslprep_Lucia/prueba_209/derivatives/freesurfer -nofix -nowhite -nosmooth2 -noinflate2 -nocurvHK -nocurvstats -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortparc3 -nopctsurfcon
	Linux 2ea1613410b5 6.5.11-linuxkit #1 SMP PREEMPT_DYNAMIC Wed Dec  6 17:14:50 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

	recon-all -s  exited with ERRORS at Wed Apr  3 16:52:56 UTC 2024

	For more details, see the log file 
	To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting
Stdout:
	ERROR: Flag -lh-only unrecognized.
	-autorecon-hemi lh -noparcstats -noparcstats2 -noparcstats3 -nohyporelabel -nobalabels -lh-only -openmp 8 -subjid sub-209 -sd /neurodesktop-storage/Agueda/BIDS/derivatives/aslprep_Lucia/prueba_209/derivatives/freesurfer -nofix -nowhite -nosmooth2 -noinflate2 -nocurvHK -nocurvstats -nosphere -nosurfreg -nojacobian_white -noavgcurv -nocortparc -nopial -nocortparc2 -nocortparc3 -nopctsurfcon
	Linux 2ea1613410b5 6.5.11-linuxkit #1 SMP PREEMPT_DYNAMIC Wed Dec  6 17:14:50 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

	recon-all -s  exited with ERRORS at Wed Apr  3 16:52:56 UTC 2024

	For more details, see the log file 
	To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Our freesurfer outputs are from version 7.4.1 longitudinal analysis, is that a problem?

Thanks in advance!