psyc410_s2x:brain_registration_atlases
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
psyc410_s2x:brain_registration_atlases [2025/02/10 10:58] – [Part 6: FSL First] admin | psyc410_s2x:brain_registration_atlases [2025/02/10 11:01] (current) – removed admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <WRAP center round todo 60%> | ||
- | <WRAP centeralign> | ||
- | <typo fs:36px; fc:red; fw: bold; fv: | ||
- | |||
- | <typo fs:20px; fc:black; fw: bold> | ||
- | </ | ||
- | </ | ||
- | |||
- | |||
- | <WRAP centeralign> | ||
- | <typo ff:' | ||
- | Lab 5: Brain Atlases \\ | ||
- | and Brain Registration </ | ||
- | </ | ||
- | |||
- | ====== Information, | ||
- | |||
- | |||
- | ===== Assigned Readings / Videos: ===== | ||
- | |||
- | * {{psyc410: | ||
- | * {{psyc410: | ||
- | |||
- | ===== Goals for this lab: ===== | ||
- | * Observe variability in brain size and shape between individuals | ||
- | * Transform individual subject brains to MNI space with FSL Flirt and compare to a brain atlas. | ||
- | * Average individual subject transformed brains using Matlab. | ||
- | * Learn about statistical brain atlases, Talairach, and MNI (Montreal Neurological Institute) space. | ||
- | * Create anatomical region-of-interests with the FSL atlases. | ||
- | * Superimpose the ROI on the brains you transformed into MNI space. | ||
- | * Use FSL FIRST to segment and label subcortical brain regions such as hippocampus and amygdala | ||
- | * Examine a brain you labeled with FreeSurfer | ||
- | |||
- | ===== Software introduced in this exercise: ===== | ||
- | |||
- | * AFNI image viewer | ||
- | * FSL's Flirt (**__F__**SL **__Li__**near **__R__**egistration **__T__**ool) for image registration. | ||
- | * Learn to write a simple AFNI script in bash to average brains. | ||
- | * FSLeyes atlases | ||
- | * FSL/FIRST to label subcortical structures | ||
- | * FreeSurfer for individualized atlases. | ||
- | |||
- | ===== Laboratory Report ===== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign>< | ||
- | * Throughout this (and all) lab exercise pages you will find instructions for your lab reports within these boxes. | ||
- | </ | ||
- | |||
- | |||
- | ===== Housekeeping ===== | ||
- | * none | ||
- | |||
- | /* | ||
- | **1.** Initialize freesurfer by running the following code in your '' | ||
- | < | ||
- | export FREESURFER_HOME=/ | ||
- | source $FREESURFER_HOME/ | ||
- | </ | ||
- | |||
- | |||
- | < | ||
- | cat <<EOT >> ~/.bashrc | ||
- | ### AFNI STUFF ### | ||
- | export DYLD_LIBRARY_PATH=/ | ||
- | EOT | ||
- | </ | ||
- | */ | ||
- | |||
- | ===== Data used in this lab ===== | ||
- | |||
- | <WRAP center round tip 100%> | ||
- | * Reminder: The data that we will use throughout the semester is located in a directory on your Desktop; ''/ | ||
- | * <wrap em>Do not write output to that directory </ | ||
- | * Remember to use descriptive names when naming your output files. | ||
- | |||
- | * For the first part of this lab, you select three of the five brains available in '' | ||
- | |||
- | </ | ||
- | |||
- | |||
- | ====== Part 1: How do individual brains differ? ====== | ||
- | |||
- | Many scientists and clinicians would like to compare the brains of different individuals and make comparisons and averages of quantitative measurements of different brain structures. For example, a clinical psychologist might be interested in whether a brain structure such as the hippocampus is different in size for depressed compared to non-depressed individuals. A genetics researcher might want to know if different alleles of the serotonin transporter gene are associated with different sized amygdala. A language researcher might want to know if there are hemispheric differences in temporal lobe anatomy in individuals who have right or left language dominance. These examples raise an important question - <wrap hi>//How different are the brains of individuals?//</ | ||
- | |||
- | In the first part of this exercise, you will closely observe three brain regions in three or more brains that have been previously skull-stripped. You can select three of the five brains available in '' | ||
- | |||
- | ===== Open FSL ===== | ||
- | |||
- | **1.** Open your Terminal app and [[: | ||
- | |||
- | **2.** [[: | ||
- | |||
- | **3.** Open three instances of '' | ||
- | * Each time you click the '' | ||
- | |||
- | <WRAP center round alert 70%> | ||
- | Remember, it will take a little bit for the app to open. If you repeatedly click the button impatiently you'll end up with way too many open instances. | ||
- | </ | ||
- | |||
- | |||
- | **4.** Open a different **skull-stripped** brain in each instance. ([[: | ||
- | |||
- | <WRAP center round info 70%> | ||
- | The skull-stripped brains end with '' | ||
- | </ | ||
- | |||
- | |||
- | **5.** Get your windows nicely organized and sized appropriately so each brain looks about the same. | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round box 60%> | ||
- | This is right about the time in the semester you might start thimking //" | ||
- | </ | ||
- | |||
- | |||
- | ===== Explore FSLeyes ===== | ||
- | |||
- | Let's spend a few minutes familiarizing ourselves with a few features of FSLeyes. | ||
- | |||
- | **1.** You can learn a bit more about the brains you've loaded by clicking on the '' | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | **2.** You can change the arrangement of your three brain views (axial, coronal, and sagittal) within the window with these three buttons: | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | **3.** You can turn on/off your different brain views (axial, coronal, and sagittal) with these three buttons: | ||
- | |||
- | {{ : | ||
- | |||
- | The next tips will be particularly helpful for you when writing lab reports! | ||
- | |||
- | **4.** By default, you see green crosshairs overalid on top of your brain indicating your current specific | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | **5.** You previously learned how to take [[https:// | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | ===== Explore Differences and Similarities in Size and Shape ===== | ||
- | |||
- | **6.** In one of the windows, click on a precise anatomical location of your choosing. | ||
- | * Copy the X,Y,Z voxel coordinates of that location (see the red boxes in the image below) into the 2D viewer of the other two brains. | ||
- | * When you are done, your crosshairs will be at the identical matrix position in all three windows of FSLview. | ||
- | * Are you at the same anatomical location when you are at the same coordinate? | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round info 90%> | ||
- | There is considerable variability in brain morphology, and in the position of a brain within the imaging matrix, and so the raw coordinates will unlikely to be at the same brain locus. | ||
- | </ | ||
- | |||
- | |||
- | **7.** To help focus your comparison, find a (relatively) similar slice. For example, in the image below I centered my crosshairs in the midline of the anterior commissure. You can use this, or any other, anatomical landmark to help you get similar slices in each of your three brains. | ||
- | |||
- | * Spend a few moments exploring the the overall similarities and differences among the brains. | ||
- | |||
- | <WRAP center round tip 90%> | ||
- | It might be helpful to position your cursor at the boundary between white and grey matter or between brain and CSF. | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round tip 100%> | ||
- | <WRAP centeralign>< | ||
- | |||
- | * Overlay brains on top of each other in a single FSLView window, colorize the overlay, and adjust the '' | ||
- | * [[: | ||
- | |||
- | * Toggle the overlaid brain 'off and on' by double clicking the eyeball icon to the left of the filename in the '' | ||
- | |||
- | These methods, as well as the one you've been using thus far, will all give you a better picture of the similarities and differences across brains. | ||
- | </ | ||
- | |||
- | ===== LAB REPORT Part 1 ===== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 1 | ||
- | </ | ||
- | </ | ||
- | |||
- | </ | ||
- | * **1)** Create two figures demonstrating the differences in the brain. Each figure should contain a screenshot that compares the anatomy of all three brains side by side (see figure above for reference). | ||
- | * For each of the two figures, briefly describe the differences you observe. | ||
- | * Use Powerpoint (or any program you like) to add arrows or boxes to highlight the differences. | ||
- | * **2)** Create two screenshots to compare brain anatomy using overlays of all three brains in FSLeyes (see above tip box). | ||
- | * For each of the two figures, briefly describe the differences you observe. | ||
- | * Use Powerpoint (or any program you like) to add arrows or boxes to highlight the differences. | ||
- | </ | ||
- | |||
- | ====== Part 2: Transforming brains into a common space using FLIRT ====== | ||
- | |||
- | To automate measuring brain structures and differences in brain structures, it would be very helpful to have those structures at the same coordinates. Although not our problem for today, putting brain regions into the same coordinate system is **essential** for most functional MRI group statistical analyses. So, we are now going to do this. | ||
- | |||
- | We will transform at least **two** of the skull-stripped brains from the last exercise to a common coordinate system (the [[https:// | ||
- | |||
- | **1.** If you closed FSL after the last exercise, reopen it by typing '' | ||
- | |||
- | **2.** Click on the '' | ||
- | |||
- | **3.** Set the reference image to '' | ||
- | |||
- | <WRAP center round info 80%> | ||
- | This brain has T1 contrast and is in MNI space with 1 mm resolution. It has already been skull stripped. | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | **4.** For the '' | ||
- | |||
- | <WRAP center round tip 80%> | ||
- | You should already be in the correct directory from the last exercise. If not ... | ||
- | |||
- | I recommend | ||
- | - Entering the path ''/ | ||
- | - Clicking the folder icon to select the specific file. See the picture below. You could also just click the folder icon and navigate manually to ''/ | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | **5.** Specify the output. Start with ''/ | ||
- | |||
- | <WRAP center round alert 100%> | ||
- | Make sure that directory '' | ||
- | </ | ||
- | |||
- | <WRAP center round tip 100%> | ||
- | Note that in the screenshot I have set my output image to be the same name as my input image with '' | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | **6.** Change the '' | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round help 80%> | ||
- | <WRAP centeralign> | ||
- | <wrap em> | ||
- | </ | ||
- | We are going to apply a 6 degrees of freedom (DOF) model. When we say 6 DOF, we mean that there are 6 different things that we can change about our input image to get it to be like our reference image. | ||
- | |||
- | * The first 6 DOF represent translation (i.e., movement forward/ | ||
- | * The next 6 DOF represent rotation (i.e., yaw, pitch, roll) of our input to match our reference. | ||
- | </ | ||
- | |||
- | **7.** Press '' | ||
- | |||
- | **8.** Once this brain is complete, carry out the same operation on a **second individual' | ||
- | |||
- | <WRAP center round info 60%> | ||
- | Each Flirt could take up to 2-3 minutes. BE PATIENT! | ||
- | </ | ||
- | |||
- | ===== LAB REPORT Part 2 ===== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 2 | ||
- | </ | ||
- | </ | ||
- | * There are no questions for this part of the lab. | ||
- | </ | ||
- | |||
- | |||
- | ====== Part 3: Comparing the shapes of individual' | ||
- | |||
- | We are now going to see how well the transformations worked. | ||
- | |||
- | ===== Open AFNI ===== | ||
- | |||
- | In this section we will use yet another image viewer; [[http:// | ||
- | |||
- | **1.** Open your Terminal app and change your directory to your output directory '' | ||
- | |||
- | {{ : | ||
- | |||
- | **2.** Copy your reference image into your current directory using the following command in your '' | ||
- | |||
- | <code bash> | ||
- | cp / | ||
- | </ | ||
- | |||
- | **2.** Start AFNI by typing '' | ||
- | * By default AFNI will | ||
- | * load the first available brain in the directory | ||
- | * open the AFNI control window | ||
- | * open two views of the brain in two separate windows; axial and sagittal | ||
- | |||
- | **3.** Change the brain to one of your transformed brains. | ||
- | * click '' | ||
- | * choose the file from the dropdown menu | ||
- | * click '' | ||
- | |||
- | {{ : | ||
- | |||
- | **4.** Open a new viewer and load your second transformed brain. | ||
- | * **to open a new viewer, click on the '' | ||
- | * in the **new** control window that opens, load a different skull-stripped brain (see #3 above) | ||
- | * the new control window does not automatically open any views of the brain. So you'll need to click on the '' | ||
- | |||
- | {{ : | ||
- | |||
- | **5.** Open a third viewer and load the '' | ||
- | |||
- | **6.** Get your windows nicely organized and sized appropriately so each brain looks about the same. Unlike FSLeyes, AFNI opens each brain view in a separate window. This can make window management a bit of a pain. But you should try to get your windows organized so that they look something like the image below. Note that the title of each window starts with **'' | ||
- | |||
- | {{ : | ||
- | |||
- | **7.** To evaluate how well the transformation worked, click on three or more structures in the MNI reference brain and see if the cross-hairs show up in those same structures in your ' | ||
- | * Try the amygdala (one hemisphere only). | ||
- | * Try the head of the caudate. | ||
- | * Try the calcarine sulcus in the occipital lobe. | ||
- | |||
- | <WRAP center round tip 95%> | ||
- | If you have trouble finding the anatomy, you can use a cool AFNI viewer feature. Right click on any of the brains and select '' | ||
- | </ | ||
- | |||
- | ===== LAB REPORT Part 3 ==== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 3 | ||
- | </ | ||
- | </ | ||
- | * **1)** Include a figure showing two of the examples above. | ||
- | </ | ||
- | |||
- | <WRAP center round alert 50%> | ||
- | **Do not close AFNI**. You will use it in Part 4. | ||
- | </ | ||
- | |||
- | |||
- | ====== Part 4: Comparing the registration quality of different DOF models ====== | ||
- | |||
- | **1.** Now that you are familiar with 6 DOF models, try experimenting with a different DOF model run on a **single subject**. Remember to have a different output filename for this output. I suggest appending '' | ||
- | * In [[#Part 3: Comparing the shapes of individual' | ||
- | * Make sure to have your output go into the same directories you used for the 6 DOF, so that AFNI will have access to them. | ||
- | |||
- | <WRAP center round info 80%> | ||
- | Here's a reference for what each DOF means: | ||
- | * 3 DOF = translation in X, Y, Z | ||
- | * **6 DOF = 3 DOF + rotation in X, Y, Z** | ||
- | * 7 DOF = 6 DOF + global scaling (same scale factor to X, Y, Z) | ||
- | * 9 DOF = 6 DOF + scaling in X, Y, Z | ||
- | * **12 DOF = 9 DOF + shear in X, Y, Z** | ||
- | </ | ||
- | |||
- | <WRAP center round info 80%> | ||
- | The examples above are all linear transformations. Meaning that all voxels are transformed in some linearly related manner to each other. However, we often use non-linear registration to get an even better match to the standard brain. | ||
- | </ | ||
- | |||
- | **2.** Open the files that were generated with different DOFs in ' | ||
- | * The three AFNI viewers should display | ||
- | - the MNI152 template brain | ||
- | - your 6 DOF FLIRTed brain | ||
- | - your 12 DOF FLIRTed brain | ||
- | |||
- | <WRAP center round info 80%> | ||
- | In Part 3, you compared the registration across two different participants and the MNI brain. In this part, you are comparing the quality of registration of one participant (using two different DOF models) to the MNI brain. | ||
- | - MNI152 template brain | ||
- | - '' | ||
- | - '' | ||
- | </ | ||
- | |||
- | ===== LAB REPORT Part 4 ===== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 4 | ||
- | </ | ||
- | </ | ||
- | * Click around in the brain and compare how well/poorly each of the FLIRTed brains matches the MNI template brain. | ||
- | * Was there a noticeable difference in the quality of the transformation for higher (12 DOF) than lower (6 DOF) DOF models? | ||
- | * Include a figure that demonstrates this difference. | ||
- | * What are your impressions of the effect of spatial registration on alignment to the template brain and alignment across individuals? | ||
- | </ | ||
- | |||
- | <WRAP center round tip 80%> | ||
- | Once you've completed this section you can close all of your AFNI windows. | ||
- | tip box | ||
- | </ | ||
- | |||
- | ====== Part 5 - Using the FSL Atlases ====== | ||
- | |||
- | FSLeyes provides a nice set of probabilistic atlases that you can overlay on the standard brain to understand the name given to different anatomical locations. | ||
- | |||
- | <WRAP center round info 80%> | ||
- | * The FSL atlases are typically derived from a sample of participants. | ||
- | * Values at specific voxels reflect the probability that a particular person will have that atlas label. | ||
- | * e.g., 50% of participants might all agree a voxel is the left Thalamus | ||
- | * In contrast, in Part 6 of tonight' | ||
- | </ | ||
- | |||
- | ===== Start FSLeyes ===== | ||
- | |||
- | **1.** Open the MNI152 brain in FSLeyes | ||
- | * Start FSLeyes | ||
- | * Select **File** -> **Add Standard** | ||
- | * Choose '' | ||
- | |||
- | ===== Starting Atlas Tools ===== | ||
- | |||
- | **2.** Click on **Settings -> Ortho View 1 -> Atlas Panel** | ||
- | |||
- | **3.** Now if you click around to different areas of the brain, information will be updated in the atlases tools box that tells you about the anatomical location at the cross-hair. For instance, in the crosshairs in the image below are on the Right Hippocampus according to the Harvard-Oxford Subcortical Structural Atlas. | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round info 80%> | ||
- | * You might notice percentages next to each label. | ||
- | * Many of these anatomical labels were identified manually by experts on individual brains. | ||
- | * Then these labeled brains were transformed to the standard brain | ||
- | * And the label at each location in the brain was averaged across participants. | ||
- | |||
- | So if it says 63% Left Cerebral White Matter, this implies that 63% of participants had the label white matter applied to this location in the brain. | ||
- | </ | ||
- | |||
- | ===== Changing Atlases ===== | ||
- | |||
- | You can add or remove atlases from the list. | ||
- | |||
- | **1.** To add or remove atlases, simply click on the checkbox to the left of the atlas name. | ||
- | |||
- | **2.** | ||
- | |||
- | **3.** If you want to find out more about the different atlases, you can go to [[http:// | ||
- | |||
- | ===== Visualize Regions and/or Create ROIs ===== | ||
- | |||
- | You can visualize specific brain regions or create anatomical regions of interest (ROI) by: | ||
- | |||
- | **1.** | ||
- | |||
- | **2.** You can select your atlas by clicking on the checkbox to its left. Select **' | ||
- | |||
- | **3.** You can now jump to a specific structure. To find a structure you're interested in you can either scroll through the (long) list, or simply start typing a name into the '' | ||
- | |||
- | {{ : | ||
- | |||
- | **4.** If you click the '' | ||
- | |||
- | {{ : | ||
- | |||
- | **5.** You can also overlay the probabilistic values for this region from the atlas. Click on the checkbox to the left of the '' | ||
- | |||
- | * Your display will look like the one below. Each voxel is now shown with an associated probability that it is in the selected region. The more red the voxel, the more likely that it's in the **' | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round tip 80%> | ||
- | To better see the probabilistic overlay, you might want to turn off the colorful cortical labels. To do so, click on the blue eye next to '' | ||
- | </ | ||
- | |||
- | **6.** Notice the '' | ||
- | |||
- | {{ : | ||
- | |||
- | * If you highlight '' | ||
- | * If you highlight '' | ||
- | * Change the '' | ||
- | |||
- | |||
- | /* | ||
- | **7.** If you wanted to save this overlaid 'Left Thalamus' | ||
- | |||
- | * Click on '' | ||
- | * Find the folder location for your output file | ||
- | * And hopefully you know how to do the rest. | ||
- | */ | ||
- | |||
- | ===== LAB REPORT Part 5 ===== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 5 | ||
- | </ | ||
- | </ | ||
- | |||
- | Using the two **Harvard-Oxford** atlases, create figures that display each of the regions listed below. Your figures should only display voxels that have at least 25% probability of being within the region. (Turn off the '' | ||
- | |||
- | Regions: | ||
- | - Middle Frontal Gyrus | ||
- | - Angular Gyrus | ||
- | - Left Caudate | ||
- | - Right Amygdala | ||
- | |||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | /* | ||
- | <WRAP center round alert 80%> | ||
- | <WRAP centeralign> | ||
- | <wrap em>HERE BE DRAGONS!</ | ||
- | \\ | ||
- | \\ | ||
- | **YOU DO NOT HAVE TO DO THE REST OF THIS SECTION (Part 5). | ||
- | \\ | ||
- | \\ | ||
- | YOU MAY SKIP TO [[#Part 6: FSL First|PART 6]].** | ||
- | </ | ||
- | </ | ||
- | */ | ||
- | |||
- | |||
- | |||
- | /* | ||
- | ===== Registering Atlases to Individual Subject Brains ===== | ||
- | |||
- | //Do you know how we might automate the process of identifying individual subject anatomy using atlases like those in FSL?// | ||
- | |||
- | One approach is to register the brain region from the Atlas to your individual subject' | ||
- | |||
- | * Transform two regions from the Harvard-Oxford atlas, which are in standard space, to the subject' | ||
- | * Then load the subject' | ||
- | |||
- | <code bash> | ||
- | # Be patient this command will take a moment to apply the registration | ||
- | # and will then promptly load FSLView. | ||
- | # BTW, anything with '#' | ||
- | # Oh and Feel free to open this script if you want to more learn about how it works. | ||
- | cd ~/ | ||
- | bash transform_atlas_demo.bash 34353 12 | ||
- | </ | ||
- | |||
- | * //34353// refers to the subject found in the folder '' | ||
- | * //12// refers to 12 degrees-of-freedom (DOF) for the registration to/from standard space | ||
- | |||
- | < | ||
- | * **Can you guess what the region shown in //red// is and the region should in //blue//?** | ||
- | * Would you say the registration from standard to this subject' | ||
- | |||
- | * The intensity values for each region represent the probability value representing the number of subjects who were found to have that brain region at that voxel. | ||
- | * Try to change the threshold of each probabilistic atlas region using the textbox to the right of ' | ||
- | </ | ||
- | |||
- | {{ : | ||
- | |||
- | */ | ||
- | /* | ||
- | ===== Details on the Script ===== | ||
- | |||
- | The script will make use of two files: | ||
- | |||
- | * The subjects brain as the reference (this is the space you want your atlas to be in) | ||
- | * The pre-computed transformation matrix (12 DOF) for moving that subject to standard space. | ||
- | |||
- | The script will execute the following steps: | ||
- | |||
- | * Using '' | ||
- | * Using '' | ||
- | |||
- | The original ROIs are from the Harvard-Oxford cortical atlas in FSLView so they might look familiar. | ||
- | |||
- | < | ||
- | If you want to learn more about the tools used in this section, please refer to the [[http:// | ||
- | </ | ||
- | |||
- | |||
- | */ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ====== Part 6: FSL First ====== | ||
- | The FSL Atlases overlaid a group derived anatomical brain mask upon your transformed brain. Is this as accurate as determining the brain structure from an individual, non-normalized brain? In other words, is it as accurate to say "we think this region is Prof. Engell' | ||
- | |||
- | The FSL '' | ||
- | |||
- | In the code below, I used the skull-stripped version of the '' | ||
- | |||
- | **1.** In this example, we will create short-cuts in bash to point to the input and output directories. Be careful not to put any spaces before or after the '' | ||
- | |||
- | <code bash> | ||
- | INPUTDIR=~/ | ||
- | OUTPUTDIR=~/ | ||
- | </ | ||
- | |||
- | We can then use these short-cuts in our command line. They will be " | ||
- | |||
- | <WRAP center round tip 80%> | ||
- | To see what I mean by " | ||
- | <code bash> | ||
- | echo $INPUTDIR | ||
- | </ | ||
- | </ | ||
- | |||
- | **2.** | ||
- | |||
- | <code bash> | ||
- | run_first_all -v -b -i ${INPUTDIR}/ | ||
- | </ | ||
- | |||
- | The command line above executes the '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | * '' | ||
- | |||
- | <WRAP center round tip 80%> | ||
- | **Once FSL First is running (it should be printing a lot of stuff to your terminal window because we asked for " | ||
- | </ | ||
- | |||
- | |||
- | **3.** Here is what you should do with the output: | ||
- | * Overlay the segmented output (e.g., '' | ||
- | |||
- | ===== LAB REPORT Part 6 ===== | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 6 | ||
- | </ | ||
- | </ | ||
- | * Include an image of your segmented brain. | ||
- | * Observe how well, or how poorly, FSL FIRST automatically identified different anatomy. | ||
- | * Find the borders of the caudate, the amygdala, the hippocampus, | ||
- | * Would you use FSL's First for a scientific study of hippocampal volumes? | ||
- | * Think in terms of cost vs. benefit. If you had 100 subjects, do you think FIRST does a sufficiently good job of segmentation or do you think it would be necessary to identify the hippocampal borders in all 100 subjects by hand? | ||
- | </ | ||
- | ====== Part 7: Using a simple bash/AFNI script to average brains ====== | ||
- | |||
- | So how did the MNI152 brain come about anyway? Somebody at the Montreal Neurological Institute co-registered 152 brains to a single brain, and then averaged across all the registered brain. Let's try this on the five brains for which we have good registrations, | ||
- | |||
- | ===== Running the Script ===== | ||
- | |||
- | **1.** We will create an average brain by running the '' | ||
- | |||
- | <code bash> | ||
- | 3dcalc \ | ||
- | -prefix / | ||
- | -a / | ||
- | -b / | ||
- | -c / | ||
- | -d / | ||
- | -e / | ||
- | -expr ' | ||
- | </ | ||
- | |||
- | <WRAP center round info 80%> | ||
- | You'll need to open a new terminal window because the FAST is still working away in your open window. Just click on the open window and then enter the keyboard shortcut **'' | ||
- | </ | ||
- | |||
- | |||
- | |||
- | ===== Script Details ===== | ||
- | |||
- | * The '' | ||
- | * '' | ||
- | * Each of the file names is assigned to a unique letter from '' | ||
- | * '' | ||
- | |||
- | |||
- | ===== Examine your Results ===== | ||
- | |||
- | **3.** Open the Kenyon5 brain and the MNI152 brain in locked AFNI windows. Refer back to [[#Part 3: Comparing the shapes of individual' | ||
- | |||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 7 | ||
- | </ | ||
- | </ | ||
- | * How does the Kenyon5 brain look? | ||
- | * Is it as nice as the MNI152 brain?. | ||
- | * Why (or why not)? | ||
- | </ | ||
- | |||
- | |||
- | |||
- | <WRAP center round alert 80%> | ||
- | Don't forget to return to [[#Part 6: FSL First|Part 6]] and see if it's done running. If so, complete step #3 of that part. | ||
- | </ | ||
- | |||
- | |||
- | ====== Part 8: Examining a fully labeled FreeSurfer brain ====== | ||
- | |||
- | [[http:// | ||
- | |||
- | * freesurfer needs environment variables set to point to the data. This must be done in the terminal. | ||
- | |||
- | **1.** Type the following codes to a terminal window. | ||
- | |||
- | <code bash> | ||
- | # set the location of your subject' | ||
- | export SUBJECTS_DIR=~/ | ||
- | | ||
- | # | ||
- | export doublebufferflag=1 | ||
- | | ||
- | # set the subject ID | ||
- | export SUBJID=subj19_1A | ||
- | | ||
- | # Tell the viewer to display the pial view of the left hemisphere | ||
- | tksurferfv $SUBJID lh pial | ||
- | </ | ||
- | |||
- | The following image should pop up. | ||
- | |||
- | {{ : | ||
- | |||
- | You can use the notes below with the accompanying image to get an idea of the different buttons for tksurfer. | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round info 80%> | ||
- | - These buttons allow you to change the type of surface. | ||
- | * ' | ||
- | * ' | ||
- | * ' | ||
- | - These buttons allow you to rotate the brain in different ways (note the ' | ||
- | - These allow you to translate the brain in different directions (note the ' | ||
- | - These allow you to zoom in or out (note the ' | ||
- | - If you rotated or zoomed in too much and want to get back to normal, click this home button. | ||
- | </ | ||
- | |||
- | |||
- | Through the **TkSurfer Tools** GUI window, you can click on different surface views (main, inflated, etc.) | ||
- | |||
- | You can view the curvature of the brain via a green-red colormap: Green indicates a gyrus, Red indicates a sulcus. | ||
- | |||
- | **2.** Through the GUI: | ||
- | * '' | ||
- | * Choose '' | ||
- | * You can turn the curvature on/off by clicking on the curvature button on the GUI | ||
- | |||
- | {{ : | ||
- | |||
- | Or use the following command from the terminal: | ||
- | | ||
- | <code bash> | ||
- | tksurfer $SUBJID lh pial -curv lh.curv | ||
- | </ | ||
- | | ||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 8 - #1 | ||
- | </ | ||
- | </ | ||
- | * Create a figure depicting the brain with the curvature on and showing the outlines of the white matter (see the info box above describing what each button does). | ||
- | </ | ||
- | |||
- | Next, load the annotation (label) to view the segmentation overlay on the cortical surface: | ||
- | |||
- | **3.** Through the GUI: | ||
- | * '' | ||
- | * Choose one of the .annot files for the hemisphere you are viewing. For example, you can try '' | ||
- | * Click on different areas and the label is displayed on the bottom right corner of the " | ||
- | |||
- | {{ : | ||
- | |||
- | <WRAP center round important 100%> | ||
- | <WRAP centeralign> | ||
- | <WRAP centeralign> | ||
- | <typo fs:x-large; fc:purple; fw:bold; text-shadow: | ||
- | LAB REPORT Part 8 - #2 | ||
- | </ | ||
- | </ | ||
- | * Create a figure depicting the labeled brain showing the pial surface (see the info box above describing what each button does). | ||
- | </ | ||
- | |||
- | For reference, here is a labeled image of a sample freesurfer brain done by the freesurfer folks: | ||
- | |||
- | {{ : | ||
- | |||
- | |||
- | /* | ||
- | You can also view the data in 2D slices with segmentation using the viewer tkmedit. | ||
- | <code bash> | ||
- | tkmedit $SUBJID brainmask.mgz lh.white \ | ||
- | -aux T1.mgz -aux-surface rh.white \ | ||
- | -segmentation aseg.mgz $FREESURFER_HOME/ | ||
- | </ | ||
- | */ | ||
psyc410_s2x/brain_registration_atlases.1739203102.txt.gz · Last modified: 2025/02/10 10:58 by admin