CPAC: None of Listed Resources In Node Block Exist In Resource Pool

Summary of what happened:

I am trying to modify the segmentation method from FSL-BET to FreeSurfer in the CPAC default pipeline. However, I get an error related to node block when I try to make this change. CPAC default pipeline works without issues, but having challenges with making the segmentation change.

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

cpac run GU_28830 OUTPUT participant --pipeline-file cpac_1_24.yml

Version:

CPAC 1.8.6

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

Singularity run on a HPC

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

Running BIDS validator
#### Running C-PAC
Number of participants to run in parallel: 1
Input directory: /vf/users/NNU_NDData_Projs/ASD_Targeting/MRI_Raw/ABIDE_2/ABIDE_2_BIDS/GU_28830
Output directory: /vf/users/NNU_NDData_Projs/ASD_Targeting/MRI_Raw/ABIDE_2/ABIDE_2_BIDS/OUTPUT_1_24/output
Working directory: /vf/users/NNU_NDData_Projs/ASD_Targeting/MRI_Raw/ABIDE_2/ABIDE_2_BIDS/OUTPUT_1_24/working
Log directory: /vf/users/NNU_NDData_Projs/ASD_Targeting/MRI_Raw/ABIDE_2/ABIDE_2_BIDS/OUTPUT_1_24/log
Remove working directory: True
Available memory: 1.0 (GB)
Available threads: 1
Number of threads for ANTs: 1
Parsing /vf/users/NNU_NDData_Projs/ASD_Targeting/MRI_Raw/ABIDE_2/ABIDE_2_BIDS/GU_28830..
Starting participant level processing
Run called with config file /vf/users/NNU_NDData_Projs/ASD_Targeting/MRI_Raw/ABIDE_2/ABIDE_2_BIDS/OUTPUT_1_24/log/pipeline_cpac-default-pipeline/sub-GU28830_ses-1/cpac_pipeline_config_9c8e9d7f_2024-01-24T10-11-26Z.yml
240124-10:11:30,214 nipype.workflow INFO:

Relevant log outputs (up to 20 lines):

240124-10:11:31,386 nipype.workflow ERROR:
	 Building workflow failed
Traceback (most recent call last):
  File "/code/CPAC/pipeline/cpac_pipeline.py", line 1497, in build_workflow
    wf = connect_pipeline(wf, cfg, rpool, pipeline_blocks)
  File "/code/CPAC/pipeline/cpac_pipeline.py", line 1123, in connect_pipeline
    wf = nb.connect_block(wf, cfg, rpool)
  File "/code/CPAC/pipeline/engine.py", line 1468, in connect_block
    for pipe_idx, strat_pool in rpool.get_strats(
  File "/code/CPAC/pipeline/engine.py", line 552, in get_strats
    raise LookupError('\n\n[!] C-PAC says: None of the listed '
LookupError: When trying to connect one of the node blocks ['tissue_seg_fsl_fast', 'tissue_seg_ants_prior', 'tissue_seg_freesurfer'] to workflow 'cpac_sub-GU28830_ses-1' after node block 'register_symmetric_FSL_anat_to_template': 

[!] C-PAC says: None of the listed resources in the node block being connected exist in the resource pool.

Resources:
['freesurfer-subject-dir', 'pipeline-fs_raw-average', 'pipeline-fs_subcortical-seg']

Screenshots / relevant information:

I am not seeing a resource pool in the default pipeline, so I am confused about where this error may be.

Hi, thank you for reaching out! If you are not running FreeSurfer or pulling in FreeSurfer outputs, the FreeSurfer tissue segmentation option won’t work. That option creates surface-derived tissue masks and relies on FreeSurfer outputs to do so.

Thanks. Is there a section in the pipeline where I can specify that I want to run FreeSurfer?

Yes, if you wish to run FreeSurfer you can toggle it in the surface_analysis section. Turn on abcd_prefreesurfer_prep and run_reconall, and if you wish to run post-FreeSurfer you can turn that on here as well.

If you have precomputed FreeSurfer outputs, you can turn on ingress_reconall and follow these instructions to specify your FreeSurfer output directory in the data config.

surface_analysis:

  # Run freesurfer_abcd_preproc to obtain preprocessed T1w for reconall
  abcd_prefreesurfer_prep:
    run: On

  # Will run Freesurfer for surface-based analysis. Will output traditional Freesurfer derivatives.
  # If you wish to employ Freesurfer outputs for brain masking or tissue segmentation in the voxel-based pipeline,
  # select those 'Freesurfer-' labeled options further below in anatomical_preproc.
  freesurfer:
    run_reconall: On

    # Ingress freesurfer recon-all folder
    ingress_reconall: Off

  # Run ABCD-HCP post FreeSurfer and fMRISurface pipeline
  post_freesurfer:
    run: On

Let me know if you have any trouble!

I am going to jump in here and ask how I can specify already processed FreeSurfer outputs into the connfig file.
Thanks.

Hi Joshua! You can follow these instructions. Basically, you just have to add a freesurfer_dir to the anat subsection of the data config for each subject you want to run. It should look like this:

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

Let me know if you have any issues with this!