Welcome to AnatQC’s documentation!

AnatQC is a high-resolution “anatomical” MRI quality control pipeline built on the FreeSurfer, MRIQC, and volumetric navigators software packages. Working closely with neuroimaging experts, we designed an ergonomic user interface for the XNAT informatics and data management platform that allows users to quickly assess image quality and use those insights to get ahead of issues within the data acquisition workflow.

_images/logo.png

XNAT user documentation

Tagging your scans

For AnatQC to discover T1w and vNav scans to process, you need to add notes to those scans in XNAT. You can add notes using the Edit button located within the Actions box on the MR Session report page

Type

Example series

Note

T1w

ABCD_T1w_MPR_vNav

#T1w_001, #T1w_002, ..., #T1w_N

vNav

ABCD_T1w_MPR_vNav_setter

#T1w_move_001, #T1w_move_002, ..., #T1w_move_N

The image below displays an MR Session report page with populated notes

Note

Note that if a T1w scan has a corresponding vNav scan, they should be assigned matching numbers. For example, #T1w_move_001 would correspond to #T1w_001.

_images/xnat-scan-notes.png

Running the pipeline

To run the AnatQC pipeline, use the Run Containers > anatqc-session button located within the Actions box on the MR Session report page

Note

If you don’t see the Run Containers menu, please refer to Setting up the container.

_images/xnat-run-button.png

This should bring up a small form with several configurable settings. Continue reading for a description of each setting

_images/xnat-container-form.png

run

This should be set to the integer value of the scan you want to process. If there’s a corresponding move scan, that scan will also be processed

T1w scan

run

#T1w_001

1

#T1w_002

2

#T1w_999

999

subtasks

Under most circumstances you’ll want to leave this field set to its default value

morph mriqc vnav

fslicense

This field should be set to a base64 encoded FreeSurfer license. If you have a license file on a Linux or macOS machine, you can use the openssl command

openssl base64 < license.txt

or you can use the base64 command, if that utility is installed

base64 license.txt

Understanding the report page

The following section will break down each section of the AnatQC report page.

_images/xnat-aqc-home.png

Left pane

The left pane is broken up into several distinct sections. Each section will be described below.

Summary

The Summary pane orients the user to what MR Session they’re currently looking at and various processing details

_images/xnat-aqc-left-summary.png

Key

Description

MR Session

MR Session label

Date Processed

Processing date

T1w scan

T1-weighted scan used

vNav scan

vNav setter scan used (if present)

QC Metrics

The QC Metrics pane displays quality control metrics computed over the entire volume

_images/xnat-aqc-left-qcmetrics.png

Metric

From

Description

SNR Tot

MRIQC

Signal-to-noise ratio

EFC

MRIQC

Entropy Focus Criterion

FWHM Avg

MRIQC

FWHM of spatial distribution of voxel intensities

GM SNR

MRIQC

Gray matter signal-to-noise ratio

WM SNR

FreeSurfer

White matter signal-to-noise ratio

CNR

FreeSurfer

Contrast-to-noise ratio

Hemispheres

The Hemispheres pane displays quality control metrics computed over each hemisphere

_images/xnat-aqc-left-hemis.png

Metric

From

Description

Euler Holes

FreeSurfer

Estimate of the number of surface defects

CNR

FreeSurfer

Global contrast-to-noise ratio

G/W CNR

FreeSurfer

Gray and white matter contrast-to-noise ratio

G/CSF CNR

FreeSurfer

Gray matter and cerebrospinal fluid contrast-to-noise ratio

vNav

The vNav pane displays vNav specific quality control metrics, but only if a vNav scan was processed

_images/xnat-aqc-left-vnav.png

Metric

Description

Settings

Minimum and maximum number of navigators allowed

Motion Score RMS

Root mean square of motion scores

Motion Score Max

Maximum motion score

vNav Acq

Total number of navigators collected

Failed

vNav failure detected

Files

The Files pane contains the most commonly requested files. Clicking on any of these files will display that file in the browser

_images/xnat-aqc-left-files.png

File

Description

T1w axial

