Attachment 'fsfast.wiki.txt'

Download

#pragma section-numbers off

[wiki:Self:FreeSurferWiki top] | [wiki:Self:Tutorials previous]

This tutorial steps you through the analysis of an fMRI data set with
the FreeSurfer Functional Analysis Stream (FSFAST), from organizing
the data to group analysis.

[[TableOfContents]]

= Tutorial Data Description =

The data being analyzed is part of the fBIRN Phase I data set. There
are 5 subjects, each scanned twice at each of 10 sites. The data in
the tutorial is the data collected at the MGH site. The task is a
simple sensory motor blocked design experiment. During each task block
the subject was shown a flashing checkerboard and presented with an
auditory tone. During this time, the subject was asked to press
bottons with both hands. The task blocks alternated with fixation
blocks during which the subject stared at a fixation cross but
performed no other task. Each block type was 15 sec long. Each run
started with a fixation block followed by 8 pairs of task and fixation
blocks (and so ends with a fixation block) for a total run duration of
255 sec. The TR was 3 sec, so there were 85 time points. This task was
performed 4 times in each visit.Anatomicals were also collected and
analyzed in FreeSurfer for each of these subjects.

= Getting and Organizing the Tutorial =

The tutorial requires about 10G of space. Find a location for this
data, download or copy the tarfile from XXX. Untar it with:

tar xvfz fsfast-tutorial.tar.gz 

This will create a directory called fsfast-tutorial. You can now
delete the tar file. cd fsfast-tutorial. It will be assumed that you
are in this directory (or subdirectory there of) throughout the
tutorial. This directory will have five folders:

 * fb1-raw - raw fMRI data
 * fb1-raw-study - raw data origanized as an FSFAST study but unanalyzed
 * fb1-preproc-study - The same data preprocessed.
 * fb1-analysis-study - The same data analyzed
 * subjects - FreeSurfer reconstruction of anatomical data (plus the fsaverage subject).

If you look (ls) in fb1-raw, you will see that there are 20 NIFTI data sets with names like f.mgh-10X.1-rYYY.nii. These are the 20 fMRI runs mentioned above. X indicates the subjects number (1, 3, 4, 5, 6), and YYY indicates the run number. The sensory-motor task happend to be runs 3, 5, 7, and 10.

= Quick Visualization Tutorial (tkmedit/tksurfer) =

The purpose of this tutorial is to familarize you with how to use
FreeSurfer volume viewer (tkmedit) and surface viewer (tksurfer) in
the context of viewing functional data.You should already know how to
use tkmedit and tksurfer otherwise. See the pages below for a more
detailed handling of tkmedit and tksurfer.

== tkmedit ==
 * [wiki:Self:TkMeditGuide_2fTkMeditGeneralUsage_2fTkMeditInterface Interface] [[BR]]
 * [wiki:Self:FsTutorial/TkmeditGeneralUsage General usage] [[BR]]
 * [wiki:Self:FsTutorial/TkmeditWorkingWithData Working with data] [[BR]]
 * [wiki:Self:FsTutorial/TkmeditReference Quick reference] [[BR]]

== tksufer ==

 * [wiki:Self:TkSurferGuide_2fTkSurferGeneralUsage_2fTkSurferInterface Interface] [[BR]]
 * [wiki:Self:FsTutorial/TksurferGeneralUsage General usage] [[BR]]
 * [wiki:Self:FsTutorial/TksurferWorkingWithData Working with data] [[BR]]
 * [wiki:Self:FsTutorial/TksurferReference Quick reference] [[BR]]

== Viewing a single functional overlay in the volume ==

cd into the study with all the analyzed data:
{{{
cd fb1-analysis-study
}}}
Run tkmedit-sess (this is an FSFAST wrapper for tkmedit):
{{{
tkmedit-sess -s mgh-101.v1 -a sm-gamma-fwhm5 -c odd-v-0 -aparc+aseg
}}}
Don't worry about what all the arguments mean, this part is only about visualization.This command will bring up two windows, one with a brain image the other a control panel.

attachment:tkm-101-gam-cor.2-4.gif
attachment:tkm-101-toolswindow.gif

