== Globals == '$' - indicates shell commands 'dir' - refers to the directory where the study data is found (ex. /jet/aguirre/CrossModal) 'new subject' - the subject you are currently analyzing (ex. X111111X) 'old subject' - a subject that has been analyzed previously (ex. X000000X) ====== Preprocessing ====== Follow steps found on Preprocessing wiki Use /jet/aguirre/CrossModal/PrepScripts/VBPs/'old subject'.vbp & /jet/aguirre/CrossModal/PrepScripts/VBPs/Stock_CMP_Prep_new.vbp ====== Diffusion Tensor Imaging (DTI) Analysis ====== [output: fAnisotropy and Mean Diffusivity] ===== Making DTI Analysis Files ===== $cd 'dir'/'new subject'/DTI If there are 2 DTI scans: $mkdir 'dir'/DTI/combined_DTI $cp 00*/* combined_DTI If there is only 1 DTI scan: $mkdir 'dir'/DTI/one_DTI $cp 00*/* one_DTI Open Matlab [See Also http://alliance.seas.upenn.edu/~pauly2/wiki/index.php?n=Main.DTITools for additional help] >cd(‘Volumes/170.212.110.245’) If there are 2 scans: >cd(/Aguirre/CrossModal/[subject]/DTI/combined_DTI/ If there is only 1 scan: >cd(/Aguirre/CrossModal/[subject]/DTI/one_DTI/ >dti_ui **dialog box will open** * in bottom of box type “-bgthresh 50 -md” Click button “DICOM ->Analyze DTI" Check to make sure you are in 'dir'/'new subject'/DTI/[combined or one_DTI] Click “All” When all images are highlighted in blue → Click “Done” *this produces files “ep_b1000#(0-# of directions) and “ep_b0…” for ea. DTI scan [Pause - approx. 10 minutes] Now follow the following steps: 1) Select ONLY the "b0" images in order (ex. ep_b0-0012… and ep_b0-0013…) 2) Select the remaining b1000 files for the 1st scan in order (ex. ep_b1000#0-0012…, ep_b1000#1-0012…,…) * If there is only one scan all of the files will be selected when you have completed this step 3) Select remaining b1000 files for the 2nd scan (in order) etc. (Only needed if there are 2 scans) 4) Select “Done” 5) Set your path to /jet/aguirre/CrossModal/ScriptsDTI If 2 scans: select “HUP_M1_N12_b1000_R2.scheme.txt” If 1 scan: select “HUP_M1_N12_b1000.scheme.txt” * These files can be copied to your directory for use for other studies 6) Click “Done” 7) Change directory to 'dir'/"new subject"/DTI/ and click the “analyzed” folder (located on the RIGHT side of the window) 8) Click “Done” 9) When prompted for (optional mask) click “Done” [Pause: at this point the program will run for approximately 1 hr.] If you receive an error message that the command "analyzedti" did not run (due to inability to access camino path) $cd 'dir'/'new subject'/DTI/[combined or one_DTI] If 2 scans: $analyzedti imagelist.txt 'dir'/'new subject'/DTI/analyzed/'dir'/ScriptsDTI/HUP_M1_N12_b1000_R2.scheme.txt If 1 scan: $analyzedti imagelist.txt 'dir'/'new subject'/DTI/analyzed/'dir'/ScriptsDTI/HUP_M1_N12_b1000.scheme.txt ===== Coregistering FA & MD (putting DTI into MNI space) ===== !! Beware: Due to down sampling, this step causes a large drop in resolution. This is not being done with our CrossModal data!! $cd 'dir'/PrepScripts/CoRegFaMd_Scripts $cp “old subject”_CoRegNorm_FaMd.vbp “new subject”_CoRegNorm_FaMd.vbp $emacs “newsubject”_CoRegNorm_FaMd.vbp replace string: “old subject” with “new subject” *Check line 34: .tes files are named correctly? $vbprep “newsubject”_CoRegNorm_FaMd.vbp *output will be “nfa_CoReg.cub in Anatomy/ To view "nfa_CoReg.cub" load as you would for functional data and use a range of 1.0 to 0.0 ====== Diffusion Tensor Tracking (DTT) ====== (Warping standard MNI brain to subject T1 space) ===== Putting MPRage in analyze format ===== Open matlab >cd ‘dir’/'new subject'/DTI/norm/t1 >dti_ui 1) Click Step 1 (HUP DTI DICOM Conversion) 2) Click up to 'new subject'/Anatomy/raw/*MPRage 3) Click All 4) Click Done ** window closes At this point you are finished using Matlab $cd 'dir'/'new subject'/DTI/norm/t1 $mv tfl3d1*.hdr tfl3d1.hdr $mv tfl3d1*.img tfl3d1.img $ln –s /home/pcook/prasad/ch2.hdr ch2.hdr $ln –s /home/pcook/prasad/ch2.img ch2.img $cd 'dir'/ScriptsDTI/ $cp mvsn.sh ../'new subject'/DTI/norm/t1/. $cd 'dir'/'new subject'/DTI/norm/t1 $./mvsn.sh & [Pause: this will take about an hour to process] The output will be inside the t1 folder and will be several ch2* files ===== Moving DTI b0 scan into subject T1 space ===== !! Continue ONLY after DTT T1 files are made (mvsn.sh program) $cd ‘dir’/subject/DTI/norm/b0 If 2 scans: $cp ‘dir’/subject/DTI/combined_DTI/ep_b0-(1st scan)*.img b0_1.img $cp ‘dir’/subject/DTI/combined_DTI/ep_b0-(1st scan)*.hdr b0_1.hdr $cp ‘dir’/subject/DTI/combined_DTI/rep_b0-(2nd scan)*.img b0_2.img $cp ‘dir’/subject/DTI/combined_DTI/rep_b0-(2nd scan)*.hdr b0_2.hdr $cd 'dir'/ScriptsDTI/ $./mnitob0.sh 'new subject' & If 1 scan: $cp ‘dir’/subject/DTI/one_DTI/ep_b0-(scan)*.img b0.img $cp ‘dir’/subject/DTI/one_DTI/ep_b0-(scan)*.hdr b0.hdr $cd 'dir'/ScriptsDTI/ $./mnitob0_norepeat.sh ‘subject’ & [Pause: Makes occipital-thalamus* analyze files, t1tob0* files and xMNI* files] ===== Moving visual area, frontal, and parietal masks to b0 space ===== $cd ‘dir’/ScriptsDTI/ $./vistob0.sh ‘new subject’ & $./AvgV1tob0.sh 'new subject' & ===== Make Genu mask ===== $'dir'/'new subject'/DTI/norm/b0 $snap Here a SNAP window will open Click File - Load Data - Greyscale Image or [Ctrl+G] Click Browse Select "t1tob0_symmAregistered.nii" Click OK Click NEXT Type "RPI" in the "RAI Code" box. Click NEXT Click FINISH Click DON'T RESTORE Under the IRIS Toolbox in the upper lefthand corner, click the paintbrush tool {{:paintbrush.png|}} Reduce the brush size to 6 using the scroll bar under "Tool Options" (It will be set at 8) Check the box below the size box called "Isotropic" Using sagittal view, in the upper right window, highlight the posterior portion of the corpus collosum as seen here... {{:genu.png?163x124}} Click FILE - SAVE DATA - SAVE SEGMENTATION IMAGE Click Browse and go to the subject's tracking folder (../tracking) Click into the Filname box at the bottom of the window and add the filename "genu.mha" to the end of the path Click OK Click SAVE Close the SNAP window ===== Building tracks ===== $./track_vis_thalamus.sh ‘new subject’ & ===== To view with Paraview ===== (Building Paraview state for future viewing) Open Paraview Open ‘dir’/’new subject’/DTI/norm/tracking/fa_rgb.mhd Click [Apply] Click [Slice icon] *use x normal* Unclick [show plane] Click [Apply] Click [Display] Unclick [Map Scalars] Open ‘dir’/’new subject’/DTI/norm/tracking/AllVisAreas-thalamus-thr0_b0.mha Click [Apply] Click [Threshold icon] Set lower and upper thresholds to 1 Click [Apply] Click [Display] Reduce Opacity to 0.5 ** Now you can view the visual areas** In Pipeline Browser click on ‘AllVisAreas-thalamus-thr0_b0.mha’ Click [Threshold icon] Set lower and upper thresholds to 2 Click [Apply] ** Now you can view the thalamus** Click [Display] Reduce Opacity to 0.5 In Pipeline Browser click on ‘fa_rgb.mhd’ Click [Slice] Click [Z normal] Move slice to near the bottom of the thalamus by clicking and dragging Deselect [show plane] Click [apply] Click [display] Deselect [map scalars] Click [File menu/ save state] Select ‘dir’/’new subject’/DTI/norm/tracking ** Careful!! The directory is maintained from the previous time a state was saved** Filename: Paraview State [subject initials] Click OK Holding (control) while dragging [zoom] Holding (shift) while dragging spins on axis To load tracks Click Open Open ‘dir’/’new subject’/DTI/norm/tracking/AllVisAreas-thalamus-thr0-endpoints.vtk Click Apply To open a previously built state Click [file menu / Load state] Click