Caret5 Tutorial

Segmentation, Flattening, and Registration

 

John Harwell, Donna Hanlon,

Heather A. Drury, and David C. Van Essen

 

Version 5.5

 

September 2006

 

Copyright 1995-2006 Washington University

 

Washington University School of Medicine

Department of Anatomy and Neurobiology

Saint Louis, Missouri  USA 63110

 

http://brainmap.wustl.edu

 


Table of Contents

 

Table of Contents.................................................................................................................. 2

Table Of Figures................................................................................................................... 3

Copyright 2006 Washington University.................................................................................. 5

About This Document............................................................................................................ 6

Conventions in this Document................................................................................................ 6

Bug Reporting or Questions About Caret5 Software.............................................................. 6

Downloading and Installing Caret5......................................................................................... 6

Data Set for Use With This Tutorial....................................................................................... 6

Prerequisites.......................................................................................................................... 7

Volume File Types Supported by Caret5............................................................................... 7

Set the Current (Working) Directory...................................................................................... 7

Read the Anatomical Volume................................................................................................. 8

Anatomical Volume Requirements.......................................................................................... 9

Set the Volume’s Orientation............................................................................................... 10

Set the Volume’s Stereotaxic Coordinates........................................................................... 11

Setting the Voxel Range to 0 to 255..................................................................................... 14

Saving the Anatomical Volume............................................................................................. 14

Cropping the Anatomical Volume to a Single Hemisphere..................................................... 15

Segmenting an Anatomical Volume...................................................................................... 18

Manual Error Correction..................................................................................................... 26

Error Correction Example................................................................................................ 30

Save Corrected Segmentation Volume............................................................................. 34

Generating Final Surface and Surfaces For Flattening........................................................... 34

Surface Flattening................................................................................................................ 36

Correct Template Medial Wall Boundary and Calcarine Cut Borders............................... 37

Multi-Resolution Morphing (Surface Distortion Reduction)............................................... 41

Aligning the Surfaces to Standard Orientation................................................................... 41

Saving the Aligned Surface Files...................................................................................... 43

Spherical Registration.......................................................................................................... 46

Command Line Segmentation.............................................................................................. 52


Table Of Figures

 

Figure 1 - Choose Current Directory Dialog........................................................................... 8

Figure 2 - Import Data File Dialog......................................................................................... 9

Figure 3 - Volume with Intensity Problems........................................................................... 10

Figure 4 - Volume Attributes Editor Dialog.......................................................................... 11

Figure 5 - Crosshairs Near Ventricles.................................................................................. 12

Figure 6 - Crosshairs Over AC in Parasaggital View............................................................ 13

Figure 7 - Crosshairs Over AC in Horizontal View............................................................... 13

Figure 8 - Save Data File Dialog for Saving Anatomical Volume........................................... 15

Figure 9 - Cropping Right Hemisphere Horizontal View....................................................... 16

Figure 10 - Cropping Right Hemisphere Parasagittal View.................................................... 16

Figure 12 - Cropped Right Hemisphere............................................................................... 17

Figure 13 - Save Data File Dialog - Cropped Right Hemisphere........................................... 18

Figure 14 - SureFit Operations Set Directory Page.............................................................. 19

Figure 15 - SureFit Operations Subject Information Page..................................................... 20

Figure 16 - SureFit Operations Spec File Page.................................................................... 21

Figure 17 - SureFit Operations Volume Selection Page........................................................ 22

Figure 18 - Segmentation Operation Volume Attributes Page............................................... 23

Figure 19 - SureFit Operations Set Gray and White Matter Peaks Page............................... 24

Figure 20 - Segmentation Operations Page.......................................................................... 25

Figure 21 - SureFit Operations Segmentation Complete Page............................................... 26

Figure 22 - Segmentation..................................................................................................... 27

Figure 23 - Segmentation Near Eye..................................................................................... 27

Figure 24 - Segmentation Near Eye Corrected..................................................................... 28

Figure 25 - Midbrain Before Correction............................................................................... 29

Figure 26 - Midbrain After Cleanup..................................................................................... 29

