Package: eddy-squeeze
eddy-squeezeSummarize and Visualize FSL Eddy Outlier ReplacementsContentsIntroductionInstallationDependenciesHow to use the scriptIntroductioneddy-squeezeeddy-squeeze is a tool that visualizes the signal replacements by FSL Eddy with--repoloption.In addition to the visualization, it also collects measures like motions, number of outliers and post-eddy translations rom multiple eddy outputs into a csv and html file, for easier QC of FSL Eddy outputs.Eddy QC interested users should also check outeddyqc(eddy_squadandeddy_quad) by FSL that creates nice summary of a subject or a study wise summary of the Eddy outputs.https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/eddyqc/UsersGuideFSL EddyEddy is a eddy-current, and head movement correction tool, from FSL, for the diffusion weighted images (DWI).Eddy outlier replacementUsing a Gaussian Process, Eddy builds a model of DWI data for each shell. And using this model, the prediction of DWI data for different B-shells becomes available, which is then used to make a comparison to the acquired data.If the comparison between the predicted signal and the actual signal is larger than anticipated, Eddy marks the signal (the slice in the volume) an outlier.It can also replace the signals in the outlier slices with that of predicted signal, reducing the large deviations from these outliers.Jesper L. R. Andersson and Stamatios N. Sotiropoulos. An integrated approach to correction for off-resonance effects and subject movement in diffusion MR imaging. NeuroImage, 125:1063-1078, 2016.Jesper L. R. Andersson, Mark S. Graham, Eniko Zsoldos and Stamatios N. Sotiropoulos. Incorporating outlier detection and replacement into a non-parametric framework for movement and distortion correction of diffusion MR images. NeuroImage, 141:556-572, 2016.InstallationInstall through Pypipipinstalleddy-squeeze
eddy_squeeze-hor download the repositorygitclonehttps://github.com/pnlbwh/eddy-squeezeTesting the eddy-squeeze usingpytestcdeddy-squeeze/tests
pytesttest_eddy_squeeze.pycdeddy-squeeze/tests/eddy_squeeze_lib
pytesttest_eddy_files.py
pytesttest_eddy_present.py
pytesttest_eddy_utils.pyTesting the eddy-squeezecd eddy-squeeze/bin
./eddy_squeeze -hDependenciesFSL6.0.1EDDYoutputsFSLDIRinPATHnifti-snapshot(https://github.com/pnlbwh/nifti-snapshot)python3.7scipy==1.3.3nibabel==2.4.0numpy==1.16.2pathlib2==2.3.3matplotlib==3.0.3tabulate==0.8.5pytestHow to run eddy-squeezeCollect output measures created by Eddy and prints them on screen# one eddy outputeddy_squeeze--eddy_directories/test/eddy_out--print_table# two eddy outputseddy_squeeze--eddy_directories/test/eddy_out1/test/eddy_out2--print_tableSave html summaryeddy_squeeze--eddy_directories/test/eddy_out1/test/eddy_out2\--print_table\--save_html\--out_dirprac_eddy_summarySave html summary with figureseddy_squeeze--eddy_directories/test/eddy_out1/test/eddy_out2\--print_table\--save_html\--figure\--out_dirprac_eddy_summaryExample outputseddy_squeeze\--eddy_directories/prac_study_dir/subject01/prac_study_dir/subject02\--print_tableOutput directory : /Users/kevin/eddy-squeeze/tests/bin/prac_eddy_summary
--------------------------------------------------

Setting up eddy directories
--------------------------------------------------

Extracting information from all eddy outputs
--------------------------------------------------
Summarizing 3 subjects
There is no eddy related files in ../prac_study_dir/subject03

n=2 eddy outputs detected
--------------------------------------------------

Basic information
--------------------------------------------------
+----+-----------+----------------------------+---------------------+---------------+---------------+---------------------------------------+-----------------+
|    | subject   |              eddy_dir      |   number of volumes |   max b value |   min b value | unique b values                       |   number of b0s |
|----+-----------+----------------------------+---------------------+---------------+---------------+---------------------------------------+-----------------|
|  0 | subject01 |  /prac_study_dir/subject01 |                  74 |          3000 |             0 | [   0.  200.  500. 1000. 2950. 3000.] |               5 |
|  1 | subject02 |  /prac_study_dir/subject02 |                  74 |          3000 |             0 | [   0.  200.  500. 1000. 2950. 3000.] |               5 |
+----+-----------+----------------------------+---------------------+---------------+---------------+---------------------------------------+-----------------+

Outlier information
--------------------------------------------------
+----+-----------+----------------------------+------------------------------------------------+-------------------------------------------------+---------------------------------------------------------------+
|    | subject   |   number of outlier slices |   Sum of standard deviations in outlier slices |   Mean of standard deviations in outlier slices |   Standard deviation of standard deviations in outlier slices |
|----+-----------+----------------------------+------------------------------------------------+-------------------------------------------------+---------------------------------------------------------------|
|  0 | subject01 |                         80 |                                        894.399 |                                           11.18 |                                                       6.30107 |
|  1 | subject02 |                         80 |                                        894.399 |                                           11.18 |                                                       6.30107 |
+----+-----------+----------------------------+------------------------------------------------+-------------------------------------------------+---------------------------------------------------------------+

Motion information
--------------------------------------------------
+----+-----------+--------------------------------+--------------------------------+
|    | subject   |   absolute restricted movement |   relative restricted movement |
|----+-----------+--------------------------------+--------------------------------|
|  0 | subject01 |                       0.190404 |                       0.112074 |
|  1 | subject02 |                       0.190404 |                       0.112074 |
+----+-----------+--------------------------------+--------------------------------+Save summary htmleddy_squeeze\--eddy_directories/test/eddy_out1/test/eddy_out2--out_direddy_summary\--save_htmleddy_squeeze--eddy_directories/test/eddy_out1/test/eddy_out2--save_html--figureFrom another python scriptfromeddy_squeezeimporteddy_squeeze# eddy output prefix listeddy_prefix_list=['/test/eddy_out1/subject01-eddy_out','/test/eddy_out1/subject02-eddy_out']out_dir='/data/pnl/prac/eddy_summary'eddyDirectories=eddy_squeeze.EddyDirectories(eddy_prefix_list)eddyDirectories.save_all_outlier_slices(out_dir)eddyDirectories.create_group_figures(out_dir)eddyDirectories.save_all_html(out_dir)eddy_squeeze.create_study_html(eddyDirectories,out_dir=out_dir)