ACAPULCO Cerebellum Parcellation Errors

Summary of what happened:

When trying to run ACAPULCO using singularity, during the cerebellum parcellation step, some lines are killed and file that is needed to run the rest of the algorithm is not generated, so it errors out at the end. I’m having a hard time figuring out how to troubleshoot and why that file isn’t being generated to be able to complete the rest of the processing. I’ve tried both versions of ACAPULCO available, and still no change. Has anyone run into this or have any troubleshooting tips for me?

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

singularity run --cleanenv -B $PWD:
$PWD acapulco-0.2.1.sif -i output/<<subject>>/
<<subject>>.nii.gz -o output/<<subject>>

developer page: Files · master · Shuo Han / acapulco · GitLab

paper with the step-by-step instructions I am trying to follow: https://diedrichsenlab.org/pubs/Kerestes_jove_2022.pdf

Version:

tried with 0.2.1 and 0.3.0

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

Singularity. Currently trying to create a Docker container to try using Docker.

###Errors:

0.3.0
singularity run --cleanenv -B $PWD:$PWD acapulco-0.3.0-gpu.sif -i output/subPHCPP1005782/subPHCPP1005782.nii.gz -o output/subPHCPP1005782
N4 correction...
MNI registraion...
Cerebellum parcellation...
    From output/subPHCPP1005782/mni/subPHCPP1005782_n4_mni.nii.gz to output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg.nii.gz
Post processing...
/usr/local/bin/acapulco.sh: line 112: 140213 Killed                  cleanup_label_image.py -i $parc -o $post
    From output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg.nii.gz to output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz
Transform back to original space...
** ERROR (nifti_image_read): failed to find header file for 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'
/usr/local/bin/acapulco.sh: line 121: 140670 Segmentation fault      reg_resample -trans $inverse_aff -ref $image -flo $post -res $inverse -inter 0 -pad 0 > /dev/null
    From output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz to output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz
Calculate volumes of each region...
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/calc_volumes.py", line 21, in <module>
    seg_obj = nib.load(args.input)
  File "/usr/local/lib/python3.5/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'
    From output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz to output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_volumes.csv


0.2.1
N4 correction...
MNI registraion...
Cerebellum parcellation...
    From output/subPHCPP1005782/mni/subPHCPP1005782_n4_mni.nii.gz to output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg.nii.gz
Post processing...
/usr/local/bin/acapulco.sh: line 69: 131095 Killed                  cleanup_label_image.py -i $parc -o $post
    From output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg.nii.gz to output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz
Transform back to original space...
 file output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz does not exist . 
/usr/local/bin/acapulco.sh: line 75: 131256 Segmentation fault      antsApplyTransforms -d 3 -i $post -r $image -o $inverse -t $transform --float -n MultiLabel[1.0,3.0]
    From output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz to output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz
Report generation...
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/convert_nii", line 91, in <module>
    need_to_convert_colors=args.convert_colors)
  File "/usr/local/lib/python3.6/dist-packages/segmentation_visualization/rendering.py", line 308, in __init__
    label_image_nib = nib.load(label_image_path)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/axial/*0.png': No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/convert_nii", line 91, in <module>
    need_to_convert_colors=args.convert_colors)
  File "/usr/local/lib/python3.6/dist-packages/segmentation_visualization/rendering.py", line 308, in __init__
    label_image_nib = nib.load(label_image_path)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz'
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/axial/*0.png': No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/convert_nii", line 91, in <module>
    need_to_convert_colors=args.convert_colors)
  File "/usr/local/lib/python3.6/dist-packages/segmentation_visualization/rendering.py", line 308, in __init__
    label_image_nib = nib.load(label_image_path)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/coronal/*0.png': No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/convert_nii", line 91, in <module>
    need_to_convert_colors=args.convert_colors)
  File "/usr/local/lib/python3.6/dist-packages/segmentation_visualization/rendering.py", line 308, in __init__
    label_image_nib = nib.load(label_image_path)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz'
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/coronal/*0.png': No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/convert_nii", line 91, in <module>
    need_to_convert_colors=args.convert_colors)
  File "/usr/local/lib/python3.6/dist-packages/segmentation_visualization/rendering.py", line 308, in __init__
    label_image_nib = nib.load(label_image_path)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post/sagittal/*0.png': No such file or directory
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/convert_nii", line 91, in <module>
    need_to_convert_colors=args.convert_colors)
  File "/usr/local/lib/python3.6/dist-packages/segmentation_visualization/rendering.py", line 308, in __init__
    label_image_nib = nib.load(label_image_path)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_inverse.nii.gz'
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
ls: cannot access 'output/subPHCPP1005782/.png/subPHCPP1005782_n4_mni_seg_post_inverse/sagittal/*0.png': No such file or directory
Calculate volumes of each region...
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 42, in load
    stat_result = os.stat(filename)
FileNotFoundError: [Errno 2] No such file or directory: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/calc_volumes.py", line 21, in <module>
    seg_obj = nib.load(args.input)
  File "/usr/local/lib/python3.6/dist-packages/nibabel/loadsave.py", line 44, in load
    raise FileNotFoundError("No such file or no access: '%s'" % filename)
FileNotFoundError: No such file or no access: 'output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz'
    From output/subPHCPP1005782/parc/subPHCPP1005782_n4_mni_seg_post.nii.gz to output/subPHCPP1005782/subPHCPP1005782_n4_mni_seg_post_volumes.csv

Hi @mariastanica,

Sounds like you need to be more specific about your paths. Perhaps add $PWD/ before your input arguments (if they are indeed in $PWD).

Also for future posts please format your terminal inputs and outputs as code. You can see I did it for you this time. Use tick marks or the </> button in the text editor.

Have you checked that these files that the code is looking for exists?

Best,
Steven

Thanks for editing that for me!

I included this in my description above: during the cerebellum parcellation step, some lines are killed and file that is needed to run the rest of the algorithm is not generated, so it errors out at the end. I’m having a hard time figuring out how to troubleshoot and why that file isn’t being generated to be able to complete the rest of the processing.

So the file doesn’t exist, it’s supposed to be generated during the algorithm but I’m not sure why it isn’t being generated.

Can you give me a more specific example about how I could be more specific in my file paths? For context, I’m new to all this, so some things that are probably super obvious are not so obvious to me yet.

Thanks for all your help!!

Best,
Maria

Hi @mariastanica,

Is there documentation of a github repo for this software you can reference, so one can see how the software is supposed to be run?

Best,
Steven

Yes, I put those links in the original post. I’ve been following the instructions, but I’m still getting the error.

developer page: Files · master · Shuo Han / acapulco · GitLab

paper with the step-by-step instructions I am trying to follow: https://diedrichsenlab.org/pubs/Kerestes_jove_2022.pdf

Sorry I missed that. Are the files you’re inputting to the pipeline in $PWD? What files are created by the pipeline? Is it killed for memory reasons?

Yeah, the files I’m inputting into the pipeline are in there. The pipeline creates a variety of files, and most of them are created with no issue. It’s just when it tried to create this file towards the end (subPHCPP1005782_n4_mni_seg_post.nii.gz) that it gets killed, so the rest can’t go through. It isn’t being killed because of a memory issue.

Hi @mariastanica,

How are you sure it isn’t a memory issue?

Best,
Steven