Figure 27 - Segmentation Volume Handle Finder Dialog....................................................... 30

Figure 28 - Handle Voxels Highlighted In Purple.................................................................. 31

Figure 29 - Handle Voxels Without Highlighting................................................................... 31

Figure 30 - Anatomical Volume in Handle Region................................................................ 31

Figure 31 - Voxels That Need to Be Remove to Fix Handle................................................. 32

Figure 32 - Handle in Surface.............................................................................................. 32

Figure 33 - Segmentation Volume Editor Dialog................................................................... 33

Figure 34 - SureFit Operations Volume Selection (Segmentation Volume)............................ 35

Figure 35 - Segmentation Operations Page (Final Surfaces).................................................. 36

Figure 36 - Flatten Full Hemisphere Dialog.......................................................................... 37

Figure 37 - Template Cuts on Compressed Medial Wall Surface.......................................... 38

Figure 38 - Identifying Medial Wall and Calcarine on Inflated Surface in Medial View........... 39

Figure 39 - Identified Medial Wall and Calcarine Cut on Compressed Medial Wall Surface.. 39

Figure 40 - Corrected Medial Wall and Calcarine Cut on Compressed Medial Wall Surface. 40

Figure 41 - Initial Flat Surface.............................................................................................. 41

Figure 42 - Unaligned Flat Surface....................................................................................... 42

Figure 43 - Aligned Flat Surface.......................................................................................... 43

Figure 44 - Save Aligned Flat Coordinate File...................................................................... 44

Figure 44 - Node Identified Along Superior Temporal Gyrus................................................ 47

Figure 46 - Central Sulcus, Superior Temporal Gyrus, and Sylvian Fissure Landmarks.......... 48

Figure 46 - Landmarks on Flat............................................................................................ 49

Figure 47 - Landmarks on Sphere....................................................................................... 49


Copyright 2006 Washington University

 

Permission to use, copy, modify, and distribute this document solely for non-commercial applications is hereby granted by Washington University free of charge, provided that the copyright notice "Copyright 2006 Washington University" appears on all copies of the software and that this permission notice appears in all supporting documentation. The name of Washington University or of any of its employees may not be used in advertising or publicity pertaining to the software without obtaining prior written permission from Washington University.

 

Washington University makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty.

 

 


About This Document

 

This document is designed to serve as a tutorial on how to segment and flatten surfaces using Caret5.

 

Conventions in this Document

 

 

Bug Reporting or Questions About Caret5 Software

 

Please use either the Caret users’ mailing list (http://brainmap.wustl.edu/resources/caretnew.html#Help) or send an email to caret@brainmap.wustl.edu.  Suggestions are also welcome.

 

Downloading and Installing Caret5

 

Please see the document Caret 5.5 Tutorial – Introduction, Installation, and Visualization.

 

Data Set for Use With This Tutorial

 

The data set for use with this tutorial is available in “zip” format from our SuMS database.  Follow the link  http://sumsdb.wustl.edu:8081/sums/archivelist.do?archive_id=6588227.  On the SuMS web page, there is column named name containing the file name: caret_5.5_segment_flatten_register_tutorial.zip.  To the left of this name in the action column is a control.  Select this control, which will popup a menu, and select download to automatically start downloading the archive (set of files).

 

After downloading the data set, the archive needs to be uncompressed.  Linux and Macintosh users should run the command unzip caret_5.5_segment_flatten_register_tutorial.zip.  Windows XP users should place the mouse over the downloaded file and press the right mouse button.  From the popup menu, choose Extract All and follow the prompts.  Windows XP users may also extract the file from the command line window by running caret_unzip caret_5.5_segment_flatten_register_tutorial.zip provided the caret/bin directory is in the user’s PATH environment variable.

 

Prerequisites

This document assumes the reader has some familiarity with Caret5 such as the ability to view surfaces and volumes, use the Display Control Dialog, and manipulate borders.  Please see one of the other tutorials if you are not familiar with viewing data in Caret5.

Volume File Types Supported by Caret5

 

Volume files of type AFNI, NIFTI, SPM, and Washington University’s “.ifh” format are read using the Open Data File item on the File Menu.  These volumes have sufficient metadata that specifies the orientation and stereotaxic coordinates.  If a volume of one of these types is used, some of the steps in this tutorial will not be necessary. 

 

Volume files of type Analyze, MINC, and VTK are read using the Import File menu item on the File Menu.  These file types rarely have sufficient metadata and it will usually be necessary to set some of the volume’s attributes using Caret5 prior to segmenting the volume.  While most MINC volumes contain the required metadata, those MINC volumes written by SureFit (used for segmentation and distributed by our lab prior to this release of Caret5), do not contain the required metadata.

 

In this tutorial, an Analyze format volume file will be used that will require the setting of attributes in Caret5.

 

Set the Current (Working) Directory

 

Prior to starting Caret5, place the anatomical volume (tutorial data set files) into a directory containing no other files.  Start Caret5 using the appropriate method for your operating system.  If you do not start Caret5 from a terminal window with the current directory set to the directory containing the anatomical volume, perform the following steps to set the current directory:

 

Figure 1 - Choose Current Directory Dialog

 

Read the Anatomical Volume

 

Import the Analyze Volume by performing the following steps:

 

Figure 2 - Import Data File Dialog

 

Anatomical Volume Requirements

 

A volume must meet several requirements to be segmented in Caret5.  These requirements are:

1)      The volume must be standard T1-weighted MRI scans taken in vivo, in which white matter is bright, gray matter is darker, and CSF is even darker. 

