Skip to content

Commit 36887fa

Browse files
author
caily
committed
updating to v1.0.2
1 parent 8bcb0b1 commit 36887fa

File tree

3 files changed

+81
-12
lines changed

3 files changed

+81
-12
lines changed

README.md

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@
44

55
![Pipeline Overview](https://github.com/MASILab/PreQual/blob/master/pipeline_overview.png?raw=true)
66

7+
* **Summary:** Perform integrated preprocessing and quality assurance of diffusion MRI data
8+
9+
* **Preprocessing Steps:**
10+
1. Gibbs de-ringing (optional, not recommended)
11+
1. MP-PCA denoising (optional)
12+
1. Inter-scan normalization (optional)
13+
1. Susceptibility-induced distortion correction (with or without reverse gradient images or field maps)
14+
1. Eddy current-induced distortion correction
15+
1. Inter-volume motion correction
16+
1. Slice-wise signal dropout imputation
17+
1. N4 bias field correction (optional)
18+
19+
* **Quality Assurance Steps:**
20+
1. Verification of phase encoding schemes
21+
1. Analysis of gradient directions
22+
1. Shell-wise analysis of signal-to-noise and contrast-to-noise ratios
23+
1. Correction of corrupted inter-scan intensity relationships
24+
1. Shell-wise analysis of distortion corrections
25+
1. Analysis of inter-volume motion and slice-wise signal dropout
26+
1. Analysis of bias fields
27+
1. Verification of intra-pipeline masking
28+
1. Analysis of tensor goodness-of-fit
29+
1. Voxel-wise and region-wise quantification of FA
30+
1. Voxel-wise quantification of MD
31+
732
## Authors and Reference
833

934
[Leon Y. Cai](mailto:leon.y.cai@vanderbilt.edu), Qi Yang, Colin B. Hansen, Vishwesh Nath, Karthik Ramadass, Graham W. Johnson, Benjamin N. Conrad, Brian D. Boyd, John P. Begnoche, Lori L. Beason-Held, Andrea T. Shafer, Susan M. Resnick, Warren D. Taylor, Gavin R. Price, Victoria L. Morgan, Baxter P. Rogers, Kurt G. Schilling, Bennett A. Landman. *PreQual: An automated pipeline for integrated preprocessing and quality assurance of diffusion weighted MRI images*. [bioRxiv](https://www.biorxiv.org/content/10.1101/2020.09.14.260240v2), 2020. Preprint.
@@ -14,7 +39,7 @@
1439

1540
git clone https://github.com/MASILab/PreQual.git
1641
cd /path/to/repo/PreQual
17-
git checkout v1.0.1
42+
git checkout v1.0.2
1843
sudo singularity build /path/to/prequal.simg Singularity
1944

2045
We use Singularity version 3.4 with root permissions.
@@ -65,7 +90,7 @@ We use Singularity version 3.4 with root permissions.
6590

6691
* **pe\_axis:** Phase encoding axis of all the input images. We do NOT support different phase encoding axes between different input images at this time. The options are i and j and correspond to the first and second dimension of the input images, respectively. Note that FSL does not currently support phase encoding in the third dimension (i.e. k, the dimension in which the image slices were acquired, commonly axial for RAS and LAS oriented images). This parameter is direction AGNOSTIC. The phase encoding directions of the input images along this axis are specified in the dtiQA\_config.csv file. See "dtiQA\_config.csv Format" and “Example Phase Encoding Schemes” for more information.
6792

68-
## **Formatting dtiQA\_config.csv**
93+
## Formatting dtiQA\_config.csv
6994

7095
The format for the lines of the configuration CSV file are as follows:
7196

@@ -90,6 +115,16 @@ pe\_axis | pe\_dir | readout\_time | acqparams line
90115
i | + | 0.05 | 1, 0, 0, 0.05
91116
j | - | 0.1 | 0, -1, 0, 0.1
92117

118+
## Quick Start
119+
120+
These are examples of common use cases. They also all share the same command, as detailed above. The PREPROCESSED output folder will contain the final outputs and the PDF folder will contain the QA report.
121+
122+
Phase Encoding<br>Axis | Reverse Phase<br>Encoded (RPE) Image | T1<br>Image | Contents of<br>Input Directory | Contents of<br>dtiQA_config.csv
123+
------------------- | ----------------------------------|----------|-----------------------------|-----------------------------
124+
j | Yes | N/A | dti1.nii.gz<br>dti1.bval<br>dti1.bvec<br>dti2.nii.gz<br>dti2.bval<br>dti2.bvec<br>rpe.nii.gz<br>rpe.bval<br>rpe.bvec | dti1,+,0.05<br>dti2,+,0.05<br>rpe,-,0.05
125+
j | No | Yes | dti1.nii.gz<br>dti1.bval<br>dti1.bvec<br>dti2.nii.gz<br>dti2.bval<br>dti2.bvec<br>t1.nii.gz | dti1,+,0.05<br>dti2,+,0.05
126+
j | No | No | dti1.nii.gz<br>dti1.bval<br>dti1.bvec<br>dti2.nii.gz<br>dti2.bval<br>dti2.bvec | dti1,+,0.05<br>dti2,+,0.05
127+
93128
## Options
94129

95130
**--bval\_threshold N**
@@ -104,6 +139,12 @@ A comma separated list of positive integers (s/mm<sup>2</sup>) indicating nonzer
104139

105140
Default = auto
106141

142+
**--degibbs on/off**
143+
144+
Remove Gibbs ringing artifacts using the local subvoxel-shifts method as [implemented in MRTrix3](https://mrtrix.readthedocs.io/en/latest/reference/commands/mrdegibbs.html). When performed it is performed prior to all other preprocessing including denoising. We strongly caution against using this feature as it not designed for the partial Fourier schemes with which most echo planar diffusion images are acquired.
145+
146+
Default = off
147+
107148
**--denoise on/off**
108149

109150
Denoise images prior to preprocessing using Marchenko-Pastur PCA [implemented in MRTrix3](https://mrtrix.readthedocs.io/en/latest/reference/commands/dwidenoise.html). The SNR of the b0s of the final preprocessed images are reported in the PDF output regardless of whether this option is on or off.
@@ -201,6 +242,18 @@ Perform [ANTs N4 bias field correction](https://manpages.debian.org/testing/ants
201242

202243
Default = off
203244

245+
**--glyph\_type tensor/vector**
246+
247+
Visualize either tensors or principal eigenvectors in the QA document.
248+
249+
Default = tensor
250+
251+
**--atlas\_reg\_type FA/b0**
252+
253+
Perform JHU white matter atlas registration to the subject by either deformably registering the subject's FA map or average b0 to the MNI FA or T2 template, respectively. Empirically, the FA approach tends to be more accurate for white matter whereas the b0 approach tends to be more accurate globally. The b0 approach is more robust for acquisitions with low shells (i.e., b < 500 s/mm<sup>2</sup>) or poor masking that result in the inclusion of a lot of facial structure.
254+
255+
Default = FA
256+
204257
**--split\_outputs**
205258

206259
Split the fully preprocessed output (a concatenation of the input images) back into their component parts and do NOT keep the concatenated preprocessed output.
@@ -245,11 +298,11 @@ Default = sess
245298

246299
## Pipeline Assumptions
247300

248-
* All NIFTI images are consistent with a conversion from a DICOM using `dcm2niix` ([at least v1.0.20180622](https://github.com/rordenlab/dcm2niix/releases/tag/v1.0.20180622)) by Chris Rorden and are raw NIFTIs without distortion correction. We require this as dcm2niix exports b-value/b-vector files in FSL format and removes ADC or trace images auto-generated in some Philips DICOMs. In addition `dcm2niix` correctly moves the gradients from scanner to subject space, whereas some Philips PARREC converters do not, which may result in spurious results or pipeline failure.
301+
* All NIFTI images are consistent with a conversion from a DICOM using `dcm2niix` ([at least v1.0.20180622](https://github.com/rordenlab/dcm2niix/releases/tag/v1.0.20180622)) by Chris Rorden and are raw NIFTIs without distortion correction. We require this as dcm2niix exports b-value/b-vector files in FSL format and removes ADC or trace images auto-generated in some Philips DICOMs. In addition `dcm2niix` correctly moves the gradients from scanner to subject space and does not re-order volumes, both of which can cause spurious results or pipeline failure.
249302

250303
* **We expect raw volumes only, no ADC or trace volumes.** ADC volumes are sometimes encoded as having a b-value greater than 0 with a corresponding b-vector of (0,0,0) and trace volumes are sometimes encoded as having a b-value of 0 with a corresponding non-unit normalized b-vector, as in the case of some Philips PARREC converters. We check for these cases, remove the affected volumes, and report a warning in the console and in the PDF.
251304

252-
* We cannot, unfortunately, account for failure of reorientation of gradients into subject space.
305+
* We cannot, unfortunately, account for failure of reorientation of gradients into subject space. Visualization of tensor glyphs or principal eigenvectors can be helpful in distinguishing this. However, this error can be subtle so we suggest proper DICOM to NIFTI conversion with the above release of `dcm2niix`.
253306

254307
* Images will be processed in the order they are listed in dtiQA\_config.csv.
255308

@@ -283,6 +336,8 @@ Default = sess
283336

284337
1. Check that all b-vectors are unit normalized and all b-values greater than zero have associated non-zero b-vectors. For any volumes where this is not the case, we remove them, flag a warning for the output PDF, and continue the pipeline.
285338

339+
1. If applicable, perform Gibbs de-ringing on all diffusion scans with `mrdegibbs` from MRTrix3.
340+
286341
1. If applicable, denoise all diffusion scans with `dwidenoise` (Marchenko-Pastur PCA) from MrTrix3.
287342

288343
1. If applicable, prenormalize all diffusion scans. To accomplish this, extract all b0 images from each diffusion scan and average them. Then find a rough brain-mask with FSL’s bet and calculate an intensity scale factor such that the histogram intersection between the intra-mask histogram of the different scans’ averaged b0s to that of the first scan is maximized. Apply this scale factor to the entire diffusion weighted scan. This is done to avoid gain differences between different diffusion scans.
@@ -377,7 +432,7 @@ Default = sess
377432

378433
1. We then visualize some central slices of the average volumes for all unique b-values, including b = 0 and report the median intra-mask SNR or CNR calculated by eddy as appropriate. If there are more unique b-values than shells deteremined by eddy, we round the b-values to the nearest 100 by default to assign volumes to shells or we choose the nearest shell indicated by the user (see `--nonzero_shells`).
379434

380-
1. We visualize the tensors using MRTrix3’s mrview, omitting the tensors with negative eigenvalues or eigenvalues greater than 3 times the ADC of water at 37°C.
435+
1. We visualize the tensors (or principal eigenvectors depending on `--glyph_type`) using MRTrix3’s mrview, omitting the tensors with negative eigenvalues or eigenvalues greater than 3 times the ADC of water at 37°C.
381436

382437
1. We then visualize some central slices of the FA map clipped from 0 to 1 as well as the average FA for the Hopkins ROIs and the quality of the atlas registration.
383438

@@ -415,13 +470,21 @@ Folders and files in *italics* are removed if `--keep_intermediates` is NOT indi
415470

416471
* *\<imageN\>\_checked.bvec*
417472

473+
1. *DEGIBBS* (these files are only created if `--degibbs` is on)
474+
475+
* *\<image1\_%\>\_degibbs.nii.gz*
476+
477+
:
478+
479+
* *\<imageN\_%\>\_degibbs.nii.gz*
480+
418481
1. *DENOISED* (these files are only created if `--denoise` is on)
419482

420-
* *\<image1\>\_checked\_denoised.nii.gz*
483+
* *\<image1\_%\>\_denoised.nii.gz*
421484

422485
:
423486

424-
* *\<imageN\>\_checked\_denoised.nii.gz*
487+
* *\<imageN\_%\>\_denoised.nii.gz*
425488

426489
1. *PRENORMALIZED* (these files are only created if `--prenormalize` is on)
427490

@@ -565,7 +628,13 @@ Folders and files in *italics* are removed if `--keep_intermediates` is NOT indi
565628

566629
1. **STATS**
567630

568-
* **atlas\_ants\_fa.nii.gz**
631+
* **atlas2subj.nii.gz**
632+
633+
* **b02template\_0GenericAffine.mat** or **fa2template\_0GenericAffine.mat** depending on `--atlas_reg_type`
634+
635+
* **b02template\_1Warp.nii.gz** or **fa2template\_1Warp.nii.gz** depending on `--atlas_reg_type`
636+
637+
* **b02template\_1InverseWarp.nii.gz** or **fa2template\_1InverseWarp.nii.gz** depending on `--atlas_reg_type`
569638

570639
* **chisq\_mask.nii.gz**
571640

@@ -585,7 +654,7 @@ Folders and files in *italics* are removed if `--keep_intermediates` is NOT indi
585654

586655
* **stats.csv** (contains summary of all motion, SNR/CNR, and average FA stats)
587656

588-
1. **OPTIMIZED\_BVECS** (these are sign/axis permuted per `dwigradcheck` and are used for QA purposes)
657+
1. **OPTIMIZED\_BVECS** (these are sign/axis permuted per `dwigradcheck` and are only used for QA purposes)
589658

590659
* **dwmri.bval**
591660

Singularity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ From: ubuntu:18.04
8484
cd /INSTALLERS
8585
git clone https://github.com/MASILab/PreQual.git
8686
cd PreQual
87-
git checkout v1.0.1
87+
git checkout v1.0.2
8888
mv src/APPS/* /APPS
8989
mv src/CODE/* /CODE
9090
mv src/SUPPLEMENTAL/* /SUPPLEMENTAL

src/CODE/dtiQA_v7/vars.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def __init__(self):
5151

5252
# Define versioning and creation date
5353

54-
self.VERSION = '1.0.2-dev'
55-
self.CREATION_DATE = 'October 27, 2020'
54+
self.VERSION = '1.0.2'
55+
self.CREATION_DATE = 'October 30, 2020'
5656

5757
# Define instance of SharedVars class that will be accessible to (and editable by) other modules
5858

0 commit comments

Comments
 (0)