Difference between revisions of "DTI Quality Control"

From Pheno Wiki
Jump to: navigation, search
Line 8: Line 8:
  
 
----
 
----
=QA Procedures=
+
=Quality Control=
[[DTI Analysis Tools and Scripts List]]
+
The checking procedures for CNP follow the Cannon Lab DTI QA Protocol, which was adapted from procedures in Paul Thompson's lab.
  
#Check Raw DTI Data Exists
+
==DTI_QA script==
Check that the raw DTI data exists for each subject
+
The additional QA script is located at /space/raid2/data/poldrack/CNP/scripts/DTI_QA.sh
  
#Run dti_proc.sh Script
+
===Usage===
<b>dti_proc.sh</b> is a script written by Russ Poldrack, originally for CNP to preprocess raw DTI data.  The path for the script is /space/raid2/data/poldrack/CNP/scripts/DTI/dti_proc.sh. The directory structure will need to be adapted for individual projects. The usage is dti_proc <input directory path>.<br/>
+
 
+
Note: an alternate version called "dti_proc_regressor" exists. The difference between the two versions is that the regressor script contains a nuisance regressor based on the Galachan, 2010 paper, that we hoped could to some extent correct for vibration artifacts. This artifact exists on BMC data before Fall 2010. After Fall 2010 the table was bolted down, correcting the artifact. The CCN table was bolted at installation, thus avoiding the artifact entirely. However, this effort to correct the artifact was unsuccessful and the individuals with vibration artifacts were eliminated. <br/>
+
 
+
For example, to run the script on one CNP subject,<br/>
+
Find the path of the raw DTI directory for one subject, and run the script, e.g.:
+
:> dti_proc /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/raw/DTI_64DIR_3 &
+
 
+
For the subject indicated, the script will output the following files in the raw DTI directory:
+
:B0_image_brain_mask.nii.gz
+
:B0_image_brain.nii.gz
+
:B0_image.nii.gz
+
:dti_diag.pdf
+
:dtifit_FA2std.nii.gz
+
:dtifit_FA.nii.gz
+
:dtifit_L1.nii.gz
+
:dtifit_L2.nii.gz
+
:dtifit_L3.nii.gz
+
:dtifit.log
+
:dtifit_MD.nii.gz
+
:dtifit_MO.nii.gz
+
:dtifit_SO.nii.gz
+
:dtifit_V12std.nii.gz
+
:dtifit_V1.nii.gz
+
:dtifit_V2.nii.gz
+
:dtifit_V3.nii.gz
+
:dti_mcf.par
+
:dti_proc.log
+
:FA2std.mat
+
 
+
#Run DTI_QA.sh Script
+
To obtain additional QA measures, to supplement the dti_diag.pdf file, then run the <b>DTI_QA.sh</b> script. This script was written by Katie Karlsgodt to produce a text file which checks that the bvals and bvecs match the CNP standards, and calculates the mean MD, mean FA, mean motion, and the maximum motion, and other QA measures.
+
 
+
The path for the script is /space/raid2/data/poldrack/CNP/scripts/DTI//DTI_QA.<br/>
+
 
The usage is DTI_QA <subjectID> <group>, or dti_proc all <group>.
 
The usage is DTI_QA <subjectID> <group>, or dti_proc all <group>.
  
 
For example, to run the script on one subject in the CNP schizophrenia group,<br/>
 
For example, to run the script on one subject in the CNP schizophrenia group,<br/>
 +
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/scripts:
 +
:> ssh $username@funcserv1
 +
:> cd /space/raid2/data/poldrack/CNP/scripts
  
 +
2. Run the script, e.g.:
 
:> dti_proc_temp.sh CNP_50006B SCHZ &
 
:> dti_proc_temp.sh CNP_50006B SCHZ &
Alternatively, to run the script on all subjects in the CNP schizophrenia group,<br/>
+
 
 +
3. Alternatively, to run the script on all subjects in the CNP schizophrenia group,<br/>
 
:> dti_proc_temp.sh all SCHZ &
 
:> dti_proc_temp.sh all SCHZ &
  
 +
===Script Actions===
 +
This script creates a small text file to be used in QA. If the script runs properly it:<br/>
 +
1. matches bvals and bvecs<br/>
 +
2. calculates mean in-mask FA and MD<br/>
 +
3. calculates motion in each direction<br/>
 +
4. creates a standard deviation file for regular and mcf images<br/>
 +
5. uses regional masks to calculate the percentage of cropped voxels in the occipital lobe, frontal lobe, superior region, temporal lobes and cerebellum.<br/>
 +
 +