2)      The intensities should be consistent throughout the volume.  For instance, in Figure 3, the frontal lobes are much brighter than the remainder of the brain.  This volume would not be segmented correctly.

3)      The volume must be in an LPI orientation.  That is, the negative X is left, negative Y is posterior, and negative Z is inferior.

4)      The voxels must be 1mm cubic voxels (0.5mm for monkeys).

5)      The volume’s stereotaxic coordinates must be set so that the coordinate (0, 0, 0) is at the anterior commissure.

6)      The volume must contain only a single hemisphere or part of a single hemisphere.

7)      The voxels must be in the range 0 to 255.

 

Figure 3 - Volume with Intensity Problems

 

Set the Volume’s Orientation

 

We know that the anatomical volume used in this tutorial is already in an LPI orientation but this information was not in the header file.  Set the volume’s orientation by following these steps:

 

Figure 4 - Volume Attributes Editor Dialog

 

If you use a volume type that has sufficient metadata that describes the volume’s orientation (such as an AFNI volume) Caret5 will automatically convert the volume to an LPI orientation.  Otherwise, the Flip About X Screen Axis, Flip About Y Screen Axis, and Rotate Clockwise buttons in the Orientation section of the Volume Attributes Editor can be used to bring the volume into an LPI orientation.

 

Set the Volume’s Stereotaxic Coordinates

 

Now that the volume’s orientation has been set, the volume’s stereotaxic coordinates need to be established.  The voxel sizes are already set to 1.0 mm for each dimension.  The origin values are the coordinates of the voxel that is the most left, posterior, inferior voxel.  To set the origin, we will find the anterior commissure and inform Caret5 of its location.  Caret5 will then use the voxel sizes along with the anterior commissure position to determine the origin.  Locate the Anterior Commissure so that it is under the crosshairs in the Main Window by performing the following steps:

 

 

Figure 5 - Crosshairs Near Ventricles

 

 

Figure 6 - Crosshairs Over AC in Parasaggital View

 

Figure 7 - Crosshairs Over AC in Horizontal View

 

Now that the crosshairs are over the anterior commissure, the volume’s stereotaxic coordinates are established by performing the following steps:

 

Setting the Voxel Range to 0 to 255

Saving the Anatomical Volume

 

With the volume’s attributes properly set, the volume should be saved by following these steps:

 

Figure 8 - Save Data File Dialog for Saving Anatomical Volume

 

Cropping the Anatomical Volume to a Single Hemisphere

 

Caret5’s segmentation algorithm requires that the input volume contain only a single hemisphere.  In the next steps, the anatomical volume will be cropped so that it contains just the right hemisphere.

 