The brain image is the FreeSurfer anatomical for this subject. The
slightly pale colors on the anatomical indicate the FreeSurfer
automatic segmentation. The bright red/yellow/blue are super-threshold
voxels in the functional overlay. As you click on different points,
you will see the "Functional value" field in the Tools window change
as well as the "Sgmtn label".Note that areas that are not above
threshold will still have non-zero functional values. The
interpretation of the value depepends on what is being viewed. This is
a significance map, so the value is -log10(pvalue)*sign (ie, for a
pvalue = .01, the functional value will be +2). The sign is a
functional direction. The red/yellow are postive, and the blue are
negative. As a functional value gets more positive, its color will
change from red to yellow. As it gets more negative, it will change
from blue to cyan.[[BR]]

Toggle the functional overlay on and off by hitting the button with
the red/yellow blob in the Tools window (it's in the top row - if you
mouse over it, you'll see a "Show Overlay" tooltip.)[[BR]]

Configure the functional overlay by clicking on "View..." in the Tools
window, then "Configure->Functional Overlay...". You should see the
following interface:

attachment:tkm-101-config-funcoverlay.gif

The thresholds are currently set at 2 (Min) and 4 (max). The Min
threshold is the minimum absolute value needed for a voxel to show an
overlay color. The maximum is the value beyond which the voxel will
stop changing color. Try changing these values, then hit the Apply
button to see their effect.[[BR]]

So, what's all that activation OUTSIDE of the brain. Can't have that!
Try hitting View->Mask Functional Overlay to Aux button. There, now
isn't that better? And why is it so blockly? There are big voxels in
functional data, but if you'd like to pretend otherwise, try hitting
the "Trilinear" button on the Configure Functional Overlay window.

== Viewing multiple functional overlays and time courses in the volume ==
Run tkmedit-sess (this is an FSFAST wrapper for tkmedit):
{{{
tkmedit-sess -s mgh-101.v1 -a sm-fir-fwhm5 -c 1v0 -aparc+aseg
}}}

This will bring up the two windows as you saw before (the brain image
window will have a different overlay). It will also bring up a window
called "Time Course". Click anywhere in the volume, and you will see a
time course associated with that voxel similar to the one below.

attachment:tkm-101-fir.gif

The meaning of the time course depends upon the nature of the time
course loaded. In this case it is the hemodynamic response to the task
block averaged over all blocks over all runs (this is an "FIR"
model). The horizontal axis is time (0 means the onset of the
block). You can visualize the values of any multi-frame data set in
this way (it does not have to be a "time" course).[[BR]]

Notice that there is not much activation in the functional
overlay. This is good! You are looking at an overlay that corresponds
3 seconds prior to stimulus onset, so there should be no
activation. To see the other time points, bring up the functional
overlay configuration window (View->Configure->Functional
Overlay). Notice that the "Time Point" field now has a range of 0-8
indiating the 9 time points in the Time Course window. If you hit the
+ button next to "Time Point" then hit Apply, you will see the overlay
change. You will also see a vertical dashed line in the Time Course
window. You are now looking the map associated with the time between 0
and 3 sec after stimulus onset. Keep hitting the +/Apply buttons to
see different time points. You can hit the "|>" button to start a
movie of the activation (then "[]" to stop it).

== Viewing a single functional overlay on the surface ==

To view the same data on the surface run:

{{{
tksurfer-sess -s mgh-101.1 -a sm-gamma-fwhm5 -c odd-v-0 -hemi lh
}}}

Again you will see two windows, "Tksurfer Tools" and a surface image window.

= Assembling the Data in the FSFAST Hiearchy =

== The Project (or Study) Directory ==
== Create a Session ==
== Create a Stimulus Schedule (Paradigm File) ==
== Link to the FreeSurfer Anatomical Recontruction ==
== Create a SessionID File ==

= Preprocessing of fMRI Data (preproc-sess) =
== What preprocessing stages do you want to run? ==

There are up to seven types of preprocessing that are run on fMRI
data: 1. brain masking, 2. motion correction (MC), 3. slice-timing
correction (STC), 4. B0 distortion correction, 5. spatial smoothing,
6. resampling to common space, and 7. intensity normalization. Not all
packages run all of these seven, and they are not always run in the
same order, and some stages are sometimes run as post-processing. In
FSFAST, we can run 1. MC, 2. STC (optional), 3. smoothing, and
4. intensity normalization. We create a brain mask, but we do not mask
the functional data.

== Run preprocessing ==

To run MC and spatial smoothing by 5 mm FWHM along with brain mask creation on one session run:

{{{
cd fb1-raw-study
preproc-sess -s mgh-101.1 -fwhm 5
}}}

Note that this has already been done with all subjects in the
fb1-preproc-study directory. To preprocess all of the session, you
would run "preproc-sess -sf sessid -fwhm 5". Also note that if
preprocessing as already been performed on a session, it will
automatically skip it and move on to the next (unless you add -force
to the command-line).

== Examine additions to hierachy ==

{{{
ls mgh-101.1/bold/003
ls mgh-101.1/bold/masks
}}}

You will see f.nii (the raw data), fmc.nii (motion corrected), and
fmcsm5.nii (motion corrected and smoothed). In addition you will see
fmc.mcdat; this is a text file with the motion correctionwill
parameters (translations and rotations) as created by AFNI. You will
also see mcextreg.bhdr. This is a binary file with the orthogonalized
motion correction parameters which can later be used as nuisance
regressors when analyzing the data. These files will exist in each of
the runs (ie, 005, 007, 010). You will see a brain.nii volume in the
masks folder. This is a binary mask of the brain as found by FSL's BET
program. The functional data themselves are not masked.[[BR]]

To view the translation components, run
{{{
plot-twf-sess -s mgh-101.1 -mc
}}}
This will bring up a plot with the translations for each of the runs.

= Function-Structure Registration =

In order to render the functional results on the anatomical background
as well as to map the functional results into a common space for group
analysis, it is necessary to register/align the functional volume with
a structral volume. In FSFAST, we first register to the same-subject
FreeSurfer anatomical with a 6 DOF registration. We then map the
functional to Talairach/MNI305/fsaverage space by concatenating the
within-subject function/structure registration with the Talairach
registration (talariach.xfm) created when the subject was
reconstructed. For mapping to surface-based space, we concatenate the
within-subject function/structure registration with the surface-based
registration. Since we are only dealing with the functional analysis
here, we will just consider the within-subject function/structure
registration. 

== View unregistered (tkregister-sess) ==

Run the following command to see how the functional and structrual are
aligned prior to performing any automatic registration.

{{{
cd fb1-preproc-sess
tkregister-sess -s mgh-101.1 -regheader
}}}
Hit the compare button.

== Run automatic registration (fslregister-sess) ==
{{{
cd fb1-preproc-sess
fslregister-sess -s mgh-101.1
}}}
When this command is complete, you will see a register.dat file in
mgh-101.1/bold. This is the only change. The functional data are not
resampled! 

== Check automatic registration (tkregister-sess) ==
{{{
cd fb1-preproc-sess
tkregister-sess -s mgh-101.1 -regheader
}}}
Hit the compare button.

== Check talairach registration ==
{{{
tkregister2 --s fbph1-101 --fstal --surf
}}}

= First-Level Analysis =

The First-Level Analysis (FLA) consists of setting up models of the
task-related and nuisance components. The FLA is done in two
stages. In the first stage, the FLA is configured (with
mkanalysis-sess). This is done once regardless of how many data sets
you have (you do not even need to have any data to run the
configuration). In the second stage, you actualy perform the analysis
with selxavg3-sess by passing it the configuration and the session
that you want to analyze. selxavg3-sess customizes the analysis for
that session based on what it finds in the hierarchy, builds the
design matrix, and performs the analysis. Breaking the FLA up into
these two stages assures that all sessions are analyzed in the same
way. 

== Configure Analysis and Contrasts I: Gamma HRF Model  ==

Configuring the FLA is performed with mkanalysis-sess. When you run:
{{{
cd fb1-preproc-study
mkanalysis-sess -gui
}}}

You will see the following window:
attachment:mkana-startup.gif

You will use this window to specify the input of the analysis, the
hemodynamic response model, contrasts, and nuisance regressors. The
red fields are field that you must enter before you can save the
analysis.  There is a lot going on with this GUI, so we'll break it
down. Note that many of the components have "tooltips" that will show
when you pause the mouse pointer over them.

In the upper left corner is a panel called "FS-FAST Hiearchy". The
"Func Stem" is the input to the analysis. You should specify the
output from the preprocessing. For this excercise, we are going to use
the motion corrected and 5mm smoothed data. This functional volume is
called fmcsm5.nii in the hiearchy which makes its stem "fmcsm5" (ie,
just strip off the nii). Enter "fmcsm5" into the field. When you hit
return, it changes from red to white. Next, enter the TR (sec). For
this experiment it was 3 sec. This will be checked against the TR
found in the input nifti file. Leave INorm checked.

Turn your attention to the "Noise and Nuisance Variables" panel. Low
frequency noise so prevelant in fMRI is compensated for in a
combination of three ways. Drift components are modeled with
polynomial regressors. The order can be adjusted, but leave it at 2
for now. The motion correction parameters can be used as regressors by
checking the "MC Regressors" box (do so now). Finally, the remaining noise is
modeled as time-invariant linear AR1 process when the "Temporal
Whitening" box is checked (leave it so). There is one additionaly way
to compensate for noise through the use of a "Time Point Exlucde
File", but we will not consider that here.

You will specify the model of the task-related signal in the "Event
Related/Block Design" panel (leave that box checked). Choose the
number of conditions by clicking on the "NConditions" slider. This is
the number of TASK conditions (do not include the Null/Fixation
condition). In this example, we have two conditions (Odd and Even), so
adjust this to 2. To the right of this is the "Paradigm File". Enter
"sensory-motor.par". Note that the number of task conditions in the
paradigm file must match that specified with "NConditions". Below, you
will specify the Hemodynamic Response Model. There are three choices:
Gamma, SPM HRF, and FIR. Choose Gamma for now. If you hit the "Plot"
button it will show the Gamma and SPM HRF. As you change the Gamma
paraters (Delay, Dispersion (Tau), and Exponent (Alpha)), the Gamma
plot will change. Make sure that they are at Delay=2.25, Tau=1.25, and
Alpha=2.

At this point, you have specified the model of the BOLD signal
including HRF, nuisance, and noise. The GUI should look like the image
below:

attachment:mkana-gamma-precon.gif

Now you are ready to specify contrasts. A contrast is an instantiation
of a hypothesis and is represented by a contrast matrix (ie, a linear
summation of the regression coefficients). Contrasts are managed
through a separate GUI accessed through the "Contrast" list box. When
you click on "Add Contrast", you will see the following screen:

attachment:mkcon-gam-startup.gif

There are several things going on here, but the most important is the
list of condtitions in the middle of the GUI (ie, "Condition 1",
"Condition 2") will green, red, and black radio buttons. Green
indicates an "active" condition; red means a "control" condition, and
black means to ignore the condition in the contrast. Active conditions
are given a weight of +1; controls are given -1; ignores get 0. The
weight is given to the right of the buttons.  All contrasts are
implicitly computed against the Null or Fixation condition. If you
want to test the null hypothesis that Condition 1 is no different than
the Null condition, then you would make Condition 1 active and ignore
the rest. To test the null hypothesis that Condition 1 is no different
than Condition 2, then you would make Condition 1 active and Condition
2 control. 

For this exercise, we are going to test four NULL hypotheses:

 * Odd == Fixation (odd-v-0)
 * Even == Fixation (even-v-0)
 * Odd == Even (odd-v-even)
 * Odd+Even == Fixation (odd-+even)

The last one tests whether the average of the responses to odd and
even are different than fixation. Remember that, according to the
Paradigm File, Condition 1 is Odd, and Condition 2 is Even.  When "Add
Contrast" is clicked, "Condition 1" will be active and Condition 2
will be ignored. This corresponds to our first contrast, so there is
nothing we need to do except give the contrast a name. You should give
your contrasts meaningful but terse names. Specify "odd-v-0" for this
contrast. Hit the "Done/Save" button.  You will now see "odd-v-0"
appear in the Contrast list box in the mkanalyiss GUI.

Click on "Add Contrast" again to bring up the contrast GUI
again. This time, click on the green button next to Condition 2 (see
its weight change from 0 to 1). Then click on the black button next
to Condition 1 (see weight change from 1 to 0). Change the name to
"even-v-0", then click Done/Save. "even-v-0" will appear in the list
box.

Click on "Add Contrast" again, and click the red button next to
Condition 2 (see its weight change from 0 to -1).  Change the name to
"odd-v-even", then click Done/Save.

Click on "Add Contrast" one more time, and click the green button next to
Condition 2 (see its weight change from 0 to +1).  Change the name to
"odd+even", then click Done/Save.

You can go back and view and/or edit an contrast by clicking on it in
the list box.

The last thing you have to do is to give your analysis a name. Like
the contrasts, it should be terse but descriptive (it cannot have any
spaces or blanks). Specify "sm-gamma-fwhm5" (sm = sensory-motor, gamma
= Gamma HRF, and fwhm5 for the input). The interface should now look
like:

attachment:mkana-gamma-done.gif

Hit the "Save" button, then "Quit".

After you hit Quit, control will be returned to the shell that you ran
mkanalysis-sess from. If you type "ls", you will see a new folder
called "sm-gamma-fwhm5". If you "ls sm-gamma-fwhm5", you will see
analysis.info, analysis.cfg, odd-v-0.mat, even-v-0.mat,
odd-v-even.mat, odd+even.mat. Your configuration is stored in these
files. You can browse/edit your configuration by running:

{{{
mkanalysis-sess -gui -analysis sm-gamma-fwhm5
}}}

== Configure Analysis and Contrasts II: FIR HRF Model  ==

Now we are going to use a Finit Impulse Response (FIR) to model the
hemodynamic response. The FIR does not make any assumptions about the
shape of the HRF but is also less interpretable. Again, run

{{{
cd fb1-preproc-study
mkanalysis-sess -gui
}}}

Set the Func Stem, TR, NConditions, and Paradigm File as above, but
now click on the "FIR" checkbox. This will enable the "Total Time
Window", "PreStim", and "TER" entry boxes. The Time Window is the
window within which we will estimate the HRF. Given that the task is
15 sec long and the rest is 15 sec, let's choose 27 sec. The PreStim
is the amount of time before stimulus onset to start estimating the
HRF. A non-zero PreStim gives us an idea of what the baseline is at
stimulus onset. Set it to 6. 

Setup the same contrasts as you did above, then name the analysis
"sm-fir-fwhm5", hit Save, then Quit.

== Analyze First Level (selxavg3-sess) ==

You are now ready to analyze some data! Note that the fully analyzed
data (along with correctly configured analyses) can be found in
fb1-analysis-study. To analyze the data for session mgh-101.1 with the
sm-gamma-fwhm5 analysis, run:

{{{
cd fb1-preproc-study
selxavg3-sess -s mgh-101.1 -analysis sm-gamma-fwhm5
}}}

Note that if you want to analyze all the sessions, you can run
"selxavg3-sess -sf sessid -analysis sm-gamma-fwhm5".

To analyze the data for session mgh-101.1 with the sm-fir-fwhm5
analysis, run:
{{{
cd fb1-preproc-study
selxavg3-sess -s mgh-101.1 -analysis sm-fir-fwhm5
}}}

== Examine additions to the hierarchy ==

{{{
ls mgh-101.1/bold
ls mgh-101.1/bold/sm-gamma-fwhm5
ls mgh-101.1/bold/sm-gamma-fwhm5/odd-v-0
}}}

== Visualize ==

=== Volume-based visualization (tkmedit-sess) ===

View the result of the Gamma HRF analysis on the FreeSurfer anatomical
volume for mgh-101.1 with:
{{{
cd fb1-analysis-study
tkmedit-sess -s mgh-101.1 -aparc+aseg -analysis sm-gamma-fwhm5 \
  -c odd-v-0 -c even-v-0 -c odd+even -c odd-v-even 
}}}
When you configure the functional overlay with
View->Configure->Functional Overlay, you will see that there are 4
"Time Points". Each point is different contrast (ie, 0 is odd-v-0, 1
is even-v-0, etc). Scroll through each one.

View the result of the HRF HRF analysis for mgh-101.1 with:
{{{
cd fb1-analysis-study
tkmedit-sess -s mgh-101.1 -aparc+aseg -analysis sm-fir-fwhm5 -c odd-v-0 
}}}
Here we view only one contrast at a time because each contrast has
multiple time points for each point in the time window. Note that
there is less activation than the Gamma HRF. When you click on a
point, you will see the HRF for both Condition 1 (Odd) and Condition 2
(Even) blocks.

Finally, view the overlay maps from the Gamma with the HRF from the FIR:
{{{
cd fb1-analysis-study
tkmedit-sess -s mgh-101.1 -aparc+aseg -analysis sm-fir-fwhm5 \
  -mapanalysis sm-gamma-fwhm5 -c odd-v-0 -c even-v-0 -c odd+even -c odd-v-even 
}}}
When you configure the overlay, you will see that there are 4 "Time
Points" -- these correspond to the 4 contrasts from the Gamma analysis.

=== Surface-based visualization (tksurfer-sess) ===
View the result of the Gamma HRF analysis on the FreeSurfer anatomical
surface for mgh-101.1 with:
{{{
cd fb1-analysis-study
tksurfer-sess -hemi lh -aparc -s mgh-101.1 -analysis sm-gamma-fwhm5 \
  -c odd-v-0 -c even-v-0 -c odd+even -c odd-v-even
}}}
Note that the command-line is nearly identical to that of tkmedit
above. The difference is that the hemisphere is specified ("-hemi
lh"), and "-aparc+aseg" is replaced with "-aparc" to load the
surface-based segmentation.

= Higher-Level (Group) Analysis =

Higher-Level is where you make inferences about the population that
your subjects are drawn from. It is a bit confusing at times because
both use GLMs, so at both levels you are constructing design matrices,
contrasts, etc. Traditionally, fMRI group analysis has been done in a
standard volume space (ie, Talairaach/MNI152/MNI305). With FreeSurfer,
we also have the option to analyze group data in the surface
space. Volume-based analyses are done in MNI305 space (which is the
same as the fsaverage subject).

== Assemble the Data (isxconcat-sess) ==

The first step in the group analysis is to "assemble" the data. This
means creating a single 4D file with where the 4th "time" dimension is
actual all the subjects concatenated together in a common space. There is a
different command, depending upon whether the common space is volume-
or surface-based.

For the next exercises, we will work in the fb1-analysis-study directory
{{{
cd fb1-analysis-study
}}}


=== Volume-based (MNI305/fsaverage) ===

To run the volume-based concatenation, run the command below. Note
that the data from this command already exist in the
group-sm-gamma-fwhm5-tut directory.

{{{
isxconcat-sess -sf sessid -a sm-gamma-fwhm5 -c odd-v-0 -o group-analysis
}}}

This command will go through each session in the sessid file, find the
odd-v-0 contrast in the sm-gamma-fwhm5 analysis, use the register.dat
for that session to resample to MNI305/fsaverage space. These are all
concatenated together and saved in
group-analysis/sm-gamma-fwhm5/odd-v-0/tal.ces.nii file. In addition, several
other files are created. To see them, 

{{{
ls group-analysis-tut/sm-gamma-fwhm5
cat group-analysis-tut/sm-gamma-fwhm5/sessid
cat group-analysis-tut/sm-gamma-fwhm5/ffxdof.dat
}}}

In the output directory, you will see a series of files that start
with "tal". tal.h-offset.nii is a stack where each "time point" is the
mean functional image of each subject sampled in the MNI305 space. 
tal.masks.nii are the binary masks for all the subjects, and 
tal.snr.nii are the functional SNR maps from each
subject. tal.mask.nii is a single binary mask made from the
intersection of the individuals. ffxdof is the fixed-effects DOF
across all subjects. sessid.txt is the list of sessions, the
corresponding freesurfer subject name, and the DOF contributed by each
subject. 

You will also see some files that being with "lh". These are the same
thing in the surface-based space.

Now look in the directory for odd-v-0 the contrast
{{{
cd fb1-analysis-study
ls group-sm-gamma-fwhm5-tut/odd-v-0
}}}

You will see tal.ces.nii. These are the contrast maps for eaah of the
subjects, and tal.cesvar.nii are the variance of the contrast for each
subject (ie, the square of the standard error). This variance is
needed for fixed-effects and weighted random-effects analysis. You'll
also see a bunch of directories that start with "glm". Ignore those
for a moment.

==== Quality Assurance ====

There are three important quality assurance steps that can be perfomed
here. First, view the mean funcitonals to make sure that all are
registered together properly. To do this run,

{{{
tkregister2 --s fsaverage --surf \
  --mov group-sm-gamma-fwhm5-tut/tal.h-offset.nii \
  --regheader --check-reg
}}}
The image window will show the MNI305 brain. Hit the "Compare" button
to show the average functional of the first session. Click in the
image window, then hit the 'a' key. Each time you hit the 'a' key, it
will advance to the next subject.

The next QA step is to check the individual masks. This can be done
with:
{{{
tkmedit fsaverage orig.mgz \
  -overlay group-sm-gamma-fwhm5-tut/tal.masks.nii -fthresh 0.5
}}}
The threshold of 0.5 is appropriate because these masks are binary 
(ie 0-1). When you View->Configure->Functional Overlay, you will see 
that there are 5 "Time Points" (0-4) corresponding to the 5 subjects. 
Advance through each one to assure that the masks are in the proper place.

The final step is to look at the functional SNR maps with
{{{
tkmedit fsaverage orig.mgz \
  -overlay group-sm-gamma-fwhm5-tut/tal.snr.nii \
  -timecourse group-sm-gamma-fwhm5-tut/tal.snr.nii \
  -fthresh 50 -fmax 250
}}}
Again, when you View->Configure->Functional Overlay, you will see 
that there are 5 "Time Points" (0-4) corresponding to the 5 subjects. 
Advance through each one to assure that the SNR maps are
"consistent". When you click on a voxel, you will see the SNR for each
subject plotted in the "Time Course" window. The actual value of the
FSNR will vary depending upon how much smoothing you've done and the
details of the acquisition. You are looking for outliers here.

==== Group Analysis ====

===== Random Effects (RFx, OLS) =====
{{{
cd group-sm-gamma-fwhm5-tut/odd-v-0
mri_glmfit --y tal.ces.nii --osgm \
  --glmdir glm.rfx.tal.ces 
tkmedit fsaverage orig.mgz -overlay glm.rfx.tal.ces/osgm/sig.mgh
}}}

===== Weighted Random Effects (WRFx, WLS) =====
{{{
cd group-sm-gamma-fwhm5-tut/odd-v-0
mri_glmfit --y tal.ces.nii --osgm --wls tal.cesvar.nii\
  --glmdir glm.wrfx.tal.ces
tkmedit fsaverage orig.mgz -overlay glm.rfx.tal.ces/osgm/sig.mgh
}}}

===== Fixed Effects (FFx) =====
{{{
cd group-sm-gamma-fwhm5-tut/odd-v-0
mri_glmfit --y tal.ces.nii --osgm --yffxvar tal.cesvar.nii 1570 \
  --glmdir glm.ffx.tal.ces 
}}}

===== Output and visualization =====
{{{
cd group-sm-gamma-fwhm5-tut/odd-v-0
mri_concat glm.rfx.tal.ces/osgm/sig.mgh \
           glm.wrfx.tal.ces/osgm/sig.mgh \
           glm.ffx.tal.ces/osgm/sig.mgh \
           --o all.sig.nii
tkmedit fsaverage orig.mgz -aux brain.mgz -bc-main-fsavg \
   -overlay all.sig.nii -fthresh 2 -fmax 4
}}}

===== Cluster Analysis =====
{{{
cd group-sm-gamma-fwhm5-tut/odd-v-0
mri_volcluster --in sig.mgh \
  --fwhm 4.041332 --thmin 2 --mask ../mask.mgh\
  --fsaverage --cwpvalthresh .1 \
  --sum sumcluster.dat --ocn ocn.cluster.mgh \
  --cwsig cwsig.cluster.mgh 
mri_volcluster --fwhmdat ../fwhm.dat --in sig.mgh --sum cluster.sum
--thmin 2 --out sig.cluster.nii --ocn ocn.cluster.nii --cwsig
cwsig.cluster.nii --mask ../mask.mgh --maskthresh .5 --fsaverage

}}}


=== Surface-based ===



= FsFast Tutorial SlideShow =

[[Navigation(slideshow)]]

 * ["/000 Frontmatter"]
 * ["/300 Download data"]
 * ["/400 Get familiar with sessions format"]
 * ["/500 Make a directory for your study"]
 * ["/600 Make paradigm files for your experiment"]
 * ["/700 Motion correct the data"]
 * ["/800 Normalize signal intensity"]
 * ["/900 Set up session-level analysis"]
 * ["/905 Average session-level data by condition"]
 * ["/910 Define an omnibus contrast"]
 * ["/920 Compute statistical maps of the omnibus contrast"]
 * ["/930 Run functional and structural registration"]
 * ["/940 Visualization"]

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.