T1-weighted image, axial plane

Surfaces axial

FreeSurfer surface boundaries, axial plane

Segmentation axial

FreeSurfer segmentations, axial plane

Brainmask axial

FreeSurfer brain mask, axial plane

vNav Motion Scores RMS

vNav motion scores RMS plot

Cortical Laterality

Cortical region volume laterality plot

Subcortical Laterality

Subcortical region volume laterality plot

MRIQC Report

MRIQC HTML report

Tabs

To the right of the left pane you’ll find a tab container. The following section explains the contents of each tab.

Images

The Images tab displays a zoomed out view of the T1-weighted image, FreeSurfer surface boundaries, FreeSurfer segmentations, and vNav RMS motion scores

_images/xnat-aqc-images-tab.png

Clicking on an image within the Images tab will display a larger version of that image in the browser

Note

AnatQC automatically crops and centers each brain slice for improved visibility. For this reason, slices will often appear larger than their native size.

_images/xnat-aqc-surf.png
MRIQC Report tab

The MRIQC Report tab displays the complete MRIQC HTML report

_images/xnat-aqc-mriqc-tab.png
MRIQC IQMs

The MRIQC IQMs tab displays all of the MRIQC Image Quality Metrics. These metrics can also be found within the MRIQC HTML Report

_images/xnat-aqc-iqms-tab.png
All Stored Files

The All Stored Files tab contains a list of every file stored by AnatQC

_images/xnat-aqc-files-tab.png

Note

Clicking on a file within the All Stored Files tab will download that file.

File

Description

*_AQC_T1w_axial.png

T1-weighted image, axial plane

*_AQC_aseg_axial.png

FreeSurfer segmentations, axial plane

*_AQC_brainmask_axial.png

FreeSurfer brain mask image, axial plane

*_AQC_surface_axial.png

FreeSurfer surface boundaries, axial plane

*_AQC_aparc_laterality.png

FreeSurfer parcellation laterality plot

*_AQC_aseg_laterality.png

FreeSurfer segmentation laterality plot

*_AQC_mriqc.html

MRIQC HTML report

*_AQC_freesurfer.tar.gz

FreeSurfer results

*_AQC_vNav_Motion.json

vNav processing output

*_AQC_vNavMotionScoresMax.png

vNav motion max plot

*_AQC_vNavMotionScoresRMS.png

vNav motion RMS plot

Developer documentation

Installation

At the moment, the only supported way to install AnatQC is within a container.

downloading a container

There are prebuilt versions of AnatQC on Docker Hub. You can pull the latest version by running

docker pull neuroinformatics/anatqc

or you can pull a specific version e.g., 0.4.0 by running

docker pull neuroinformatics/anatqc:0.4.0

building a container

To build AnatQC as a container, grab the latest Dockerfile from the repository and run

docker build -t anatqc:latest - < Dockerfile

Now you can run anatQC.py using docker run

docker run anatqc:latest --help

XNAT Installation

The following section will describe how to build and configure AnatQC as a XNAT plugin.

building the plugin

Clone the xnat-1.7.6 branch from the github.com/harvard-nrg/anatqc repository

git clone -b xnat-1.7.6 --single-branch https://github.com/harvard-nrg/anatqc

Change into the repository directory and compile the plugin using Gradle

./gradlew jar

Once the plugin has been compiled, move the resulting .jar into your XNAT plugins directory

mv ./build/libs/anatqc-plugin-1.0.0.jar ${XNAT_HOME}/plugins/

setting up the container

Note

This documentation assumes you have successfully built the container and that the container is being served from a local Docker daemon e.g., unix:///var/run/docker.sock on your XNAT server.

To setup the container within XNAT, go to Administer > Plugin Settings > Images & Commands, find the AnatQC container, and click Add New Command

_images/xnat-add-command.png

You should see a small dialog box where you can configure your command. Paste the content from command.json.

_images/xnat-add-command-paste.png

Navigate to your Project’s home page and click on Project Settings in the Actions box. Select Configure Commands and enable the new command for your project

_images/xnat-enable-command.png

Indices and tables