Figure 9 - Cropping Right Hemisphere Horizontal View

 

Figure 10 - Cropping Right Hemisphere Parasagittal View

 

 

Figure 12 - Cropped Right Hemisphere

 

The cropped right hemisphere should be saved by performing the following steps:

 

Figure 13 - Save Data File Dialog - Cropped Right Hemisphere

 

Segmenting an Anatomical Volume

 

Now that you have a single hemisphere that is AC-centered, in LPI orientation, with 1.0 mm cubic voxels, it is now time to start the segmentation process.

 

Figure 14 - SureFit Operations Set Directory Page

 

 

Figure 15 - SureFit Operations Subject Information Page

 

 

Figure 16 - SureFit Operations Spec File Page

 

 

Figure 17 - SureFit Operations Volume Selection Page

 

 

Figure 18 - Segmentation Operation Volume Attributes Page

 

The Set Gray and White Matter Peaks page is used to provide information about the distribution of gray and white matter in the volume.  On the left side of page is a histogram showing the distribution of voxels in the anatomical volume.  On the right side of the page are controls for adjusting the gray and white matter peaks.  Selecting the round or diamond shaped button to the left of Gray Peak Control or the White Peak Control colors all voxels exceeding that peak in green.  Caret5 will attempt to identify the gray and white peaks but they normally will need some adjustment.

 

For additional information on drawing peaks visit the web page http://brainvis.wustl.edu/help/peak_tweaking/index.html.

 

 

Figure 19 - SureFit Operations Set Gray and White Matter Peaks Page

 

 

Figure 20 - Segmentation Operations Page

 

 

Figure 21 - SureFit Operations Segmentation Complete Page

 

Manual Error Correction

 

In most cases, there will be handles remaining after the initial segmentation.  In addition, the SureFit algorithm may classify non-cortical material near the eye or in the midbrain as cortex.  Arteries and blood vessels may also get segmented and are usually very bright in the anatomical volume.  As a result, manual error correction must be performed.  At times, this may be an iterative process in which multiple cycles of manual correction of the segmentation volume and surface generation are performed.

 

Figure 22 - Segmentation

Figure 23 - Segmentation Near Eye

Figure 24 - Segmentation Near Eye Corrected

 

In some cases, it may not be necessary to remove all of voxels on the midbrain structures.  Instead, just make sure that the voxels overlaying the midbrain structures no longer connect to the voxels overlaying the white and gray matter.  Once you believe the segmentation voxels overlaying the two structures are no longer connected, select Remove Islands form the Volume Menu’s Segmentation submenu.  You might want to save the segmentation volume prior to using this option.

 

Figure 25 - Midbrain Before Correction

 

      

Figure 26 - Midbrain After Cleanup

 

Now that the voxels overlaying the midbrain structure have been removed it is time to look for handles (topological defects).

 

Figure 27 - Segmentation Volume Handle Finder Dialog

 

 

When correcting errors in the volume it is sometimes helpful to turn off the segmentation and the RGB coloring that shows the handles to view the underlying segmentation to help determine the type of correction necessary.

 

Error Correction Example

 

This example is not from this tutorial’s segmentation.  Here is an instance where the segmentation has jumped across the banks of a sulcus in the occipital lobe.  Figure 28 shows the segmentation with the handle in purple, Figure 29 shows the segmentation, Figure 30 shows just the anatomical volume,  Figure 31 shows the segmentation with the voxels that should be removed in a black encircled region, and Figure 32 shows the handle on the inflated surface.

 

Figure 28 - Handle Voxels Highlighted In Purple

 

 

Figure 29 - Handle Voxels Without Highlighting

 

Figure 30 - Anatomical Volume in Handle Region

 

Figure 31 - Voxels That Need to Be Remove to Fix Handle

 

 

 

 

Figure 32 - Handle in Surface

 

 

The following steps are taken to correct this handle.

 

Figure 33 - Segmentation Volume Editor Dialog

 

 

