FFF library and its objects
(Guys - that name! - will you please fff-change it!).
Please see the main fff page for more background.
For now, please see the fff doxygen pages.
fMRI Model
Some notes by Benjamin
This is how we do in fff now for the GLM object. Conditions:
append_discrete_condition(self, time, duration=[], value=[], hrf_kernel=None):
time : list or array of time onsets
duration : corresponding array of durations; if left unspecified, durations
are set to zero, which amounts to assuming an event-related condition
value : corresponding array of onset values, in order to model variable
response magnitudes; by default, a constant magnitude equal to one is
assumed for all onsets
hrf_kernel: if different from None, the signal will be convolved with the
appropriate kernel
append_continuous_condition(value, dt, hrf_kernel=None, t0=0.0):
t0 : starting observation time relative to the conditions' time origin
(values outside the time observation range may be extrapolated)
Stored as a dictionary. The conditions() method indeed shows stuffs like:
[{'duration': array([ 0.3, 0. , 0. , 0. , 0. , 0. ]),
'hrf_kernel': 0,
'time': array([ 1., 2., 3., 4., 5., 6.]),
'type': 'discrete',
'value': array([ 1., 0., 0., 0., 0., 0.])}, ..for all conditions
import_design_matrix: Import a set of externally defined regressors and
append them as continuous conditions.
design_matrix(self, t): Compute the design matrix sampled at specified time
points. Usually, t is the vector of timestamps which match the datas
acquisition times, but you might pass lower resolution timestamp vector for
pre-visualisation purpose, for example...
Those are global (ie. not per-conditions) parameters:
Noise Model Drift Poly Order
Fitting process:
fit_data(self, Y, Msk=None, Cmat=None)) : compute the glm, Y are the data.
Cmat are an optional contrast numeric vector.
=> Output : a list [B, VB, dof, A]
B : image of (contrasted) effect estimates
VB : image of corresponding covariance matrices
dof : (scalar) overall estimate of the degrees of freedom
A : noise autocorrelation image
TODO: see how Brainstats objects do on that. Ideally we should steal them or merge with them.
