<> === From Functional Activation on Surface === If you are looking at functional activation on the surface and would like to save some active region as an ROI, you can currently do so in {{{tksurfer}}}. As an example, we will show you how to do this on the FSFAST tutorial data but feel free to use your own. To use the tutorial data, you must do: {{{ setenv SUBJECTS_DIR $TUTORIAL_DATA/fsfast-tutorial.subjects cd $TUTORIAL_DATA/fsfast-functional }}} If you are not at an organized course, $TUTORIAL_DATA should be set to the path where you downloaded all the tutorial data. Open a subject using {{{tksurfer}}} or {{{tksurfer-sess}}}: {{{ tksurfer-sess -s sess01 \ -analysis workmem.sm05.lh \ -c encode-v-base \ -c emot.dist-v-base \ -c probe.avg-v-base \ -c emot.dist-v-neut.dist }}} The above command loads fsaverage. '''Threshold'''<
> If you want to play with the threshold, you can do '''View > Configure > Overlay''' or use the shortcut and left-click on the Show Overlay button {{attachment:icon_overlay.gif}} on the Tksurfer Tools Window. Make sure to hit the spacebar after you change the Min or Max value in order to see the results. '''Create label'''<
> Click anywhere inside an active region that you want to save as an ROI. Click on the Custom Fill button on the Tksurfer Tools Window. Chose "Up to functional values below threshold". Fill from "Last clicked vertex". And your Action is "Create new label". Now click the Fill button. You should see the region you chose turn white and then back to its original color except now it will be outlined in yellow. If you changed your mind and no longer want the region you selected, go to '''Edit > Deselect Label'''. '''Save label'''<
> On the Tools window, go to '''File > Label > Save Selected Label'''. A box will open with a path to save the ROI in the subject's label directory by default. Save it with the file extension .label (e.g. V1.label). Click OK. '''View the label'''<
> You can view the label by opening it from the commandline using the command below: (You can also open it from the Tksurfer tools menu, File > Label > Load Label) {{{ tksurfer fsaverage rh inflated -gray -tcl $SUBJECTS_DIR/scripts/load_label.tcl }}} -gray loads the curvature in grayscale. In order for the above command to work, you need to create the load_label.tcl script and make sure it is executable. Below is what the script should contain: {{{ labl_load $home/$subject/label/your.label }}} The $subject variable will use whatever follows 'tksurfer' on the commandline. '''View multiple subjects'''<
> You can write a script that will load one subject after the other to make it easier to create ROIs or view them. Something along the lines of this: {{{ #!/bin/tcsh -ef setenv SUBJECTS_DIR /path/to/data set SUBJECTS_DIR=/path/to/data source /path/to/data/scripts/all_subjects.csh set fwhm=10 set show=1 foreach sub ($SUBJECTS) tksurfer-sess -s $sub -analysis TOM.sm${fwhm}.rh -c TPJ -no-aparc if ($show == 1) then echo '==============' echo '===Label Size===' echo '================' label_area rh $sub rh.yourlabel echo '======END=======' sleep 5 endif end }}} The script above will show the area of the label when tksurfer exits. It also requires a text file with all the subject IDs you want to cycle through.