Correcting handles involves adding voxels to the segmentation or removing voxels from the segmentation.  When voxels need to be removed from the segmentation, set the Editing Mode of the Segmentation Volume Editor to Turn Voxels Off.  When voxels need to be added, set the editing mode of the Segmentation Volume Editor to Turn Voxels On. The mouse will function as an eraser or a paint brush.  After making any changes to the Segmentation Volume Editor Dialog, press the dialog’s Apply push button. In the Main Window with the segmentation volume displayed, just move the mouse with the left mouse button held down to change the status of segmentation voxels.  If there is a hole in a slice that needs to be filled, set the Editing Mode to Flood Fill 2D.  Clicking the mouse on a voxel that is not part of the segmentation will fill all connected voxels that are not part of the segmentation.  If at any time a mistake is made while editing the surface, pressing the Undo push button will restore the values of voxels that were just changed.  It may be necessary to press the Undo push button several times to back out changes.

 

When using the Volume Handle Finder to locate and correct handles, correct handles along one axis at a time.  When you think the listed handles have been fixed, press the Search For Handles push button again to verify that no new handles were created and handles were corrected.  Once no handles are reported for an axis, search along a different axis and correct the handles found.  The Volume Handle Finder Dialog is not guaranteed to find all handles so it may be necessary to inspect a surface, such as the inflated surface, for handles.

 

Save Corrected Segmentation Volume

 

Once all of the handles have been corrected, the segmentation volume should be saved.

 

Generating Final Surface and Surfaces For Flattening

 

Since the segmentation volume has been modified to correct topological errors, the surface needs to be regenerated.

 

Figure 34 - SureFit Operations Volume Selection (Segmentation Volume)

 

 

Figure 35 - Segmentation Operations Page (Final Surfaces)

 

 

Surface Flattening

 

Now that the ellipsoid surface has been generated it is time to flatten the surface.

 

 

Figure 36 - Flatten Full Hemisphere Dialog

Correct Template Medial Wall Boundary and Calcarine Cut Borders

 

For a very thorough description of drawing the borders for flattening (and registration) visit the web page http://brainvis.wustl.edu/help/landmarks_core6/landmarks_core6.html.

 

After a short time the “compressed medial wall” surface will appear with a red border somewhat enclosing the medial wall region and blue borders showing where cuts will be made.  See Figure 37.

 

Figure 37 - Template Cuts on Compressed Medial Wall Surface

 

 

Figure 38 - Identifying Medial Wall and Calcarine on Inflated Surface in Medial View

 

 

Figure 39 - Identified Medial Wall and Calcarine Cut on Compressed Medial Wall Surface

 

 

 

 

Figure 40 - Corrected Medial Wall and Calcarine Cut on Compressed Medial Wall Surface

 

The initial flat surface will appear similar to that in Figure 41.  The green symbols may be removed by selecting Clear Node Identify Symbols from the Identify sub-menu of the Surface Menu or by pressing the CID button in the Identify Window’s Toolbar.  If there are any large regions of crossovers (shown in red), indicating handles that are still present in the surface, it may be necessary to go back and edit the segmentation volume to correct the handles.  If the handles are found the edge of the flat surface they can be removed by following the instructions in the Initial Flattening Dialog.

 

Figure 41 - Initial Flat Surface

 

 

Multi-Resolution Morphing (Surface Distortion Reduction)

 

 

Aligning the Surfaces to Standard Orientation

 

When the multi-resolution morphing process is complete, several dialogs will pop up. 

 

Figure 42 - Unaligned Flat Surface

 

 

Figure 43 - Aligned Flat Surface

 

 

Since data files (flat coordinate, spherical coordinate, and latitude longitude) have been modified by the alignment process, they need to be saved.

 

Saving the Aligned Surface Files

 

 

Figure 44 - Save Aligned Flat Coordinate File

 

 

At this point you are done.

* Select Exit from the File Menu (Quit from the Caret Menu for Macintosh users). 

 

 


Spherical Registration

 

