# Troubleshooting and Help¶

C-PAC is beta software, which means that it is still under active development and has not yet undergone large-scale testing. As such, although we have done our best to ensure a stable pipeline, there may still be a few bugs that we did not catch.

If you find a bug, or would like to request a new feature please visit the GitHub Issues page for CPAC.

If you have a question that is not answered in the User Guide or encounter an issue not covered in the Common Issues and Solutions section below, you should submit it to the C-PAC user forum.

## View Crash Files¶

Crash files are generated by Nipype, and can be viewed from the terminal by typing:

nipypecli crash crash-file.pklz


Where crash-file.pklz is the name of the crash file you wish to view.

## Common Issues¶

1. My run is crashing with the crash files indicating a memory error. What is going on?

This issue often occurs when scans are resampled to a higher resolution. This is because functional images, the template that you are resampling to, and the resulting generated image are all loaded into memory at various points in the C-PAC pipeline. Typically these images are compressed, but they will be uncompressed when loaded. If the amount of memory required to load the images exceeds the amount of memory available, C-PAC will crash.

For instance, suppose you are resampling a 50 MB (100 MB uncompressed) resting-state scan with 3 mm isotropic voxels to a 3 MB (15 MB uncompressed) 1 mm template. By dividing the voxel volume for the original resting state scan by the voxel volume for the template, you can determine that the voxel count of the resampled resting-state scan will be 27 times greater. Therefore, if you multiply the uncompressed file size by 27 you can estimate that the resampled scan alone will take up 2.7 GB of space. You will need at least this much RAM for C-PAC to load the scan. If you are running multiple subjects simultaneously, you would need to multiply this estimate by the number of subjects. Note that the template, original image, and any other open applications will also have their own memory requirements, so the estimate would be closer to 2.8 GB per subject plus however much RAM is used before C-PAC is started (assuming no new applications are started mid-run).

To avoid this error, you will need to either get more RAM, run fewer subjects at once, or consider downsampling your template to a lower resolution.

2. I’m trying to run the C-PAC GUI on a Mac with Anaconda, but I am being told that I need a “Framework build of python”. What is wrong with Anaconda?

Good news: nothing is wrong with Anaconda! This error comes up because wx (the framework the C-PAC GUI is based upon) does not play well with Python virtual environments (such as Anaconda), but there are several fixes. One fix is to follow the instructions here starting with the paragraph that begins with “At this point”. If this fails the GUI can also be started up using the pythonw executable. To accommplish this, you would first type pythonw from within a terminal and then in the Python interactive session type:

import CPAC.GUI
CPAC.GUI.run()

3. I’m re-running a pipeline, but I am receiving many crashes. Most of these crashes tell me that a file that has been moved or no longer exists is being used as an input for a step in the C-PAC pipeline. What is going on and how can I tell C-PAC to use the correct inputs?

One of the features of Nipype (which C-PAC is built upon) is that steps that have been run before are not re-run when you re-start a pipeline. Nipype accomplishes this by associating a value with a step based on the properties of that step (i.e., hashing). Nipype has two potential values that it can associate with a step: a value based on the size and date of the files created by the step, and a value based upon the data present within the files themselves. The first value is what C-PAC uses with its pipelines, since it is much more computationally practical. Since this value only looks at the size and date of files to determine whether or not a step has been run, it will not see that the file’s path has changed, and it will assume that all paths are consistent with the path structure from when the pipeline was run before.

To work around this error, you will need to delete the working directory associated with the previous run and create a new directory to replace it for the new run.

4. How should I cite C-PAC in my paper?

Please cite the abstract located here.