Monday, May 20, 2013

Combining ROIs

Once you've used a tool like fslmaths, 3dcalc, or Marsbar to create a single ROI, you can combine several of these ROIs using the same tools. This might be useful, for example, when creating a larger-scale masks encompassing several different areas.

In each case, combining ROIs is simply a matter of creating new images using a calculator-like tool; think of your TI-83 from the good old days, minus those frustrating yet addictive games such as FallDown. (Personal record: 1083.) With fslmaths, use the -add flag to concatenate several different ROIs together, e.g.:

fslmaths roi1 -add roi2 -add roi3 outputfile

With AFNI:

3dcalc -a roi1 -b roi2 -c roi3 -expr '(a+b+c)' -prefix outputfile

With Marsbar is a bit more involved, but also easier since you can do it from the GUI, as shown in the following video.




Many thanks to alert reader Anonymous, who is both too cool to register a username and once scored a 1362 on FallDown. Now all you gotta do is lay back and wait for the babe stampede!

9 comments:

  1. Andy! You rule! Thanks for responding to my comment (yes I'm the original Anon) and providing this great info. By the way my real name is V.S. Ramachandran. Just kidding.

    ReplyDelete
    Replies
    1. Many a true word was spoken in jest

      Delete
  2. Hello Andrew,

    I was hoping would you be able to help me out with some issues I have been having with importing FreeSurfer ROIs (labels) into SPM8. Do you think you would have the time?

    Thanks,
    Monica

    ReplyDelete
    Replies
    1. Hi Monica,

      I do not have any experience with getting Freesurfer to interface with SPM, but as far as I can tell, the most you can do with them is display SPM results on a Freesurfer surface. I would be willing to help, but it may take a lot of time.

      -Andy

      Delete
    2. This comment has been removed by the author.

      Delete
  3. Andrew,

    May I get your feedback as to what approach (ie: software and tools) you would take for our project?

    We are looking to do an an analysis of the entorhinal cortex on a number of subjects. We are familiar with the use of FreeSurfer to extract ROIs using the color lookup table. However, my PI wants to take a similar approach with SPM (and Marsbar, if it applies). We co-registered our subjects initial PET scan to their vMRI within SPM8. And because we aren't familiar with the technique used to create ROIs in SPM, we thought maybe it would be possible to extract the ROI in FreeSurfer and just import it into SPM. Unfortunately, no success. Our group would prefer to stay away from hand drawing the ROI, if possible.

    If using SPM, what approach would you take? Or rather, what would be the best way to set this up for proper analysis?

    Thank you,
    Monica

    ReplyDelete
    Replies
    1. Hi Monica,

      What kind of analysis are you trying to do? Is this a voxel-based morphometry analysis, or are you extracting statistics from an ROI?

      It may be easier to do this through email; I can be reached through ajahn (at) indiana.edu

      -Andy

      Delete
  4. Hey, is there a way to combine more than 25 rois because alphabet has only 25 letters :/

    ReplyDelete
    Replies
    1. Hey Duodenum,

      In that case you may have to use 3dcalc multiple times, and combine the outputs from each execution.

      -Andy

      Delete