===Output===
 
The script will create a <b>dti_report.txt</b> file in the raw DTI directory of the subject.
 
The script will create a <b>dti_report.txt</b> file in the raw DTI directory of the subject.
  
#Check Preprocessed DTI Data
+
==How to Do QA==
##Check Diagnostic PDF
+
===Check Diagnostic Log===
Open the dti_diag.pdf, using the command <b>[[Basic UNIX Commands#evince | evince]]</b>:
+
After running the dti_proc.sh script, check the diagnostic log for quality assurance of the DTI data:<br/>
 +
1. Log on to func and go to the directory, for example, /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*:
 +
:> ssh $username@funcserv1
 +
:> cd /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*
 +
:> ls
 +
 
 +
2. Open the dti_diag.pdf, using the command <b>[[Basic UNIX Commands#evince | evince]]</b>:
 
:> evince dti_diag.pdf &
 
:> evince dti_diag.pdf &
  
###Check whether the bvals and bvecs match the CNP standards.<br/>
+
3. Check whether the bvals and bvecs match the CNP standards, and log this in the [https://spreadsheets.google.com/ccc?key=0AhLKRRgAIOCVdG9rY0szNFppcGZ0QmF3ejBYLUY5S0E&hl=en#gid=0 CNP DTI QA Google Document].
Note: across scanners (BMC vs CCN) and within the CCN scanner there were multiple permutations of the 64 direction sequence. All subjects were run using their own directions so the analysis is valid within subject, but they have been flagged so that users are aware if someone does not match the scanner standard.<br/>
+
  
##Check Diagnostic text file
+
4. Go to the raw DTI directory of the subject, and open the dti_report.txt file, using the command <b>[[Basic UNIX Commands#emacs | emacs]]</b>:
Go to the raw DTI directory of the subject, and view the dti_report.txt file, using more or emacs<br/>
+
:> cd /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/DTI_64DIR_3
### Check whether the bvals and bvecs match the CNP standards
+
:> ls
### Check degree of cropping. The cerebellum will almost always have the most. If any other regions have more than 10% cropping, check the raw data carefully and rate degree of cropping on the log.
+
:> emacs dti_report.txt &
  
##Check for Artifacts
+
5. Check whether the bvals and bvecs match the CNP standards, and log this in the [https://spreadsheets.google.com/ccc?key=0AhLKRRgAIOCVdG9rY0szNFppcGZ0QmF3ejBYLUY5S0E&hl=en#gid=0 CNP DTI QA Google Document].
Artifacts included in the CNP data include the Siemen's vibration artifact (indicated by a red blob on the midline in the dorsal posterior part of the brain), blank slices (usually associated with motion) on individual<br/>
+
The first step to check for artifacts is to watch the raw data like a movie, going through each direction. Open in fslview, click the "film" icon, and watch each volume, inspecting for noise, dropped slices, etc.
+
  
###Check FA Map
+
===Check for Artifacts===
 +
Artifacts observed in this data set include-
 +
:-missing slices- this would be on only one volume, and consist of an entire isolated missing horizontal slice
 +
:-vibration artifact (only on BMC subjects)- this usually shows as a red patch directly on the midline, primarily in the parietal region
 +
:-striping
 +
:-cropping
 +
 
 +
===Check Raw Data===
 +
====Check FA Map====
 
After running the dti_proc_regressor.sh script, check the fractional anisotropy (FA) map for quality assurance:<br/>
 
After running the dti_proc_regressor.sh script, check the fractional anisotropy (FA) map for quality assurance:<br/>
Open the FA map in FSLView:
+
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*:
 +
:> ssh $username@funcserv1
 +
:> cd /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*
 +
:> ls
 +
 
 +
2. Open the FA map in FSLView:
 
:> fslview dtifit_FA.nii.gz &
 
:> fslview dtifit_FA.nii.gz &
Check if the FA map includes the entire brain and if the FA map looks unusual or not
 
  
###Check Color Map
+
3. Check if the FA map includes the entire brain and if the FA map looks unusual or not, and log this in the [https://spreadsheets.google.com/ccc?key=0AhLKRRgAIOCVdG9rY0szNFppcGZ0QmF3ejBYLUY5S0E&hl=en#gid=0 CNP DTI QA Google Document].
 +
 
 +
====Check Color Map====
 
After running the dti_proc.sh script, check the color map for quality assurance:<br/>
 
After running the dti_proc.sh script, check the color map for quality assurance:<br/>
Open both the FA and color maps in FSLView (or add the color map to FSLView, if you are already viewing the FA map):
+
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*:
 +
:> ssh $username@funcserv1
 +
:> cd /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*
 +
:> ls
 +
 
 +
2. Open both the FA and color maps in FSLView (or add the color map to FSLView, if you are already viewing the FA map):
 
:> fslview dtifit_FA.nii.gz dtifit_V1.nii.gz &
 
:> fslview dtifit_FA.nii.gz dtifit_V1.nii.gz &
  
To view the color map, select the dtifit_V1 file, and press the "i" button. An "Overlay Information Dialog" window will appear. For "Display as:", select "RGB" and for "Modulation:", select "dtifit_FA". Close this window.
+
3. To view the color map, select the dtifit_V1 file, and press the "i" button. An "Overlay Information Dialog" window will appear. For "Display as:", select "RGB" and for "Modulation:", select "dtifit_FA". Close this window.
 +
 
 +
4. The color map should now display with a dark background and red/blue/green tracts.
 +
 
 +
5. Check if the directions of the major fiber tracts are colored appropriately by scrolling through the slices. In the coronal view, the corticospinal tract (superior-inferior) should be blue. In the sagittal view, the corpus callosum (right-left) should be red. In the axial view, the anterior-posterior tracts should be green.
 +
 
 +
Also, check if the color map includes the entire brain and if the color map looks unusual or not. Log this in the appropriate google doc.
 +
 
 +
====Check for Cropping====
 +
In the output from the DTI_QA script is a number for each of a set of regions (cerebellum, superior, temporal, frontal). This number represents the percentage of voxels missing in that region. If the number is greater than about 10, you should go back and look at the FA map to make sure that actual tract data is not missing (some small percent, which would usually represent grey matter, can be missing off the edges without much effect). There will always be a large percentage of cerebellum voxels missing, but this can be ignored.
 +
 
 +
====Watch raw data as movie====
 +
Load up the raw data file (like DTI_64dir_7.nii.gz) into fslview, and watch through each volume as a movie. It is normal for the first volume to be much brighter, that is the B0 image.
 +
 
 +
==QA Rating System==
 +
After logging the intermediate steps in the google doc, a final rating can be calculated. This is based on:
 +
:1. Coverage flag (based on cropping measures rated 0=no cropping, 1=minor cropping, 2=severe unusable cropping)
 +
:2. Motion flags (based on watching raw data as movie, and on pdfs).
 +
:3. Tensor direction flags (based on bvals and bvecs and color map)
 +
:4. Artifact flags
 +
 
 +
The overall Quality score is generated from these measures and varies from 1-4.
 +
:1=excellent
 +
:2=good (useable, but depending on analysis might want to take a look at reason for score)
 +
:3=fair (useable, but depending on analysis might want to take a look at reason for score)
 +
:4=unusable (all individuals with vibration artifacts are in this category, along with any others with irreconcilable problems)
 +
:-1= not evaluated
  
Check if the directions of the major fiber tracts are colored appropriately by scrolling through the slices. In the coronal view, the corticospinal tract (superior-inferior) should be blue. In the sagittal view, the corpus callosum (right-left) should be red. In the axial view, the anterior-posterior tracts should be green.
+
The scores and reasons for them are available on the HTAC database.
  
Also, check if the color map includes the entire brain and if the color map looks unusual or not.
 
  
###Check Line Image
+
[[File:DTI_Rankings.png]]
While viewing the V1 image, click the 'i' and change the view from RGB to Lines. The lines should be aligned and orderly, particularly in the largest tracts.
+
  
##Rate Data
 
Based on the QA findings all data were rated on a scale from 1-4 with 1 being excellent and 4 being unusable.
 
  
  
Return to [[DTI_Resources]]
+
----
 +
Link back to [[LA5C]] page. <br/>
 +
Return to [[CNP]]

Revision as of 17:05, 13 June 2012

Link back to LA5C page.

These are the useable subjects for each group, on each scanner.

DTI Rankings.png



Quality Control

The checking procedures for CNP follow the Cannon Lab DTI QA Protocol, which was adapted from procedures in Paul Thompson's lab.

DTI_QA script

The additional QA script is located at /space/raid2/data/poldrack/CNP/scripts/DTI_QA.sh

Usage

The usage is DTI_QA <subjectID> <group>, or dti_proc all <group>.

For example, to run the script on one subject in the CNP schizophrenia group,
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/scripts:

> ssh $username@funcserv1
> cd /space/raid2/data/poldrack/CNP/scripts

2. Run the script, e.g.:

> dti_proc_temp.sh CNP_50006B SCHZ &

3. Alternatively, to run the script on all subjects in the CNP schizophrenia group,

> dti_proc_temp.sh all SCHZ &

Script Actions

This script creates a small text file to be used in QA. If the script runs properly it:
1. matches bvals and bvecs
2. calculates mean in-mask FA and MD
3. calculates motion in each direction
4. creates a standard deviation file for regular and mcf images
5. uses regional masks to calculate the percentage of cropped voxels in the occipital lobe, frontal lobe, superior region, temporal lobes and cerebellum.

Output

The script will create a dti_report.txt file in the raw DTI directory of the subject.

How to Do QA

Check Diagnostic Log

After running the dti_proc.sh script, check the diagnostic log for quality assurance of the DTI data:
1. Log on to func and go to the directory, for example, /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*:

> ssh $username@funcserv1
> cd /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*
> ls

2. Open the dti_diag.pdf, using the command evince:

> evince dti_diag.pdf &

3. Check whether the bvals and bvecs match the CNP standards, and log this in the CNP DTI QA Google Document.

4. Go to the raw DTI directory of the subject, and open the dti_report.txt file, using the command emacs:

> cd /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/DTI_64DIR_3
> ls
> emacs dti_report.txt &

5. Check whether the bvals and bvecs match the CNP standards, and log this in the CNP DTI QA Google Document.

Check for Artifacts

Artifacts observed in this data set include-

-missing slices- this would be on only one volume, and consist of an entire isolated missing horizontal slice
-vibration artifact (only on BMC subjects)- this usually shows as a red patch directly on the midline, primarily in the parietal region
-striping
-cropping

Check Raw Data

Check FA Map

After running the dti_proc_regressor.sh script, check the fractional anisotropy (FA) map for quality assurance:
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*:

> ssh $username@funcserv1
> cd /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*
> ls

2. Open the FA map in FSLView:

> fslview dtifit_FA.nii.gz &

3. Check if the FA map includes the entire brain and if the FA map looks unusual or not, and log this in the CNP DTI QA Google Document.

Check Color Map

After running the dti_proc.sh script, check the color map for quality assurance:
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*:

> ssh $username@funcserv1
> cd /space/raid2/data/poldrack/CNP/${group}/CNP_{subjectID}/raw/DTI_64DIR_*
> ls

2. Open both the FA and color maps in FSLView (or add the color map to FSLView, if you are already viewing the FA map):

> fslview dtifit_FA.nii.gz dtifit_V1.nii.gz &

3. To view the color map, select the dtifit_V1 file, and press the "i" button. An "Overlay Information Dialog" window will appear. For "Display as:", select "RGB" and for "Modulation:", select "dtifit_FA". Close this window.

4. The color map should now display with a dark background and red/blue/green tracts.

5. Check if the directions of the major fiber tracts are colored appropriately by scrolling through the slices. In the coronal view, the corticospinal tract (superior-inferior) should be blue. In the sagittal view, the corpus callosum (right-left) should be red. In the axial view, the anterior-posterior tracts should be green.

Also, check if the color map includes the entire brain and if the color map looks unusual or not. Log this in the appropriate google doc.

Check for Cropping

In the output from the DTI_QA script is a number for each of a set of regions (cerebellum, superior, temporal, frontal). This number represents the percentage of voxels missing in that region. If the number is greater than about 10, you should go back and look at the FA map to make sure that actual tract data is not missing (some small percent, which would usually represent grey matter, can be missing off the edges without much effect). There will always be a large percentage of cerebellum voxels missing, but this can be ignored.

Watch raw data as movie

Load up the raw data file (like DTI_64dir_7.nii.gz) into fslview, and watch through each volume as a movie. It is normal for the first volume to be much brighter, that is the B0 image.

QA Rating System

After logging the intermediate steps in the google doc, a final rating can be calculated. This is based on:

1. Coverage flag (based on cropping measures rated 0=no cropping, 1=minor cropping, 2=severe unusable cropping)
2. Motion flags (based on watching raw data as movie, and on pdfs).
3. Tensor direction flags (based on bvals and bvecs and color map)
4. Artifact flags

The overall Quality score is generated from these measures and varies from 1-4.

1=excellent
2=good (useable, but depending on analysis might want to take a look at reason for score)
3=fair (useable, but depending on analysis might want to take a look at reason for score)
4=unusable (all individuals with vibration artifacts are in this category, along with any others with irreconcilable problems)
-1= not evaluated

The scores and reasons for them are available on the HTAC database.


DTI Rankings.png



Link back to LA5C page.
Return to CNP