do_dsistudio.tcsh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/tcsh
  2. # January, 2014.
  3. # An example of using DSI-Studio (Yeh et al., 2010) to reconstruct
  4. # HARDI models for use in tracking. Note: this is *NOT* a tutorial on
  5. # using DSI-Studio, but merely a simple example in using it to make
  6. # some examples for HARDI-tracking with AFNI-FATCAT-3dTrackID. Please
  7. # refer to the DSI-Studio website/poster/papers/etc. for more
  8. # information. Key to this enterprise has been the recent DSI-Studio
  9. # addition of enabling NIFTI file outputs (many thanks), so that
  10. # AFNI-FATCAT can use the results.
  11. # This script was run from the $maindir, defined just below
  12. #*********************************************************************
  13. # Just setting some names/locations of things-- user can adjust
  14. # appropriately for own usage
  15. # 1) where DSI-Studio has been installed
  16. set whereprog = "/usr/local/pkg/dsistudio/20120919"
  17. # 2) where the demo is-- for some reason, I needed to put full path of
  18. # 'home', and couldn't use '~' abbreviation
  19. set maindir = "/home/paul/FATCAT_DEMO"
  20. # 3) where I want my output to go
  21. set whereto = "$maindir/HARDI"
  22. #*********************************************************************
  23. # DSI-Studio start: make source file; b_table was made using
  24. # AFNI-1dDW_Grad_o_Mat-- note its columnar structure including
  25. # b-values.
  26. $whereprog/dsi_studio \
  27. --action=src \
  28. --source="$maindir/AVEB0_DWI.nii.gz" \
  29. --b_table="$whereto/b_table.txt" \
  30. --output="$whereto/output.src"
  31. # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  32. # GQI
  33. # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  34. # Make use of GQI to construct directions (<=3 per vox);
  35. # makes a 'fib' file called: output.src.odf8.f3rec.gqi.1.25.fib.gz
  36. $whereprog/dsi_studio \
  37. --action=rec \
  38. --source="$whereto/output.src" \
  39. --thread=4 \
  40. --method=4 \
  41. --param0=1.25 \
  42. --record_odf=1 \
  43. --odf_order=8 \
  44. --num_fiber=3
  45. # Export data from 'fib' file to NIFTI; for tracking, we need dirs
  46. # and a WM-proxy map. Here, I'm outputting both FA and GFA (will
  47. # just use latter, probably)
  48. $whereprog/dsi_studio \
  49. --action=exp \
  50. --source="$whereto/output.src.odf8.f3rec.gqi.1.25.fib.gz" \
  51. --export=dirs,fa0,gfa
  52. # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  53. # QBALL
  54. # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  55. # Make use of QBall to construct directions (<=3 per vox)
  56. # makes a 'fib' file called: output.src.odf8.f3rec.qbi.sh8.1.25.fib.gz
  57. $whereprog/dsi_studio \
  58. --action=rec \
  59. --source="$whereto/output.src" \
  60. --thread=4 \
  61. --method=3 \
  62. --param0=1.25 \
  63. --record_odf=1 \
  64. --odf_order=8 \
  65. --num_fiber=3
  66. # Export data from 'fib' file to NIFTI; for tracking, we need dirs
  67. # and a WM-proxy map. Here, I'm outputting both FA and GFA (will
  68. # just use latter, probably)
  69. $whereprog/dsi_studio \
  70. --action=exp \
  71. --source="$whereto/output.src.odf8.f3rec.qbi.sh8.1.25.fib.gz" \
  72. --export=dirs,fa0,gfa
  73. # bit of copying to shorter file names:
  74. 3dcopy \
  75. $whereto/output.src.odf8.f3rec.qbi.sh8.1.25.fib.gz.gfa.nii.gz \
  76. $whereto/QBALL_GFA.nii.gz
  77. 3dcopy \
  78. $whereto/output.src.odf8.f3rec.qbi.sh8.1.25.fib.gz.dirs.nii.gz \
  79. $whereto/QBALL_DIRS.nii.gz
  80. 3dcopy \
  81. $whereto/output.src.odf8.f3rec.qbi.sh8.1.25.fib.gz.fa0.nii.gz \
  82. $whereto/QBALL_FA.nii.gz
  83. printf "\nDONE.\n"