Setting up your computer to use AFNI’s Quality Control (QC)
Using afni_proc.py QC measures to assess imaging data & preprocessing
OVERVIEW
The AFNI program afni_proc.py has a couple of options that can create critical images and metrics during preprocessing that can be useful for data quality control. For a full description of how to use afni_proc.py, click HERE.
Adding the option “-html_review_style basic” to the afni_proc.py script is one (and the default) option - this will create a series of files and commands enabling you to sequentially go through different QC metrics.
An alternative is to use the “-html_review_style pythonic” option. This will create a series of files that will enable you to examine and evaluate various QC metrics in a single webpage.
The following instructions assume that the “-html_review_style pythonic” option was used.
After afni_proc.py has completed, you can assess the QC files generated by navigating to the QC_subj#/ folder in the afni_proc.py output and opening each .HTML file using a browser command like:
firefox index.html
OR
open_afni index.html
Where ‘index.html’ is the main QC page that is created. However, this method only utilizes some of the features of the pythonic QC option. A preferred option is to create a local server using Python to view the QC output. The following steps will show you how to set up your computer to do so.
CHECKING YOUR PYTHON VERSION
The first thing to do is to check to see if Python is installed on your computer by entering the following command in a terminal window (Mac):
python -V
Or, if the above fails…
python3 -V
Or, if the “py” command is available, try…
py -V
Note
If no version of Python is installed on your computer, talk with Dr. Geier for assistance and/or use one of the macs in Pound Hall Room 217.
CREATING A LOCAL SERVER
If your Python version is 3.X (or above), run the following command in the QC directory (typically called ‘QC_subj#’) generated from afni_proc.py.
python3 -m http.server
If you have Python version 2.X,
python -m SimpleHTTPServer
Note
Most of the instructions here are for MacOS. On Windows, try “python -m http.server” or “py -3 -m http.server”
After doing so, your terminal window should indicate that you started a session.
VIEWING THE QC OUTPUT IN A WEB BROWSER
Next, open up a browser window on your computer and type in the following URL:
localhost:8000
This should make the “.html” files in the QC directory appear as a website. On the next page, we’ll talk about how to evaluate the various sections of the QC file.