Caret5 provides two registration methods, flat and spherical, for bringing one surface into register with another using landmarks to constrain the deformation.  The landmarks consist of borders that identify regions identified on both surfaces such as the medial wall boundary and various sulci.  There are several advantages of spherical registration over flat registration.  First, the spherical surfaces are closed (contain no cuts), eliminating the requirement for landmarks along the surface perimeter in flat registration.  Secondly, spherical registration requires six landmarks, two along the medial wall boundary, and one each on the calcarine sulcus, the central sulcus, the sylvian fissure, and the superior temporal gyrus.

 

The first step in performing a spherical registration is to draw the needed registration landmarks (borders) on both the individual and atlas surfaces.  For good quality registration, six registration landmarks are needed.  Fortunately, three of the six required registration landmarks are automatically created during the flattening of a full hemisphere.  You may recall drawing the medial wall and calcarine cuts during the flatten full hemisphere process.  The medial wall cut becomes two of the registration landmarks by splitting it into two pieces where it intersects both the frontal and calcarine cuts.  The calcarine cut becomes the third registration landmark.  You will need to draw the other three required registration landmarks that denote the central sulcus, the sylvian fissure, and the superior temporal gyrus.

 

For a very thorough description of drawing the borders for registration (and flattening) visit the web page http://brainvis.wustl.edu/help/landmarks_core6/landmarks_core6.html.

 

There are two other very important considerations regarding the landmark borders.  First, both the individual and atlas landmarks must consist of the same number of borders with a one-to-one correspondence in the border names.  Secondly, each of the corresponding landmark borders must be oriented in the same manner.  In other words, each of the corresponding borders must begin and end in corresponding anatomical locations.

 

 

Figure 44 - Node Identified Along Superior Temporal Gyrus

 

Figure 46 - Central Sulcus, Superior Temporal Gyrus, and Sylvian Fissure Landmarks

 

 

Figure 46 - Landmarks on Flat

Figure 47 - Landmarks on Sphere

 

 

The INDIVIDUAL surface now has the landmarks required for registration.  The ATLAS surface already has its needed landmarks so it is now time to execute the registration process.

 

 

Viewing Registration Results

 

Command Line Segmentation

 

To segment at the command line, the volume must be in an LPI orientation with its origin set so that the (0, 0, 0) stereotaxic coordinate is at the anterior commissure.  The gray and white peaks must also be known.

 

 

VOLUME SEGMENTATION

      caret_command -volume-segment <operation_code> \

                <f-gray-peak> <f-white-peak> \

                <padding-code> <structure> <spec-file-name>

                <anat-or-segment-volume>

 

      Operation_Code characters

         Specify each with either a "Y" or "N".

         All characters must be specified.

         Character   Operation Description

         ---------   ---------------------

                 1   Disconnect Eye and Skull

                 2   Disconnect Hindbrain

                 3   Use High Threshold for Hindbrain disconnection

                 4   Cut Corpus Callossum

                 5   Generate Segmentation

                 6   Fill Ventricles

                 7   Automatic Error Correction

                 8   Generate Raw and Fiducial Surfaces

                 9   Generate Inflated Surface

                10   Generate Very Inflated Surface

                11   Generate Ellipsoid Surface (For Flattening)

                12   Generate Hull Surface

                13   Generate Curvature, Depth, and Paint Attributes

 

      gray-peak  specifies the intensity of the gray matter peak in the

                 anatomy volume.

 

      white-peak  specifies the intensity of the white matter peak in the

                  anatomy volume.

 

      padding-code

         Specify padding for any cut faces when segmenting a partial hemisphere.

         Specify each with either a "Y" for padding or "N" for no padding.

         All characters must be specified.

         Character   Padding Description

         ---------   -------------------

                 1   Pad Negative X

                 2   Pad Positive X

                 3   Pad Posterior Y

                 4   Pad Anterior Y

                 5   Pad Inferior Z

                 6   Pad Superior Z

 

      structure  Specifies the brain structure.

                  Acceptable values are RIGHT or LEFT

 

      spec-file-name  Name of specification file.

 

      anat-or-segment-volume  Name of input volume.

         The volume must be in a Left-Posterior-Inferior orientation and

         its stereotaxic coordinates must be set so that the origin is

         at the anterior commissure.