{"id":442,"date":"2009-04-08T14:41:42","date_gmt":"2009-04-08T21:41:42","guid":{"rendered":"http:\/\/prefrontal.org\/blog\/?p=442"},"modified":"2026-03-06T13:28:34","modified_gmt":"2026-03-06T20:28:34","slug":"using-caret-for-fmri-visualization","status":"publish","type":"post","link":"https:\/\/prefrontal.org\/blog\/2009\/04\/using-caret-for-fmri-visualization\/","title":{"rendered":"Using Caret for fMRI Visualization"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret.png\" alt=\"caret\" title=\"caret\" width=\"260\" height=\"195\" align=\"right\">Caret is an incredibly useful program for the calculation and visualization of brain data.  Like most incredibly useful programs it is also quite complex and a bit daunting to approach.  While looking at three-views is a staple of fMRI research, sometimes it is easier to get the &#8216;big picture&#8217; from a cortical surface rendering.  I have had several requests for a basic fMRI->Caret tutorial over the last few months and I have finally gotten around to writing it.  I make no guarantees that this is the most efficient or correct process, but it is how I was trained by an expert in Caret.<br \/>\n<!--more--><\/p>\n<hr>\n<p><strong>Mapping Contrasts to Inflated Surfaces in Caret:<\/strong><\/p>\n<p>1. Download Caret.  Go to the following address to get started:<br \/>\n<a href=\"http:\/\/brainvis.wustl.edu\/wiki\/index.php\/Caret:Download\">http:\/\/brainvis.wustl.edu\/wiki\/index.php\/Caret:Download<\/a><br \/>\nYou will have to go through a registration process, after which you can access the files to download the Caret application.<\/p>\n<p>2. Download the following tutorial dataset.<br \/>\nHuman.PALS_B12.BOTH.TEMPLATE-for-fMRI-MAPPING.73730<br \/>\nfrom the following address:<br \/>\n<a href=\"http:\/\/sumsdb.wustl.edu\/sums\/directory.do?dir_id=6585200\">http:\/\/sumsdb.wustl.edu\/sums\/directory.do?dir_id=6585200<\/a><br \/>\nThis is a series of template files and information for the mapping of spatially normalized fMRI data onto an inflated cortical surface.<\/p>\n<p>3. Decompress the tutorial dataset and put it in a safe place on your computer.  Whenever you want to do a Caret mapping make a COPY of the template and use the copy.  Otherwise your template will be littered with the contrasts of a dozen different projects (trust me).<\/p>\n<p>4. Open the Caret application.  It should look something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret1.png\" alt=\"caret1\" title=\"caret1\" width=\"301\" height=\"375\"><\/p>\n<p>5. Under the Attributes menu at the top of the screen select &#8216;Map Volumes to Surfaces&#8217;.  A window will appear asking you what kind of data mapping you wish to perform.  Make sure that &#8216;Metric&#8217; is selected and then click on the Next button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret2.png\" alt=\"caret2\" title=\"caret2\" width=\"567\" height=\"374\"><\/p>\n<p>6. The next window that appears is where we select our SPM volumes for mapping.  These are usually SPM t-maps that you want to represent on an inflated cortical surface.  Select the &#8216;Add Volumes From Disk&#8217; button and add the Analyze or Nifti volume for mapping.  You can add as many volumes as you wish.  When you are done click on the Next button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret3.png\" alt=\"caret3\" title=\"caret3\" width=\"320\" height=\"373\"><\/p>\n<p>7. The next window is where we tell Caret what files to use for the mapping and where to store the results.  While you can load a spec file into Caret and then &#8216;Map to Caret&#8217;, I usually just map it directly into the Spec file.  Click on &#8216;Map to Spec File&#8217; button, which will bring up a new selection window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret4.png\" alt=\"caret4\" title=\"caret4\" width=\"319\" height=\"373\"><\/p>\n<p>8.  In the new Mapping Surface Selection window click on &#8216;Select&#8217; and navigate to the template directory.  The spec file to use is in the MAPPING_PROCEDURES folder.  After you select the spec file you will see that the Spec File, Topology Files, and Fiducial Coordinate Files fields are filled with information.  Click on the &#8216;Select All Coord&#8217; files and hit the OK button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret5.png\" alt=\"caret5\" title=\"caret5\" width=\"341\" height=\"374\"><\/p>\n<p>9. When the Mapping Surface Selection window has closed you will be kicked back to the Surface Selection Screen.  Hit the Next button.<\/p>\n<p>10. The next window that appears allows you to edit the names for each volumes as they will appear in Caret later.  Edit each Data Column Name to be a good identifier, making sure to include something to discriminate left from right.  If you are curious whether a row represents the left hemisphere or right hemisphere mapping just scroll to the right and look at the surface file name.  When you are done hit the Next button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret6.png\" alt=\"caret6\" title=\"caret6\" width=\"501\" height=\"391\"><\/p>\n<p>11.  In the next window you will select the mapping algorithm.  &#8216;Enclosing Voxel&#8217; is usually sufficient, but you can try others if you wish.  When you are don hit the Next button.<\/p>\n<p>12. At this point a progress bar will appear and Caret will compute the volume-to-surface mappings.  Depending on the speed of your computer and the number of volumes to map this might take a few minutes.  When Caret is done a processing summary will appear.  Make sure everything is in order and hit the Finish button.<\/p>\n<hr>\n<p><strong>Viewing the results:<\/strong><\/p>\n<p>1. Open Caret and select &#8216;Open Spec File&#8217; from the File menu.  Navigate to the spec file that you used in the mapping procedures above and hit Open.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret9.png\" alt=\"caret9\" title=\"caret9\" width=\"497\" height=\"376\"><\/p>\n<p>2. A window will appear that allows you to change and select a large number of parameters for loading the spec file.  For brevity I always use the Select All button followed by the Load button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret10.png\" alt=\"caret10\" title=\"caret10\" width=\"391\" height=\"342\"><\/p>\n<p>3. An inflated brain will appear in the Caret window, but none of your volume information will appear.  Select &#8216;Display Control Window&#8217; from the Window menu at the top of the screen.  This is where you can tell Caret what you want to display in the main viewing window.<\/p>\n<p>4. In the Display Control window that appears there is a drop-down menu called &#8216;Page Selection&#8217; at the top.  Make sure that &#8216;Overlay\/Underlay &#8211; Surface&#8217; is selected.  Now, there is a grid of radio buttons below called Surface Attributes.  Make the row that specifies &#8216;Metric&#8217; coloring into the primary overlay by clicking on the radio button to the far left of the word Metric.  On the drop-down menu to the right of the word Metric make sure that you have the right contrast and hemisphere specified for what you want to display.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret11.png\" alt=\"caret11\" title=\"caret11\" width=\"532\" height=\"457\"><\/p>\n<p>5. There may or may not be some coloring on your inflated brain at this point, but odds are such that it isn&#8217;t what you want to display.  Under the Page Selection drop-down menu at the top of the Display Control window make sure that &#8216;Metric&#8217; is selected.  This will enable the specification of what t-values you want to display.  Select whether you want positive values, negative values, or both under the Display Mode section of the screen.  Next, select &#8216;User Scale&#8217; in the Color Mapping section and define what t-values to use.  At this point I usually go back to SPM to see what the threshold t-value was for the study and input that value.  You might have to play around with the maximum value a bit depending on the distribution of your voxel values.  Finally, select the checkbox for &#8216;Display Color Bar&#8217; so you can let everyone know what your threshold criteria were.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret12.png\" alt=\"caret12\" title=\"caret12\" width=\"355\" height=\"418\"><\/p>\n<p>6. That should, hopefully, be it!  You should have an inflated surface in your main viewing window with your t-contrasts mapped on.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret.png\" alt=\"caret\" title=\"caret\" width=\"260\" height=\"195\"><\/p>\n<p>7. For different views and opposite hemispheres make a new selection under the &#8216;Model&#8217; drop-down menu in the main viewer screen.  If you change hemispheres you must also change what metric file you are using on the &#8216;Overlay\/Underlay &#8211; Surface&#8217; Display Control window panel.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/prefrontal.org\/blog\/wp-content\/uploads\/2009\/04\/caret13.png\" alt=\"caret13\" title=\"caret13\" width=\"429\" height=\"374\"><\/p>\n<hr>\n<p><strong>A Few Other Hints:<\/strong><\/p>\n<p>+ Depending on the location of your clusters they may show up as larger or smaller on the Caret surface.  For instance, I had a very nice IPS cluster that was huge in the 3D volume but barely showed up on the Caret brain.  To my knowledge there isn&#8217;t much you can do.  My strategy is to show a Caret brain and then subfigures with axial slices so you can see another representation of the results.<\/p>\n<p>+ The best way to get Caret to spit out image files is to select the &#8216;Capture Image of Main Window&#8217; item under the file menu.  You can either output an image of the main window our you can output an array of standard views automatically.  Very useful.<\/p>\n<p>+ ALWAYS make sure that you have the correct hemisphere selected under the Model menu in the main viewer and under the Metric file-selection on the &#8216;Overlay\/Underlay &#8211; Surface&#8217; Display Control window panel.  Don&#8217;t get mixed up &#8211; it is easy to do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Caret is an incredibly useful program for the calculation and visualization of brain data. Like most incredibly useful programs it is also quite complex and a bit daunting to approach. While looking at three-views is a staple of fMRI research, sometimes it is easier to get the &#8216;big picture&#8217; from a cortical surface rendering. I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,10],"tags":[],"class_list":["post-442","post","type-post","status-publish","format-standard","hentry","category-cognitive-neuroscience","category-mri"],"_links":{"self":[{"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/posts\/442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":21,"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/posts\/442\/revisions\/480"}],"wp:attachment":[{"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prefrontal.org\/blog\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}