|
Size: 6889
Comment:
|
Size: 10085
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| == Tract Statistics == | [[FsTutorial/Diffusion|top]] | [[FsTutorial/TraculaOutputs|previous]] | [[FsTutorial/TraculaGroupAnalysis|next]] = Tract Statistics = |
| Line 147: | Line 149: |
| To convert the path.overall.txt for the above tract into a table that can be used by mri_glmfit, do the following ---- {{{ cd $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/ # To extract all diffusion measures into a table do the following tractstats2table |
=== path.overall.txt to Table Conversion === To extract all diffusion measures into a table do the following: ---- {{{ tractstats2table --inputs $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt --overall --tablefile Diff001_LH.CST.All.Priorcvs.table }}} ---- Instead of extracting all the measures from path.overall.txt, we can get specific measures that can be used for group analysis.For example, to extract only the Average Fractional Anisotropy along Left Cortico-spinal tract, do the following: ---- {{{ tractstats2table --inputs $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt --overall --only-measures FA_Avg --tablefile Diff001_LH.CST.FA.Priorcvs.table }}} ---- For a group analysis that has multiple subjects, '''tractstats2table''' can be used to combine all the subjects' diffusion measures from path.overall.txt into a single table that can be used for analysis with mri_glmfit or any other statistics software An easy way to do this is to create a text file that contains the names of the subjects and paths to their path.overall.txt files. An example is given below: ---- {{{ $TUTORIAL_DATA/Diff001/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff002/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff003/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff004/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff005/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff006/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff007/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff008/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff009/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff010/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt }}} ---- Once this is created and saved as lh_cst_priorcvs_overall_pathstats, it can be passed as a parameter in tractstats2table command. The following command will create a table with all the subjects specified in the lh_cst_priorcvs_overall_pathstats file and all the diffusion measures from '''path.overall.txt''' for each subject. ---- {{{ tractstats2table --load-pathstats-from-file $TUTORIAL_DATA/diffusion_tutorial/TraculaGLM/LesionStudy/lh_cst_priorcvs_overall_pathstats --overall --tablefile LH.CST.All.Priorcvs.table }}} ---- To extract only specific measures like FA_Avg, do the following: ---- {{{ tractstats2table --load-pathstats-from-file $TUTORIAL_DATA/diffusion_tutorial/TraculaGLM/LesionStudy/lh_cst_priorcvs_overall_pathstats --overall --only-measures FA_Avg --tablefile LH.CST.FA.Priorcvs.table }}} ---- You can look at these tables in OpenOffice's spreadsheet program. For example, to open the table '''LH.CST.All.Priorcvs.table''' in a spreadsheet, do the following: ---- {{{ oocalc $TUTORIAL_DATA/diffusion_tutorial/TraculaGLM/LesionStudy/LH.CST.All.Priorcvs.table (Not sure if this will be the final directory...things may have moved around by weekend) }}} ---- |
Tract Statistics
This section of the tutorial will teach you to extract Statistical measures along the major White Matter tracts reconstructed by Tracula. There are two types of statistics files that are output for each White Matter Tract
- path.overall.txt - This file gives Diffusion measures along the whole WM tract
- path.byvoxel.txt - This files gives Diffusion measures for each voxel along the WM tract.
To view the statistics files from Tracula for for the subject Diff001 (Left Cortico-Spinal Tract), type the following in the terminal
cd $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/ less path.overall.txt less path.byvoxel.txt
path.overall.txt
This text file gives various diffusion measures about the specific white matter tract along its complete path. Some of the measures include:
- Count of the # of Fibers in the WM tract
- Tract Volume
- Maximum, Minimum and Average length of fibers
- Length of the center fiber
- Axial Diffusivity (both average and along the center)
- Radial Diffusivity (both average and along the center)
- Mean Diffusivity (both average and along the center)
- Fractional Anisotropy (both average and along the center)
# Title Pathway Statistics # # generating_program $FREESURFER_HOME/bin/dmri_pathstats # cvs_version # cmdline $FREESURFER_HOME/bin/dmri_pathstats --intrc $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr --dtbase $TUTORIAL_DATA/diffusion_tutorial/Diff001/dmri/dtifit --path lh.cst --subj Diff001 --out $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt --outvox $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.byvoxel.txt # sysname Linux # hostname compute-0-1.local # machine x86_64 # user rspriti # anatomy_type pathway # # subjectname Diff001 # pathwayname lh.cst # Count 100 Volume 235 Len_Min 45 Len_Max 69 Len_Avg 55.3 Len_Center 53 AD_Avg 0.00108402 AD_Avg_Weight 0.00107521 AD_Avg_Center 0.00107062 RD_Avg 0.00046958 RD_Avg_Weight 0.000476065 RD_Avg_Center 0.000507009 MD_Avg 0.000674393 MD_Avg_Weight 0.000675781 MD_Avg_Center 0.000694881 FA_Avg 0.50122 FA_Avg_Weight 0.48976 FA_Avg_Center 0.456292
path.byvoxel.txt
This text file gives us various diffusion measures in each voxel along the WM tract
# Title Pathway Statistics # # generating_program $FREESURFER_HOME/dmri_pathstats # cvs_version # cmdline $FREESURFER_HOME/dmri_pathstats --intrc $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr --dtbase $TUTORIAL_DATA/diffusion_tutorial/Diff001/dmri/dtifit --path lh.cst --subj Diff001 --out $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt --outvox $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.byvoxel.txt # sysname Linux # hostname compute-0-1.local # machine x86_64 # user rspriti # anatomy_type pathway # # subjectname Diff001 # pathwayname lh.cst # # pathway start x y z AD RD MD FA 62 63 10 0.000637887 0.000476948 0.000530594 0.178865 62 63 11 0.0006074 0.000433505 0.00049147 0.22773 63 63 12 0.000846852 0.000610935 0.000689574 0.251636 63 64 13 0.00123916 0.00105259 0.00111478 0.107897 63 64 14 0.000936783 0.000621757 0.000726766 0.264886 64 64 15 0.000869413 0.000500918 0.00062375 0.348479 64 64 16 0.000742746 0.000432898 0.000536181 0.357518 65 64 16 0.000729103 0.000361411 0.000483975 0.42985 66 65 17 0.000645165 0.000105291 0.000285249 0.86012 67 65 18 0.00115478 0.000351219 0.000619072 0.647404 68 66 19 0.00142292 0.000690686 0.000934763 0.432432 69 66 20 0.00166259 0.000912869 0.00116278 0.363279 69 66 21 0.00145087 0.000448438 0.000782583 0.639517 70 66 22 0.00124617 0.000204701 0.000551856 0.816332 70 66 23 0.00138642 0.000415134 0.000738896 0.650657 71 66 23 0.00136252 0.000330065 0.000674217 0.721118 71 66 24 0.00134187 0.000385197 0.000704089 0.678151 71 66 25 0.00108983 0.000289931 0.000556565 0.729769 72 66 26 0.00106165 0.000357968 0.000592529 0.650427 72 66 27 0.00117242 0.000398032 0.00065616 0.619191 73 65 28 0.00130606 0.000441963 0.000729994 0.61662 73 65 29 0.00132239 0.00034928 0.000673651 0.701421 74 65 30 0.00133145 0.000391918 0.000705096 0.652609 74 65 31 0.00130265 0.000371743 0.000682045 0.665608 74 65 32 0.00126357 0.000429947 0.000707822 0.596254 75 65 33 0.00126146 0.000533254 0.000775991 0.499365 75 64 34 0.00117235 0.000465188 0.00070091 0.536046 75 64 35 0.00111144 0.000424831 0.000653701 0.560041 76 64 36 0.00128036 0.000299521 0.000626469 0.731721 76 64 37 0.00119495 0.000322181 0.000613105 0.688909 76 64 38 0.00105691 0.000334124 0.000575053 0.64994 76 63 39 0.00106784 0.000449252 0.000655449 0.514129 76 63 40 0.00113234 0.000537139 0.000735539 0.463226 76 63 41 0.000990485 0.000493054 0.000658864 0.446701 76 63 42 0.000798778 0.000477672 0.000584708 0.336071 76 62 43 0.000870652 0.000483175 0.000612334 0.362795 75 62 44 0.000878542 0.000493417 0.000621792 0.376378 75 62 45 0.000897465 0.000514559 0.000642194 0.348244 75 61 46 0.000882752 0.000537658 0.000652689 0.310019 74 61 47 0.00100985 0.00048457 0.000659663 0.436199 74 61 48 0.00104135 0.000461786 0.000654973 0.482846 74 60 49 0.000957188 0.000488566 0.000644774 0.472547 73 60 50 0.00100422 0.00055232 0.000702954 0.378698 73 60 51 0.000938077 0.000492242 0.000640854 0.429111 72 59 52 0.00104503 0.000475882 0.000665599 0.474443 72 59 53 0.00091483 0.00047261 0.000620017 0.409087 72 59 54 0.000792557 0.000632776 0.000686036 0.174565 71 59 55 0.000961412 0.000680667 0.000774249 0.243739 71 58 56 0.001061 0.000895478 0.000950651 0.133396 70 58 57 0.000862592 0.000663684 0.000729986 0.162365 70 58 58 0.00119199 0.00103056 0.00108437 0.086213 69 57 59 0.00120589 0.000980809 0.00105584 0.127098 69 57 60 0.00102806 0.000829161 0.000895461 0.141788 # pathway end
These two files can be used to extract measures that can be further used group analysis.
This can also be converted into a table using tractstats2table for doing GLM analyses using mri_glmfit or any other statistical software (SPSS, Excel, Statview etc)
path.overall.txt to Table Conversion
To extract all diffusion measures into a table do the following:
tractstats2table --inputs $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt --overall --tablefile Diff001_LH.CST.All.Priorcvs.table
Instead of extracting all the measures from path.overall.txt, we can get specific measures that can be used for group analysis.For example, to extract only the Average Fractional Anisotropy along Left Cortico-spinal tract, do the following:
tractstats2table --inputs $TUTORIAL_DATA/diffusion_tutorial/Diff001/dpath/5cpts/priorcvs/seg14/initmni/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt --overall --only-measures FA_Avg --tablefile Diff001_LH.CST.FA.Priorcvs.table
For a group analysis that has multiple subjects, tractstats2table can be used to combine all the subjects' diffusion measures from path.overall.txt into a single table that can be used for analysis with mri_glmfit or any other statistics software
An easy way to do this is to create a text file that contains the names of the subjects and paths to their path.overall.txt files. An example is given below:
$TUTORIAL_DATA/Diff001/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff002/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff003/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff004/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff005/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff006/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff007/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff008/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff009/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt $TUTORIAL_DATA/Diff010/dpath/priorcvs/regbbr/lh.cst_AS_avg23_cvs_bbr/pathstats.overall.txt
Once this is created and saved as lh_cst_priorcvs_overall_pathstats, it can be passed as a parameter in tractstats2table command. The following command will create a table with all the subjects specified in the lh_cst_priorcvs_overall_pathstats file and all the diffusion measures from path.overall.txt for each subject.
tractstats2table --load-pathstats-from-file $TUTORIAL_DATA/diffusion_tutorial/TraculaGLM/LesionStudy/lh_cst_priorcvs_overall_pathstats --overall --tablefile LH.CST.All.Priorcvs.table
To extract only specific measures like FA_Avg, do the following:
tractstats2table --load-pathstats-from-file $TUTORIAL_DATA/diffusion_tutorial/TraculaGLM/LesionStudy/lh_cst_priorcvs_overall_pathstats --overall --only-measures FA_Avg --tablefile LH.CST.FA.Priorcvs.table
You can look at these tables in OpenOffice's spreadsheet program. For example, to open the table LH.CST.All.Priorcvs.table in a spreadsheet, do the following:
oocalc $TUTORIAL_DATA/diffusion_tutorial/TraculaGLM/LesionStudy/LH.CST.All.Priorcvs.table (Not sure if this will be the final directory...things may have moved around by weekend)
