Detailed Steps for DTI Data Processing.docx
《Detailed Steps for DTI Data Processing.docx》由会员分享,可在线阅读,更多相关《Detailed Steps for DTI Data Processing.docx(16页珍藏版)》请在冰豆网上搜索。
DetailedStepsforDTIDataProcessing
OriginalDataLocation:
192.168.69.5:
/mnt/data1/Orig_XieHe_Epilepsy/XieHe-DTI-Dicom
PartI.DataPreparation
1.Copytheoriginaldatato/usr/test/XieHe-DTI-Dicom
2.DataConversion:
changethedirectoryto/usr/test/XieHe-DTI-Dicom,thenrundcm2nii‘/usr/test/XieHe-DTI-Dicom’.
wehavemanysubfoldersholdingDICOMfilesin/usr/test/XieHe-DTI-Dicomnamedbythesubjects'name.Rundcm2nii'/usr/test/XieHe-DTI-Dicom'intheterminal,youwillconverttheDICOMfileslocatedinthesubfoldersto.niifiles,andeachofthenewcreated.niifilesarelocatedinthecorrespondingsubfolder.Thisissimilartorundcm2nii/usr/test/XieHe-DTI-Dicom/subjname/usr/test/XieHe-DTI-Dicom/subjnameforeverysubjects.
3.Copythenewcreated.niifilesto/usr/test/data
(1)changdirectoryto/usr/test
(2)RunsudocpXieHe-DTI-Dicom/*/*.nii/usr/test/data
4.Removetheunfavorablefilesin/usr/test/data
5.Renameallthefiles,discardalltheunnecessarycodes
Here,weneedasoftwarenamedThunar,andsomesimpleregularexpression.Hereisaquicktutorial.
PartII.Preprocessing:
createFAimagesfromdiffusionstudydata
1.EddyCurrentCorrection
(1)Stayindirectory/usr/test//data.
(2)Acommandlineutilityiseddy_correct<4dinput><4doutput>
ForThisstudy,‘4dinput’isthe.niifilename.andIdefine‘4doutput’as‘E_’+’theoriginalfilename’.reference_nois0.So,wegetaexampleaseddy_correctCHENGYE.niiE_CHENGYE.nii0.Ittakes~30min.ObviouslyIcannotwaitandtypeacommandevery30min.HereIusescriptstosavethetrouble.
(3)Creatafilenamededdycorrect.sh:
sudogediteddycorrect.sh.(editwithEmEditorandExcelinthelocalcomputer,andthencopythecodestotheremotecomputer)
(4)Applyexecutepermissionstoeddycorrect.sh:
sudochmod+Xeddycorrect.shorsudochmod–R777eddycorrect.sh.
(5)Executebulkeddycorrect:
./eddycorrect.sh.
2.Diffusiondatareconstructionandfibertracking(youcanskipthissectionifyouwantrunonlyTBSS)
WeneedezDICOMorMatlabtocheckDICOMinfo,DiffusionToolkitandTrackVistodothedetailedworks.
(1)DownloadandinstallezDICOM,Matlab,DiffusionToolkitandTrackVisinaWinXpcomputer(Localcomputer).
(2)ChecktheDICOMinformationfordatareconstruction,especiallytheScannertypeandImageorientation.Hereisatutorial.Forthisstudy,Scanner=GE,Imageorientation=(1,0,0),(0,1,0).
(3)CopytheE_*.nii.gz(Imagedataaftereddycurrentcorrection)andthecorresponding.BVALand.BVECfiletolocalcomputer(usingsecureshellclient).
(4)LaunchDiffusionToolKit
1)SettheImagingmodeltoDTIandmarkthecheckboxofReconstruction.
2)settheRawdatafilespathpointingtotheE_*.nii.gzfile.
3)EdittheGradienttable:
Openthecorresponding.bvecfile,delectethefirstlineofit(typically,thefirstlineis‘000’)andcopytheremaininglinestotheGradienttableEditor.SavethetableasXieHe_dti_026.
4)SettheImageorientationto‘Axial(1,0,0),(0,1,0)’asmentionedabove.
5)Settheoutputprefix.
6)Markthecheckboxof‘Tracking’.
7)‘Reconprefix’,’Savetrackas’,’Maskimage’arerelated.Thelasttwovalueswillchangeas‘Reconprefix’changes.
8)ChoosetheOrientationpatchas‘x’,’y’,’z’respectivelyandclick‘Run’toseetheresult.TrackViswilllaunchautomaticallyaftertheResconstraction..
9)IgotthebestresultwhenIsettheOrientationpatchtoYforthisstudy.So‘y’istherightoptionin8).It’saTrailandErrorthing.
3.Createbinarymask
1)Changedirectoryto/usr/test.
2)Copyalltheeddycurrentcorrectedimagefileto/usr/test/eddy:
sudocp./data/E_*.nii.gz./eddy/
3)Changedirectoryto/usr/test/eddy:
cd./eddy
4)Creatafilenamedbet.sh:
sudogeditbet.sh.(editwithEmEditorandExcelinthelocalcomputer,andthencopythecodestotheremotecomputer).
Hereweneedtochangetheparameterof‘f’(fractionalintensitythreshold(0->1);default=0.5;smallervaluesgivelargerbrainoutlineestimates)tocheckoutthebest‘f’forthisstudy.Thatistosay,runbet.shadequatetimeswithdifferent‘f’.Ichosen0.25,0.28,0.3and0.5.
5)Runbet.sh4timeswithdifferent‘f’value,checktheresultwithfslview.
Yellow:
f=0.25,Cyan:
f=0.28,Red:
f=0.3,Blue:
f=0.5
Igotthebestresultatf=0.25forthisstudy.
4.Fitthediffusiontensormodelusingdtifit.
1)Changedirectoryto/usr/test.
2)Copyalltheneededfileto/usr/test/bet:
sudocp./data/E_*.nii.gz./bet/
sudocp./eddy/b_f0_25E_*.nii.gz./bet
3)Changedirectoryto/usr/test/datatocheckoutabnormalities
<1>checktheecclogfile
ThesubjectZHANGBINisdifferenttotheothers.
<2>Changedirectoryto/usr/test/XieHe-DTI-Dicomandcheckthe.bvecand.bvalfiles
cd/usr/test/XieHe-DTI-Dicom
more./*/*.bvec
more./*/*.bval
TheyareallthesameforallthesubjectsexceptZHANGBIN.SodiscardthefileofZHANGBINin/use/test/bet.
4)Changedirectoryto/usr/test/bet
cd./bet
5)Copythe.bvecand.bvalfilesto/usr/test/betandrenamethem.
move/usr/test/XieHe-DTI-Dicom/chaiejun/*.bvec./XIEHE.bvec
move/usr/test/XieHe-DTI-Dicom/chaiejun/*.bval./XIEHE.bval
6)Creatafilenameddtifit.sh:
sudogeditditfit.sh.(editwithEmEditorandExcelinthelocalcomputer,andthencopythecodestotheremotecomputer).Rundtifit.sh
./dtifit.sh
PartIII.RunTBSS
1.CreattwofoldersfordadaprocessingandmovethecorrespondingFAdatatothem.
cd/usr/test
sudomkdirCRCL
cp./bet/control*_FA.nii.gz./CR./CL
cp./bet/p_left_*_FA.nii.gz./CL
cp./bet/p_Right*_FA.nii.gz./CR
2.CreatafilenameTBSS.shandsaveitin./CRand./CL.ThecodesofTBSS.shis
#!
/bin/sh
tbss_1_preproc*.nii.gz
tbss_2_reg-T
tbss_3_postreg-S
exit0
3.RunTBSS.shin./CRand./CL.Thistakes~12hours.
4.checkwhetherasuitablethresholdforthemeanFAskeletonis0.2.
cdstatsfslviewall_FA-b0,0.8mean_FA_skeleton-b0.2,0.8-lGreen
5.Runtbss_4_prestats
tbss_4_prestats0.2
6.voxelwisestatisticsontheskeletonisedFAdata.
cd../statsdesign_ttest2design1425//forCRdesign_ttest2design1438//forCLrandomise-iall_FA_skeletonised-otbss-mmean_FA_skeleton_mask-ddesign.mat-tdesign.con-n500--T2-Vfslview$FSLDIR/data/standard/MNI152_T1_1mmmean_FA_skeleton-lGreen-b0.2,0.8tbss_tstat1-lRed-Yellow-b3,6tbss_tstat2-lBlue-
第二版本:
[DTI/DWI]分享一个DTI/TBSS数据处理流程
DTIAnalysis
1.CopyoverdicomsfromDTIseriestoadtifolderwithineachsubjectsdirectory
a.
cpdicom/312000-XX-*dti/
i.
XX=DTISeries#
2.
mri_convert312000-XX-1.dcmdiffusionseries.nii.gz
a.
output=diffusionseries.mghdti.bvals,diffusionseries.mghdti.bvecs
b.
renamefilesasbvalsandbvecs,respectively
3.
eddy_correctdiffusionseries.nii.gzdata.nii.gz0
4.
mkdirtemp
5.
cpdata.nii.gztemp/
6.
cdtemp
7.
fslsplitdata.nii.gz–t
8.
cpvol0000.nii.gztodtidir
a.
cpvol0000.nii.gz../nodif.nii.gz
9.
betnodif.nii.gznodif_brain–m–v–o–g0.2–f0.3
10.
dtifit–kdata.nii.gz–odti–mnodif_brain_mask–rbvecs–bbvals–V
-Outputincludeseigenvectors,eigenvalues,meandiffusivityandFAmaps
-Ifyouwanttoruntractography,gotothenextstep.
-IfyouwanttorunTractBasedSpatialStatistics(TBSSforFAanalysis),gotoendofthissection.
11.
runbedpostx(bedpostx./)
a.
Longeststep,takesabout24-48hourstorun.
12.
copyoverMPRAGEseriestodtifolder(candoanytimebeforeregistrationorTBSS!
[12-14])
a.
cpTrioTim-…/312000-4-*dti/
13.
mri_convert968000-4-1.dcmhighres_brain.nii.gz
14.
bethighres_brain.nii.gzhighres_brain_only
15.
RegistrationSteps
a.
DiffusiontoStructural:
flirt–innodif_brain–refhighres_brain_only.nii.gz–omatdif2highres.mat–searchrx-9090–searchry-9090–searchrz-9090–dof6–costmutualinfo
b.
Structuraltodiffusion:
convert_xfm–omathighres2dif.mat–inversedif2highres.mat
c.
StructuraltoStandard:
flirt–inhighres_brain_only.nii.gz–ref/usr/share/fsl/data/standard/avg152T1_brain.nii.gz–omathighres2standard.mat–searchrx-9090–searchry-9090–searchrz-9090–dof12–costcorratio
d.
StandardtoStructural:
convert_xfm–omatstandard2highres.mat–inversehighres2standard.mat
e.
DiffusiontoStandard:
convert_xfm–omatdif2standard.mat–concathighres2standard.matdif2highres.mat
f.
StandardtoDiffusion:
convert_xfm–omatstandard2dif.mat–inversedif2standard.mat
TBSSWalkthrough
1.
AfterFAmaphasbeencreatedfromdtifit,youarereadytorunTBSSforanalysisonthisdatarunonlywhenALLdatahasbeencollected
2.
Allstepswilltakeplacein/users/fpolli/DTI_STUDY_DIR/dti_tbss
3.
Ifstartingnewanalysis,shouldremoveallpreviousdatafrom
4.
MoveFAimagesfromeachsubjecttothedti_tbssdirectory(makesurepreviousdatahasbeenremoved?
?
)
5.
tbss_1_preproc*.nii.gz
a.
ErodesFAimagesslightlyandremovelikelyoutliersfromdiffusiontensorfitting
b.
Movesallimagesintonewsub-dir(FA)andcreatesdirorigdata
6.
tbss_2_reg–n
a.
–nflagalignseveryFAimagetoeveryotherone,findsthemost“typical”subjectasatargetimageforallotherimagestoalignto
b.
Longstep.Takesabout20minutes/registration
7.
tbss_3_postreg–S
a.
appliesnonlineartransformsfromthestepabovetobringthemintostandardspace
b.
–S:
derivesthemeanFAandskeletonfromyoursubjects
c.
–T:
usestheFMRIB58_FAmeanFAimageanditsskeletonratherthanyoursubjects
8.
fslviewall_FA.nii.gz–b0,0.8mean_FA_skeleton.nii.gz–b0.2,0.8–lGreen
9.
tbss_4_prestats0.2
a.
.2isthresholdtomakesuregreymatter,ventriclesaren’tincluded
b.
Togetstatistics,mustcreatedesignmatrixandcontrastmatrix
10.
design_ttest2designXY
a.
X–