CPAC use of previously processed FreeSurfer Directories- where and how

Hi All,
We’ve painstakingly processed a huge dataset through Freesurfer including manual edits. I’d like to use those FreeSurfer outputs, but I am unsure where to specify the SUBJECTS_DIR in the in CPAC 1.85 config files. I could assume that it takes it from the environmental variable, but since I’m in Docker, that probably isn’t going to be right. do I specify it in the docker command via the cpac wrapper?


Hi @Joshua_Lee,

I am not a CPAC person, but have you tried experimenting with the --env and --env-file arguments for docker run?


I have not, but thank you for the suggestion.

It looks like the syntax hasn’t made its way into the user guide yet, but I believe the only way to do it currently is with a data config file with T1w and freesurfer_dir subkeys under the anat key like

- anat:
    T1w: $PATH_TO/T1w.nii.gz
    freesurfer_dir: $PATH_TO/freesurfer/$SUBDIR/$SUBDIR
      scan: $PATH_TO/run-1_bold.nii.gz
      scan_parameters: $PATH_TO/run-1_bold.json
      scan: $PATH_TO/run-2_bold.nii.gz
      scan_parameters: $PATH_TO/run-2_bold.json
  site: $SITE
  subject_id: $SUB
  unique_id: $SES

(of course filling in the relevant paths and strings for your subjects).

Then you’ll also need a pipeline config to specify that you want to ingress FreeSurfer outputs and not re-run recon-all like

    run_reconall: Off
    ingress_reconall: On

plus whatever other options you want to configure under surface_analysis (see Default pipeline configuration YAML file - C-PAC 1.8.5 Beta documentation for an annotated example pipeline config)

I’ll try to track down the instructions and get them added to the user docs (and post them here).

1 Like