[caret-users] Caret and SPM5

Donna Dierker donna at brainvis.wustl.edu
Mon Oct 29 15:09:54 CDT 2007


Jay,

Although I was all set to shame you into learning some scripting, John 
recalled a feature that gets you around it for now.  The Animate button 
on the D/C: Metric: Settings menu cycles through whatever metric columns 
are currently loaded.  (You can load multiple volumes from disk when 
mapping to the atlas; then open the resulting metric to load the 
resulting columns.)

Make sure your metric scale is set to user (not auto), and press the 
Animate button.  You can even capture a movie of the toggling using the 
File: Record main window images as movie.

Alternatively, if/when you do want individual captures, it's really not 
too hard to script something like this:

----------------------------------------------------------------
#!/bin/sh
MY_VOLUMES=`ls *nii`

OUTCOMPOSITE=Composite_My_fMRI.metric
for VOLUME in `cat $MY_VOLUMES`
do
  OUTROOT=`echo $VOLUME | sed 's/.nii$//g'`
  caret_command -volume-map-to-surface-pals $OUTCOMPOSITE $OUTCOMPOSITE 
SPM2 LEFT METRIC_INTERPOLATED_VOXEL $VOLUME -metric-afm
  sed "s/COLUMN_HEAD/$COL_HEAD/g" TEMPLATE.LEFT.scene > $OUTROOT.LEFT.scene
  OUTJPEG=$VOLUME.LEFT.jpg
  caret_command -show-scene $SPEC $OUTROOT.LEFT.scene 1 $OUTJPEG
done
----------------------------------------------------------------

Just create a scene file that shows a single case how you like (color 
scale, palette, rotation, etc.), and save it as TEMPLATE.LEFT.scene.  
Then use a text editor to replace metric file in your scene with 
Composite_My_fMRI.metric; also replace the column head in your sample 
scene with COLUMN_HEAD.  Then the above script will go through each 
volume; map it; and capture that metric column in the same view as your 
scene.

Donna

On 10/29/2007 09:13 AM, John Harwell wrote:
>
> Hi Jay,
>
> On Oct 27, 2007, at 9:06 PM, Jay Hegdé wrote:
>
>> Hi,
>>    I have been using Caret to map functional data from SPM5 in *.nii 
>> format onto PALS surfaces.  It works without a hitch and I must say 
>> that the results are quite spectacular!  I'm sure the results would 
>> be even better when the Caret template for SPM5 becomes available 
>> (I'm currently using SPM2 templates).
>>
>>    I do have two questions, both having to do with the fact that I 
>> need to map a relatively large number of nii files (>100) to the same 
>> color scale.  (Essentially, I need to make a time-lapse movie of the 
>> % response change values over the course of the scan.)
>>      (1) Is there a way I can specify the properties of color scale 
>> (e.g., min, max, stepsize)?  I need to map all my nii files using the 
>> *same* color scale.
>>
>
> On the Metric:Settings page of the Display Control Dialog, is a 
> section titled "Color Mapping".  When set to Auto Scale (the default), 
> the most positive metric value of the selected metric column maps to 
> the 1.0 value of the color palette and the most negative metric value 
> maps to the -1.0 value of the color palette.  The problem you with 
> your scale is that as you change metric columns, the color shown for a 
> specific metric value may vary as a result of the metric columns 
> minimum and maximum values.
>
> In your case, I think you want to set Color Mapping to User Scale.  
> With user scale, you can choose the metric values that map to 1.0 (Pos 
> Max) and -1.0 (Neg Max) values of the color palette.  By using User 
> Scale, you will get a consistent mapping of metric values to the color 
> palette as you cycle through your 100+ metric columns.
>
>>    (2) Is there a way of automating the surface mapping process 
>> (other than using "caret_map_fmri" perhaps)?  For instance, is there 
>> a way I can record my menu selections and button presses, save it as 
>> script, edit it as needed and run it?
>
> Caret does not have a method of saving and replaying GUI actions as a 
> script.   The "caret_map_fmri" program, which was intended to map 
> individual functional volumes to individual surfaces, will no longer 
> be included in future releases of Caret.  However, its functionality 
> now part of next release of "caret_command".  In addition, 
> caret_command is also able to map group average functional volumes to 
> the PALS atlas.  Writing a script that maps your functional volumes is 
> probably the best approach.  If you need the new version of 
> caret_command or assistance in writing a script, let us know.
>
>
>>    Thank you very much and best regards,
>>    Jay Hegdé
>>    University of Minnesota
>> _______________________________________________
>> caret-users mailing list
>> caret-users at brainvis.wustl.edu
>> http://pulvinar.wustl.edu/mailman/listinfo/caret-users
>
>
> -----------------------------------
> John Harwell
> john at brainmap.wustl.edu
>
> Department of Anatomy and Neurobiology
> Washington University School of Medicine
> 660 S. Euclid Ave   Box 8108
> Saint Louis, MO 63110
>
>
>
>
> _______________________________________________
> caret-users mailing list
> caret-users at brainvis.wustl.edu
> http://pulvinar.wustl.edu/mailman/listinfo/caret-users
>




More information about the caret-users mailing list