|
| 1 | +Running C-PAC |
| 2 | +============== |
| 3 | +Overview |
| 4 | +-------- |
| 5 | + |
| 6 | +As with configuring the subject list, pipeline configuration, and group analysis files, there are two ways of executing a C-PAC run: |
| 7 | + |
| 8 | +* Using C-PAC's command line interface |
| 9 | +* Using the main dialog in the C-PAC GUI |
| 10 | + |
| 11 | +This page will also discuss how to navigate C-PAC's output structure once a run is finished. |
| 12 | + |
| 13 | +Using the Command Line Interface |
| 14 | +--------------------------------- |
| 15 | +Running Preprocessing and Individual-Level Analysis |
| 16 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 17 | + |
| 18 | +To start a C-PAC run from the command line or a shell script you can use the `cpac_run.py` utility (which is added to your path automatically upon installing C-PAC). An example of this tool's syntax is as follows: |
| 19 | + |
| 20 | +.. code-block:: bash |
| 21 | + |
| 22 | + cpac_run.py /path/to/pipeline_config.yml /path/to/CPAC_subject_list.yml |
| 23 | + |
| 24 | +Using the GUI |
| 25 | +------------- |
| 26 | + |
| 27 | +Running Preprocessing and Individual-Level Analysis |
| 28 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 29 | + |
| 30 | +You have already interacted with the *Subject Lists* and *Pipelines* panes in the main dialog in order to create new subject lists and pipeline configurations. There is, however, more to the main dialog than making new files! Both panes have a *Load* option that will load in any previously created YAML files. Additionally, there is a *View* button that allows you to inspect the text of the YAML files for the currently selected subject list or pipeline configuration. |
| 31 | +When you are ready to run C-PAC, select the subject lists and pipelines you would like to run and click the *Run Individual Level Analysis* button. |
| 32 | + |
| 33 | +The following schematic illustrates the order in which C-PAC executes. |
| 34 | + |
| 35 | +.. figure:: /_images/processing_workflow.png |
| 36 | + |
| 37 | +Subject List |
| 38 | + |
| 39 | +If you would like to use a previously generated subject list, click the *Load* button and select the appropriate YAML subject list file. If you have loaded multiple subject lists, use the checkboxes to select which subject lists you would like to run with the pipelines that have been checked in the adjacent *Pipelines* box. |
| 40 | + |
| 41 | +**Note: Do not confuse the *Load* button on the main window of the GUI with the *Load Settings* button on the Subject List Setup window shown above. The latter button is intended to load data configuration files that the subject list setup dialogue can use to create subject lists and will not work with other YAML files. The former button is for already generated subject list files.** |
| 42 | + |
| 43 | +Pipeline |
| 44 | + |
| 45 | +To modify an existing pipeline, select it and click *Edit*. |
| 46 | +To use a previously configured pipeline, click *Load* and select the appropriate pipeline configuration file. If you have loaded multiple pipelines, use the checkboxes to select which pipelines you would like to run. |
| 47 | + |
| 48 | +Running Group-Level Analysis |
| 49 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 50 | +When you are finished configuring the pipeline for group-level analysis, click save. When you are ready to run group-level analysis, select the subject lists and pipelines you would like to run and click the Run Group Level Analysis button. You will be presented with a dialog and asked to select which strategies you would like to include. |
| 51 | + |
| 52 | +Output Structure |
| 53 | +---------------- |
| 54 | + |
| 55 | +Symbolic Links |
| 56 | +^^^^^^^^^^^^^^ |
| 57 | +C-PAC gives you the option of creating an output directory containing `symbolic links <http://en.wikipedia.org/wiki/Symbolic_link>`_ to processed files. We strongly recommend this setting be enabled, as it makes it much easier to navigate output files. The following schematic shows the structure of the resulting :file:`sym_links` directory: |
| 58 | + |
| 59 | +.. figure:: /_images/symlink_structure.png |
| 60 | + |
| 61 | +Pipeline and strategy folders are named as described above. |
| 62 | + |
| 63 | +File Descriptions |
| 64 | +^^^^^^^^^^^^^^^^^ |
| 65 | +Preprocessed anatomical data from the Anatomical Preprocessing, Registration, and Segmentation workflows can be found in :file:`../scan/anat/` directory for each subject. The following diagram shows processing steps and standard output files for these workflows. |
| 66 | + |
| 67 | +.. figure:: /_images/anat_prepro_schematic.png |
| 68 | + |
| 69 | +Preprocessed functional data from the Functional Preprocessing workflow can be found in the :file:`../scan_<name>/func` directory for each subject. The following diagram shows processing steps and standard output files for this workflow. |
| 70 | + |
| 71 | +.. figure:: /_images/functional_preprocessing.png |
| 72 | + |
| 73 | +Derivative Outputs |
| 74 | +^^^^^^^^^^^^^^^^^^ |
| 75 | +Derivatives for each subject can be found in the :file:`../scan_<name>` directory of each subject. This folder also contains the outputs of the registration and segmentation workflows. |
| 76 | + |
| 77 | +.. figure:: /_images/derivs_outputs.png |
| 78 | + |
| 79 | +Within each derivative folder will be sub-folders for each set of frequency filters set in :file:`config.yml`, as well as a folder containing smoothed outputs. |
| 80 | + |
| 81 | +Derivatives are output in both native space (:file:`*_img.nii.gz` and :file:`*_map.nii.gz` files), with values transformed to z-scores (:file:`*_Z_*.nii.gz`) and in standard space (:file:`*_to_standard.nii.gz`). |
| 82 | + |
| 83 | +QC Interface |
| 84 | +------------- |
| 85 | +**Note:** QC pages are currently under development, and their look and functionality will change in future releases. |
| 86 | + |
| 87 | +If you have enabled it in your pipeline configuration, the C-PAC Quality Control (QC) interface is an efficient way to rapidly view the outputs of a C-PAC run. For each subject, C-PAC generates an HTML file containing images of each output and additional information such as motion parameters and signal-to-noise ratios. |
| 88 | + |
| 89 | +.. figure:: /_images/qc_main.png |
| 90 | + |
| 91 | +Though it is possible to view the QC page for each subject individually, we recommend generating a combined QC page that lets you easily navigate between subjects. To do this, open a python terminal and run the following command:: |
| 92 | + |
| 93 | + import CPAC |
| 94 | + CPAC.utils.create_all_qc.run('/path/to/output_directory') |
| 95 | + |
| 96 | +Alternately, it is of course possible to simply view C-PAC outputs using the application of your choice. |
0 commit comments