Difference between revisions of "DTI"

From Pheno Wiki
Jump to: navigation, search
Line 3: Line 3:
 
All CNP DTI processing and quality assurance is documented in the [https://spreadsheets.google.com/ccc?key=0AhLKRRgAIOCVdG9rY0szNFppcGZ0QmF3ejBYLUY5S0E&hl=en#gid=0 CNP DTI QA Google Document]. To view and edit the document, request access from Katie Karlsgodt or Anna Xu.
 
All CNP DTI processing and quality assurance is documented in the [https://spreadsheets.google.com/ccc?key=0AhLKRRgAIOCVdG9rY0szNFppcGZ0QmF3ejBYLUY5S0E&hl=en#gid=0 CNP DTI QA Google Document]. To view and edit the document, request access from Katie Karlsgodt or Anna Xu.
  
=Scripts=
+
=Processing Scripts=
<b>dti_proc.sh</b> is a script written by Russ Poldrack to preprocess the raw CNP DTI data. The path for the script is /space/raid2/data/poldrack/CNP/scripts/dti_proc.sh. T
+
==dti_proc==
 +
dti_proc.sh is a script written by Russ Poldrack to preprocess the raw CNP DTI data. The path for the script is /space/raid2/data/poldrack/CNP/scripts/dti_proc.sh.  
 +
 
 +
To run the script on an entire subject group (CONTROLS, SCHZ, BIPOLAR, ADHD) use the wrapper script run_dti_proc.sh
  
 
NOTE: An alternate version exists called dti_proc_regressor. The difference between the two versions is that the regressor script contains a nuisance regressor based on the Galachan, 2010 paper, that can 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. Unfortunately it does not entirely correct the issue, so the shareable data uses the original version of the script with people who show the artifact marked for elimination.
 
NOTE: An alternate version exists called dti_proc_regressor. The difference between the two versions is that the regressor script contains a nuisance regressor based on the Galachan, 2010 paper, that can 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. Unfortunately it does not entirely correct the issue, so the shareable data uses the original version of the script with people who show the artifact marked for elimination.
  
<b>Usage</b><br/>
+
===Usage===
 
For example, to run the script on one CNP subject,<br/>
 
For example, to run the script on one CNP subject,<br/>
 
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/scripts:
 
1. Log on to func and go to the directory /space/raid2/data/poldrack/CNP/scripts:
Line 17: Line 20:
 
:> dti_proc /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/raw/DTI_64DIR_3 &
 
:> dti_proc /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/raw/DTI_64DIR_3 &
  
 +
===Script Actions===
 +
The dti_proc script processes the data using FSL Diffusion Toolbox (FDT).
 +
 +
Steps:<br/>
 +
1. B0 image is skull stripped, creating B0_image_brain<br/>
 +
2. the raw data are registered to the first (B0) image using mcflirt- this both corrects for eddy currents and helps motion, the resulting file is dti_mcf<br/>
 +
3. dtifit is run, creating FA, L1, L2, MD and other processed images in subject space<br/>
 +
4. the FA and color maps are registered to MNI space (FA2std and V12std).<br/>
 +
5. Generic ROIs from the JHU atlas are applied to the FA image in standard space. <br/>
 +
:WARNING- the resulting values are NOT to be used as data, rather just as first pass markers for scan integrity. They are not well registered enough to be used for anything, as evidenced by the low FA values.<br/>
 +
6. Motion is calculated<br/>
 +
7. bvecs and bvals for each subject are compared to the CNP standards. <br/>
 +
:NOTE: there are different bvecs and bvals for subjects on the CCN and BMC scanners, as well as for a subset of subjects scanned during the transition and intial set up of the CCN<br/>
 +
7. a pdf is generated (dti_diag.pdf)<br/>
 +
 +
===Output===
 
For the subject indicated, the script will output the following files in the raw DTI directory:
 
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_mask.nii.gz
Line 39: Line 58:
 
:FA2std.mat
 
:FA2std.mat
  
 
To run the script on an entire subject group (CONTROLS, SCHZ, BIPOLAR, ADHD) use the wrapper script run_dti_proc.sh
 
 
=Processing=
 
The dti_proc script processes the data using FSL Diffusion Toolbox (FDT).
 
 
Steps:<br/>
 
1. B0 image is skull stripped, creating B0_image_brain<br/>
 
2. the raw data are registered to the first (B0) image using mcflirt- this both corrects for eddy currents and helps motion, the resulting file is dti_mcf<br/>
 
3. dtifit is run, creating FA, L1, L2, MD and other processed images in subject space<br/>
 
4. the FA and color maps are registered to MNI space (FA2std and V12std).<br/>
 
5. Generic ROIs from the JHU atlas are applied to the FA image in standard space. <br/>
 
:WARNING- the resulting values are NOT to be used as data, rather just as first pass markers for scan integrity. They are not well registered enough to be used for anything, as evidenced by the low FA values.<br/>
 
6. Motion is calculated<br/>
 
7. bvecs and bvals for each subject are compared to the CNP standards. <br/>
 
:NOTE: there are different bvecs and bvals for subjects on the CCN and BMC scanners, as well as for a subset of subjects scanned during the transition and intial set up of the CCN<br/>
 
7. a pdf is generated (dti_diag.pdf)<br/>
 
  
 
=Quality Control=
 
=Quality Control=
 
The checking procedures for CNP follow the Cannon Lab DTI QA Protocol, which was adapted from procedures in Paul Thompson's lab. This can be found at: [[Cannon_Lab_Processing_and_QA]]
 
The checking procedures for CNP follow the Cannon Lab DTI QA Protocol, which was adapted from procedures in Paul Thompson's lab. This can be found at: [[Cannon_Lab_Processing_and_QA]]
  
 +
==DTI_QA==
 
The additional QA script is located at /space/raid2/data/poldrack/CNP/scripts/DTI_QA.sh
 
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,<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 &
 +
 +
3. Alternatively, to run the script on all subjects in the CNP schizophrenia group,<br/>
 +
:> 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/>
 
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/>
 
1. matches bvals and bvecs<br/>
Line 68: Line 86:
 
4. creates a standard deviation file for regular and mcf images<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/>
 
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.
  
  
  
 
==How to Do QA==
 
==How to Do QA==
==Check Preprocessed DTI Data==
 
 
===Check Diagnostic Log===
 
===Check Diagnostic Log===
 
After running the dti_proc.sh script, check the diagnostic log for quality assurance of the DTI data:<br/>
 
After running the dti_proc.sh script, check the diagnostic log for quality assurance of the DTI data:<br/>
Line 88: Line 108:
 
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.
 
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/raid3/data/cannon/scripts/DTI_QA.<br/>
+
T
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/>
+
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 &
+
 
+
The script will create a <b>dti_report.txt</b> file in the raw DTI directory of the subject.
+
 
+
Alternatively, to run the script on all subjects in the CNP schizophrenia group,<br/>
+
:> dti_proc_temp.sh all SCHZ &
+
 
+
 
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>:
 
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>:
 
:> cd /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/DTI_64DIR_3
 
:> cd /space/raid2/data/poldrack/CNP/SCHZ/CNP_50006B/DTI_64DIR_3

Revision as of 15:39, 16 April 2012

Documentation

All CNP DTI processing and quality assurance is documented in the CNP DTI QA Google Document. To view and edit the document, request access from Katie Karlsgodt or Anna Xu.

Processing Scripts

dti_proc

dti_proc.sh is a script written by Russ Poldrack to preprocess the raw CNP DTI data. The path for the script is /space/raid2/data/poldrack/CNP/scripts/dti_proc.sh.

To run the script on an entire subject group (CONTROLS, SCHZ, BIPOLAR, ADHD) use the wrapper script run_dti_proc.sh

NOTE: An alternate version exists called dti_proc_regressor. The difference between the two versions is that the regressor script contains a nuisance regressor based on the Galachan, 2010 paper, that can 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. Unfortunately it does not entirely correct the issue, so the shareable data uses the original version of the script with people who show the artifact marked for elimination.

Usage

For example, to run the script on one CNP subject,
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. 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 &

Script Actions

The dti_proc script processes the data using FSL Diffusion Toolbox (FDT).

Steps:
1. B0 image is skull stripped, creating B0_image_brain
2. the raw data are registered to the first (B0) image using mcflirt- this both corrects for eddy currents and helps motion, the resulting file is dti_mcf
3. dtifit is run, creating FA, L1, L2, MD and other processed images in subject space
4. the FA and color maps are registered to MNI space (FA2std and V12std).
5. Generic ROIs from the JHU atlas are applied to the FA image in standard space.

WARNING- the resulting values are NOT to be used as data, rather just as first pass markers for scan integrity. They are not well registered enough to be used for anything, as evidenced by the low FA values.

6. Motion is calculated
7. bvecs and bvals for each subject are compared to the CNP standards.

NOTE: there are different bvecs and bvals for subjects on the CCN and BMC scanners, as well as for a subset of subjects scanned during the transition and intial set up of the CCN

7. a pdf is generated (dti_diag.pdf)

Output

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


Quality Control

The checking procedures for CNP follow the Cannon Lab DTI QA Protocol, which was adapted from procedures in Paul Thompson's lab. This can be found at: Cannon_Lab_Processing_and_QA

DTI_QA

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.

Run DTI_QA.sh Script

To obtain additional QA measures, to supplement the dti_diag.pdf file, then run the DTI_QA.sh 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.

T 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

Artifact Examples

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 &

The FSLView GUI will display these files as:

File:Dti fslview.jpg

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.

File:Dti display options.jpg

4. The color map should now display as:

File:Dti color map.jpg

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.







Return to CNP