QAscripts

QAscripts


Description

QAscripts is a collection of BASH scripts which perform automated image quality checks on BOLD, DTI, and perfusion data sets. The scripts are written in BASH and intended to run in a Linux environment. AFNI and FSL must also be installed. The scripts output to text files using a tab-delimited format suitable for insertion into spreadsheets.

Procedure
  • Run any of the scripts w/o arguments to see the calling syntax.
  • The general syntax of each script is:

<scriptname> [-append] [-keep] <4Dniftifile> [<maskfile>] <resultfile>

  • –keep = do not delete intermediate files
  • –append = append results to <resultfile> (if it exists)
  • <maskfile> = optional 3D brain mask. If not provided one is automatically generated.
  • <resultfile> = a tab-delimited text file with the QA result metrics
Requirements
  • AFNI and FSL must be installed and in your PATH environment.
Installation Instructions
  • Download the files from Github (see Download section below).
  • Add your folder location to your PATH.
  • In a terminal window, type the QA script name that you want to run.
Version Info

The current distribution contains several versions of the QA scripts:

  • Version 1 — this is the original distribution that was reported in: Roalf DR, Quarmley M, Elliott MA, et al. The Impact of Quality Assurance Assessment on Diffusion Tensor Imaging Outcomes in a Large-Scale Population-Based Cohort. NeuroImage. 2016;125:903-919. doi:10.1016/j.neuroimage.2015.10.068.
  • Version 2 — includes several bug fixes but should give identical results to v1.
  • Version 4 — significantly revised the qa_dti script to handle multishell DTI data (i.e. multiple b != 0) shells.
Documentation

All of the scripts operate on NIFTI format image files for input and output. The input data set is expected to be a 4D (3D + time) NIFTI. The main routines are:

  • qa_pcasl_vx.sh – QA for Arterial Spin Labelled (ASL) data
  • qa_dti_vx.sh – QA for Diffusion Tensor Imaging (DTI) data
  • qa_bold_vx.sh – QA for fMRI (i.e BOLD) data

Several common sub-routine scripts are also included, but they can also be called individually if only certain QA metrics are desired. These include:

  • qa_tsnr_vx.sh – compute the temporal SNR (tSNR) of a 4D NIFTI data set
  • qa_motion_vx.sh – compute absolute and relative motion metrics from a 4D NIFTI

Additional notes:

  • qa_pcasl_vx.sh takes an optional -e <dicomfile> in order to read the Transmit Reference Voltage from the dicom file header.
  • qa_dti_vx.sh requires the <bval> and <bvec> files in the format returned by dcm2nii and as used by FSL.
  • qa_dti_v4.sh includes the option to round the <bval> file entries to a nearest integer multiple (designed to fix Siemens bval files)
    • syntax: qa_dti_v4.sh <4Dniftifile> <bvals> <bvecs> <roundval> [<maskfile>] <resultfile>
    • examples:
      1. qa_dti_v4.sh dti4D.nii bvals.txt bvecs.txt 100 dti_qa.txt    # this will round the bvalues to nearest integer multiple of 100
      2. qa_dti_v4.sh dti4D.nii bvals.txt bvecs.txt 0 dti_qa.txt         # no rounding of the bvalues will be done
Download

The QAscripts programs are available on GitHub at github.com/markymarkymark/QAscripts.git

Contact

For comments or questions, send e-mail to:

Mark Elliott at melliott@pennmedicine.upenn.edu