User Tools

Site Tools


psyc410_s2x:dti

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
psyc410_s2x:dti [2025/03/11 11:20] – [Plotting tracts that run through particular regions] adminpsyc410_s2x:dti [2025/03/17 13:03] (current) – removed admin
Line 1: Line 1:
-====== Part 3: Tractography ====== 
  
-Diffusion weighted imaging is an important development in MRI that gave clinicians and researchers the ability to identify and measure white matter non-invasively. But it also just happens to be one of the most visually beautiful types of scientific imaging (IMHO). The rest of this lab is aimed at getting you more comfortable with visualizing white matter tracts, but also to just have fun and create some awesome looking images. 
- 
-<WRAP center round alert 100%> 
-<WRAP centeralign>In order to simplify things and move you through this lab a bit quicker, we will skip the "Single Subject" section of the lab. \\ 
-\\ 
-**Skip ahead to the [[#Visualizing Tracts with DSI Studio: Population Template|Population Template section]] of the lab.** 
-</WRAP> 
-</WRAP> 
- 
- 
- 
-===== Visualizing Tracts with DSI Studio: Single Subject ===== 
- 
-<WRAP center round info 100%> 
-The sample data for this section are located in ''~/Desktop/input/dti-sample''. The files include: 
-  * ''data.nii.gz'' - DWI data (the preprocessing applied to these data is summarized below) 
-  * ''bvals'' and ''bvecs'' - 60 directions, b1000 
-  * ''T1_brain.nii.gz'' - Extracted T1-weighted brain 
- 
- 
-=== Preprocessing === 
-  * Denoising 
-  * Gibbs ringing artifact 
-  * Susceptibility artifact 
-  * Eddy current distortions 
-  * Subject motion 
- 
-/* Applying strong gradients such as those used in diffusion imaging creates compensatory magnetic fields that oppose the gradients. These are called 'eddy currents' in analogy to the swirls that you can observe in moving water when it encounters an obstruction. These swirls oppose the direction of the stream. 
- 
-The problem in MRI is that spatial encoding is exquisitely dependent upon the strength of the magnetic field gradient. The spatial location of a hydrogen nucleus (proton) is encoded by applying a magnetic field of a precise strength to a location in space. If the magnetic field strength is augmented or diminished by eddy currents, there will be a change in the perceived location of the proton. Thus, the image will be sheared or otherwise distorted. 
- 
-There are algorithms that attempt to compensate for eddy current distortions, which are spatially related to the gradient direction. We will first need to remove eddy current distortion from our diffusion data before proceeding. This can be done by choosing ''FDT diffusion'' on the FSL menu, and then choosing eddy current correction on the drop down menu. However, **due to the time taken for this computation, this has been computed beforehand so you do not need to do it now**. 
-*/ 
- 
-</WRAP> 
- 
- 
-In this section we will use [[https://dsi-studio.labsolver.org/|DSI-Studio]] program to visualize white matter tracts. 
- 
-<WRAP center round tip 80%> 
-It is best to not use the macos "dark mode" setting when using DSI-Studio. If you never changed this setting, then you have nothing to worry about. If you did set your computer to use Dark mode, then you should set it back to Light mode for the rest of this lab. 
-</WRAP> 
- 
-==== Getting Started ==== 
- 
-**1.** Open ''DSI-Studio'' by clicking on the icon in your dock. {{:psyc410:images:dsi_studio_icon.png?75|}} 
- 
-  * If a license agreement pops up, select ''Accept and Sign-In'' 
- 
-<WRAP center round tip 80%> 
-If you don't see the icon in your dock, you can open it from your ''Applications'' directory. 
-</WRAP> 
- 
-==== Preparing a single subject ==== 
- 
-**1.** Click on the **Tools** tab. 
- 
-{{ :psyc410:images:dsi_tools_tab.png?direct&800 |}} 
- 
- 
-**2.** Select **R1: Linear Registration** 
- 
-{{ :psyc410:images:dsi_linear_reg.png?direct&800 |}} 
- 
- 
-  * Select the ''T1_brain.nii.gz'' file 
-  * Then select the ''data.nii.gz'' file 
- 
-**3.** Check the quality of the registration by using the sliders to move through slices, and using the ''Click to switch views'' button. 
-  *Unless something look horribly wrong, select ''OK'' 
- 
- 
-**4.** Select the **Tractography** tab. 
- 
-{{ :psyc410:images:dsi_tractography_tab.png?direct&800 |}} 
- 
-**5.** Select **Step T1: NIFTI to SRC ...** 
- 
-{{ :psyc410:images:dsi_nifti_src.png?direct&800 |}} 
- 
-  * Select the ''data.nii.gz'' 
-    * The ''bvec'' and ''bval'' values will load automatically. 
-    * Click ''Ok'' in the popup window indicating ''SRC file created'' 
- 
-**6.** Select **Step T2: Reconstruction ...** 
- 
-{{ :psyc410:images:dsi_reconstruction.png?direct&800 |}} 
- 
-  * Select the ''data.sz'' file 
-  * Select **Run Reconstruction** in the bottom-right corner of the window that opens up. 
-  * Click ''Ok'' in the popup window indicating ''FIB file created'' 
-  * Close the reconstruction window 
- 
-**7.** Select **Step T2: Fiber Tracking** 
- 
-{{ :psyc410:images:dsi_fibertracking.png?direct&800 |}} 
- 
-  * Select the ''data.dti.fz'' file 
- 
- 
-==== Viewing a single subject ==== 
- 
-A new DTI viewing window will open (see below). There is a lot going on in this window and it will take you some time to get it figured out. There are way too many options for us to review in this lab, so I will highlight just a few, but you should mess around, press buttons, see what things do. You'll discover cool stuff. If you really lose your way, you can always close the program, reopen it, and jump to step #7 above. 
- 
-<WRAP center round info 100%> 
- 
- 
- 
-There are five windows: 
-  * The main viewing window (<fc #ffff00>yellow box</fc>) 
-    * The three sliders at the bottom will move you through the x, y, and z dimensions. 
-    * To the right of the sliders is an option to zoom in or out. 
-    * This brain can also be rotated in 3D by click-hold-drag. 
- 
- 
-  * ''T3a Assign Regions'' (<fc #ff0000>red box</fc>) 
-    * Here we will add regions to filter and select the tracts we want to view. 
- 
- 
-  * ''T3b Draw Regions'' (<fc #6495ed>blue box</fc>) 
-    * This is a fractional anisotropy map color coded by the principle diffusion direction. 
-      * In the upper corner of this window is a zoom window (just below the little ''x''. Adjust that number to zoom in. If you zoom in a lot, you will see the different orientations of the principle diffusion directions. 
-      * By default, this is mirrored with the brain in the main window. Adjusting the slider will move through the slices of both brains.  
-      * The little icons to the right of the slider let you choose axial, sagittal, coronal, or multi-view perspectives. 
-    * Among other things, you can hand draw regions of interest (ROI) 
- 
- 
-  * ''T3c Options'' (<fc #00ffff>cyan box</fc>) 
-    * A million different options for all of the windows 
- 
- 
-  * ''T3d Tracts'' (<fc #ff00ff>purple box</fc>) 
-    * Here you will generate and control which tracts are displayed. 
- 
-{{ :psyc410:images:dsi_dti_window.png?direct&800 |}} 
- 
- 
-</WRAP> 
- 
- 
-**1.** Choose the coronal view by selecting the appropriate button underneath the ''T3b'' window (hint: it's the second one to the right fo the slider) 
- 
-**2.** In the main window set the y-slider to ''65'' (from left to right, the three sliders are ''x'', ''y'', and ''z'') 
- 
-In the main window you should see two prominent, vertical, white-matter tracts. You should also see a prominent horizontal tract that seems to connect the two vertical tracts about two-thirds of the way up.  
-In window ''T3b'' you'll see that the two vertical tracts are primarily blue, whereas the horizontal tract is primarily red. Zoom in close and you'll see  the length and orientation within each voxel. The two vertical tracts are the right and left [[https://en.wikipedia.org/wiki/Corticospinal_tract|corticospinal tract]] and the horizontal tract is the [[https://en.wikipedia.org/wiki/Corpus_callosum|corpus callosum]]. 
- 
-**3.** Click **Autotrack** in the ''T3d'' window. 
- 
-**4.** Click **Fiber Tracking** in the ''T3d'' window. 
-  * Pretty cool, right!? 
-  * Spend some time playing around with the brain, rotate to see all the pretty colors and fibers. Adjust the sliders, zoom, view, options in ''T3c'', etc. We'll be doing some more specific things in a bit, so it's good to get as familiar with the interface as you can by just messing around. 
- 
-<WRAP center round info 90%> 
-The tracts are overlaid onto a fractional anisotropy (FA) map. You might prefer to see them overlaid on a T1-weighted hi-resolution brain. To do so, on the top menubar select ''Slices'' --> ''Insert Other Images...'' and select the ''T1_brain.nii.gz''. 
- 
-In the upper left of the main window is dropdown menu that you can now use to switch between ''fa'' and ''T1_brain'' 
- 
-</WRAP> 
- 
-===== Visualizing Tracts with DSI Studio: Population Template ===== 
- 
-<WRAP center round info 100%> 
-<WRAP centeralign> **DSI description of the template data:**</WRAP> 
-A group-average template was constructed from a total of 1065 scans. A multishell diffusion scheme was used, and the b-values were 1000, 2000, and 3000 s/mm2. The number of diffusion sampling directions were 90, 90, and 90, respectively. The in-plane resolution was 1.25 mm. The slice thickness was 1.25 mm. The diffusion data were reconstructed in the MNI space using q-space diffeomorphic reconstruction (Yeh et al., Neuroimage, 58(1):91-9, 2011) to obtain the spin distribution function (Yeh et al., IEEE TMI, ;29(9):1626-35, 2010).  A diffusion sampling length ratio of 1.7 was used. The output resolution in diffeomorphic reconstruction was 1 mm isotropic. The restricted diffusion was quantified using restricted diffusion imaging (Yeh et al., MRM, 77:603–612 (2017)). 
-</WRAP> 
- 
-==== Getting Started ==== 
- 
-**1.** Open ''DSI-Studio'' by clicking on the icon in your dock. {{:psyc410:images:dsi_studio_icon.png?75|}} 
- 
-  * If a license agreement pops up, select ''Accept and Sign-In'' 
- 
-<WRAP center round tip 80%> 
-If you don't see the icon in your dock, you can open it from your ''Applications'' directory. 
-</WRAP> 
- 
- 
-**2.** Select the **FIB Template & Tractography Atlas** tab. 
- 
-{{ :psyc410:images:dsi_fib_tab.png?direct&800 |}} 
- 
-In the ''Population-averaged FIB templates'' box you will see a list of seven different templates.  
- 
-  * Select ''human'' (Note: by default, ''Human human_neonate'' is highlighted, but that's not what you want. Be sure to select ''human'' at the top of the list.) 
-  * Press ''Load'' 
- 
-<WRAP center round box 80%> 
-We won't be using any of them for this lab, but how awesome is it that you can play with the white matter of babies, and chimpanzees, and monkeys, and rodents?! I encourage you to play around with them at some point. 
- 
-(the correct answer is "Very awesome!") 
-</WRAP> 
- 
-A new DTI viewing window will open (see below). There is a lot going on in this window and it will take you some time to get it figured out. There are way too many options for us to review in this lab, so I will highlight just a few, but you should mess around, press buttons, see what things do. You'll discover cool stuff. If you really lose your way, you can always close the program, reopen it, and jump to step #7 above. 
- 
-<WRAP center round info 100%> 
- 
-There are five windows: 
-  * The main viewing window (<fc #ffff00>yellow box</fc>) 
-    * The three sliders at the bottom will move you through the x, y, and z dimensions. 
-    * To the right of the sliders is an option to zoom in or out. 
-    * This brain can also be rotated in 3D by click-hold-drag. 
- 
- 
-  * ''T3a Assign Regions'' (<fc #ff0000>red box</fc>) 
-    * Here we will add regions to filter and select the tracts we want to view. 
- 
- 
-  * ''T3b Draw Regions'' (<fc #6495ed>blue box</fc>) 
-    * This is a fractional anisotropy map color coded by the principle diffusion direction. 
-      * In the upper corner of this window is a zoom window (just below the little ''x''. Adjust that number to zoom in. If you zoom in a lot, you will see the different orientations of the principle diffusion directions. 
-      * By default, this is mirrored with the brain in the main window. Adjusting the slider will move through the slices of both brains.  
-      * The little icons to the right of the slider let you choose axial, sagittal, coronal, or multi-view perspectives. 
-    * Among other things, you can hand draw regions of interest (ROI) 
- 
- 
-  * ''T3c Options'' (<fc #00ffff>cyan box</fc>) 
-    * A million different options for all of the windows 
- 
- 
-  * ''T3d Tracts'' (<fc #ff00ff>purple box</fc>) 
-    * Here you will generate and control which tracts are displayed. 
- 
-{{ :psyc410:images:dsi_dti_window.png?direct&800 |}} 
- 
- 
-</WRAP> 
- 
-==== Plotting tracts ==== 
- 
-We'll start by plotting a couple of major white-matter tracts. 
- 
-**1.** Switch to a coronal view by selecting the appropriate button underneath the ''T3b'' window (hint: it's the second one to the right of the slider). In both ''T3b'' and the main viewing window zoom in so that the brains fill the respective windows. 
- 
-In the main window you should see two prominent, vertical, white-matter tracts. In window ''T3b'' you'll see that the two vertical tracts are primarily blue indicating that the the principle diffusion direction is superior-inferior. Zoom in close and you'll see  the length and orientation of the primary diffusion direction within each voxel. The two vertical tracts are the right and left [[https://en.wikipedia.org/wiki/Corticospinal_tract|corticospinal tract]] which is the primary pathway that brings motor information from the brain to the body. 
- 
-Let's plot these as fiber tracts. 
- 
-**2.** Click **Autotrack** in the ''T3d'' window. The button will now read ''All''. 
- 
-**3.** Click the ''All'' dropdown menu and select **ProjectionBrainstem**. A new dropdown menu will appear immediately below the only you just used. If you click on it you'll see a list of prominent white matter tracts. But the first one that is selected by default, **CorticospinalTractL**, is the one we want, so click on the **Fiber Tracking** button. 
- 
-**4.** Select **CorticospinalTractR** and then **Fiber Tracking**. 
- 
-**5.** In the main viewing window change the brain image from ''qa'' to ''t1w_template'' 
- 
-{{ :psyc410:images:dsi_dti_underlay.png?direct&800 |}} 
- 
-Play around with the image in the main window. Rotate it around. Try different moving through the slices of the underlay. You can also click the check box next to each slider to turn slices on/off. For example, in the image below I've turned off the ''x'' and ''y'' slices so that we get a view of the tracts ascending through the midbrain.  
- 
-{{ :psyc410:images:corticospinal_tracts_midbrain.png?direct&500 |}} 
- 
-<WRAP center round tip 100%> 
-As you add new fiber tracts you'll probably want to hide or remove ones you've already viewed. In ''T3d'' you can simply uncheck a given tract to hide it. If you want to remove it altogether, make sure it's highlighted and click the red "X" button. 
-</WRAP> 
- 
- 
- 
-===== LAB REPORT Part 3 ===== 
-<WRAP center round important 100%> 
-<WRAP centeralign> 
-<WRAP centeralign> 
-<typo fs:x-large; fc:purple; fw:bold; text-shadow: 2px 2px 2px #ffffff> 
-LAB REPORT Part 3 
-</typo> 
-</WRAP></WRAP> 
- 
-For this section of your lab report you will plot several fiber tracts (listed below). For each tract you should choose the best way to display it (i.e., orientation, underlay slices, whether you have other tracts visible, etc.). Your figures can include multiple sub-figures if you feel the best depiction requires more than one view. But this is not mandatory. 
- 
-The brain tracts you should plot: 
-  * The main body of the [[https://en.wikipedia.org/wiki/Corpus_callosum#Structure|corpus callosum]] 
-    * ''Commissure'' --> ''CorpusCallosum'' --> ''Body''  
-  * The [[https://en.wikipedia.org/wiki/Corpus_callosum#Relations|forceps major]], which connect the occipital lobes through the splenium of the corpus callosum. 
-    * ''Commissure'' --> ''CorpusCallosum'' --> ''ForcepsMajor''  
-  * The [[https://en.wikipedia.org/wiki/Arcuate_fasciculus|left arcuate fasciculus]], which is the primary fiber bundle connecting Broca's area and Wernicke's area. 
-    * ''Association'' --> ''ArcuateFasciculusL'' 
-  * The bilateral [[https://en.wikipedia.org/wiki/Optic_radiation|optic radiations]], which connect the lateral geniculate nucleus and striate cortex. 
-    * ''ProjectionBasalGanglia'' --> ''OpticRadiationL'' 
-    * ''ProjectionBasalGanglia'' --> ''OpticRadiationR'' 
-</WRAP> 
- 
-==== Plotting tracts that run through particular regions ==== 
- 
-I suggest that you open a new template window. If you go back to the main DSI window and click **Load** for the ''Population-averaged FIB templates'' it'll open a new instance. You can close the one you've been workin in, or leave it open if you prefer. 
- 
-**1.** As you did previously, change the underlay from ''qa'' to ''t1w_template'' and click **Autotrack** in the ''T3d'' window. 
- 
-**2.** Click on **Fiber Tracking** 
- 
-Unlike earlier, you're not seeing a specific tract, but rather all of the tracts in the brain. This is very pretty, but not terribly useful so after you've explored it a bit uncheck ''whole_brain'' or delete it. 
- 
-**3.** In ''T3a'' click on the **Atlas** button. This will open small window. 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-**Take your time with this part of the lab. With a little effort and creativity you can create some really striking images! And if you can't have fun creating images in TrackVis...well...I just...I just don't know what to say.** 
- 
- 
-Click **Fiber Tracking** in the ''T3d'' window. 
-  * Pretty cool, right!? 
-  * Spend some time playing around with the brain, rotate to see all the pretty colors and fibers. Adjust the sliders, zoom, view, options in ''T3c'', etc. We'll be doing some more specific things in a bit, so it's good to get as familiar with the interface as you can by just messing around. 
- 
- 
- 
-**1.** In ''T3a'' click on the **Atlas** button. 
- 
-**2.** In the popup window that opens select ''HCP842_tractography'' from the drop down menu. This is a set of fiber tracts derived from a sample of 842 participants. 
-  
-**3.** Choose the **Cortico_Striatal_Pathway_L** and click ''Add'' 
- 
- 
-===== old ===== 
-''TrackVis'' has tons of options. We will explicitly cover a few below. For a fuller description of the options you can refer to the TrackVis website here [[http://www.trackvis.org/]]. The website offers some brief tutorial movies that can be viewed in your browser that illustrate the use of the program. These are very helpful in quickly learning the interface. You can find a list of these movies [[http://www.trackvis.org/demo|here.]] 
- 
-<WRAP center round alert 80%> 
-Before proceeding, watch the [[http://www.trackvis.org/demo/|TrackVis movies]]. At minimum, watch the first and second movies to quickly get familiar with the interface. Each movie runs for about 90 sec (although you must click at certain points to move the movie forward).  
-</WRAP> 
- 
-The main value of TrackVis is to isolate particular fiber tracks by use of **TrackGroups**, **Slices**, **Regions of Interests**, **Balls/Spheres**, etc. You can toggle different TrackGroups on and off, for example 
-  * if you right click on Track 1 in the upper-right ''Objects'' panel, you can hide this track view, or delete it. 
-  * In the lower-right ''Property'' pane, you can double-click on most properties of the selected TrackGroup and change them. For example, you can change the way the current slice looks, which axis it is drawn along, how dense the fibers are drawn, etc. 
- 
-Play with the controls to get a sense of how you can navigate through space, rotate the brain, adjust which fiber tracts are displayed, etc. 
- 
-<WRAP center round tip 80%> 
-It'll take a little bit of time playing around before you get the hang of it. Your goal isn't to become an expert user, but you should get a feel for the basic image/track manipulation options. And if things go totally off the rails, you can always close and reopen the program to start fresh. Try to ... 
-  * Only view the long tracks and then only view the short tracks 
-    * Click on ''Track'' in the ''Property Window'' 
-    * Adjust the ''Length Threshold'' settings 
-  * Play around with the ''Slice Filters'', which will only show fibers that travel through the selected slice. 
-    * Activate the check box next to the ''X'', ''Y'', or ''Z'' ''Sliced Filter'' 
-    * Click on the slice number to the right of the checkbox and move the slider 
-    * Adjust the ''Thickness'' 
-      * //Hint: If you turn on the X slice filter, and change the ''Operator'' to ''Not'' then you will only see fiber tracks that do not pass through your slice. Change the ''Operator'' to ''And'' and you'll only see fibers that do pass through your slice. You can add additional slice filters and set the operators such that you'll only see fibers that pass through both your slices, none of your slices, one of your slices, etc. // 
-</WRAP> 
- 
-=== Creating an ROI Sphere === 
- 
-Let's create a ball-shaped region of interest (ROI) to select some tracts. This will help us identify only the tracks that run through areas we're interested in (our ROI) 
- 
-<WRAP center round tip 80%> 
-To clear your workspace, you might consider turning off, or hiding, the current slice-based view. To do so, right-click on ''Track1'' in the ''Objects'' box and select ''Hide'' 
-</WRAP> 
- 
-**1.** Select **TrackGroup** => **New Track Group from Sphere** 
- 
-A small ball will show up at the cross-hairs of your 3 orthogonal views. You can make this ball bigger or small by manipulating its properties.  
- 
-**2.** Let's make the ball a little bigger. 
-  * Click on the ''ROI'' tab in the lower-right ''Property'' window. 
-  * Double-click on the ''2'' next to ''Radius'' and set this value to ''3'' 
- 
-You can drag the ball around within your three orthogonal slice windows along the bottom of the screen. 
- 
-**3.** If your three orthogonal slices are not moving as you move your sphere around, click on the ''Sync Slice to ROI center'' button. (this button is in the ''Image'' window. It is the button that looks like a window-pane with a ball in the middle of it) 
- 
-**4** You can add a second ROI sphere by simply repeating steps 1-3. 
- 
-<WRAP center round tip 80%> 
-You can similarly create a TrackGroup based upon a hand-traced ROI like in the [[http://www.trackvis.org/demo/?3|linked video]]. 
-</WRAP> 
- 
- 
-**Find Some Tracts** 
- 
-Use these methods, or others you discover, to isolate the following tracts. 
- 
-  * minor forceps 
-  * major forceps 
-  * corticospinal tract 
-  * cingulum 
- 
- 
- 
- 
-<WRAP center round todo 60%> 
-<WRAP centeralign> 
-<typo fs:36px; fc:red; fw: bold; fv:small-caps; ls:1px; lh:1.1>**THIS PAGE IS STILL UNDER CONSTRUCTION!**</typo> 
- 
-<typo fs:20px; fc:black; fw: bold>Feel free to poke around, but do not start the lab as things might change! </typo> 
-</WRAP> 
-</WRAP> 
psyc410_s2x/dti.1741710007.txt.gz · Last modified: 2025/03/11 11:20 by admin

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki