modalities.fmri.design_matrix¶
Class¶
DesignMatrix
¶
-
class
nipy.modalities.fmri.design_matrix.
DesignMatrix
(matrix, names, frametimes=None)¶ This is a container for a light-weight class for design matrices This class is only used to make IO and visualization
Methods
show
([rescale, ax])Visualization of a design matrix write_csv
(path)write self.matrix as a csv file with appropriate column names -
__init__
(matrix, names, frametimes=None)¶
-
show
(rescale=True, ax=None)¶ Visualization of a design matrix
Parameters: rescale: bool, optional :
rescale columns magnitude for visualization or not
ax: axis handle, optional :
Handle to axis onto which we will draw design matrix
Returns: ax: axis handle :
-
write_csv
(path)¶ write self.matrix as a csv file with appropriate column names
Parameters: path: string, path of the resulting csv file : Notes
The frametimes are not written
-
Functions¶
-
nipy.modalities.fmri.design_matrix.
dmtx_from_csv
(path, frametimes=None)¶ Return a DesignMatrix instance from a csv file
Parameters: path: string, path of the .csv file : Returns: A DesignMatrix instance :
-
nipy.modalities.fmri.design_matrix.
dmtx_light
(frametimes, paradigm=None, hrf_model='canonical', drift_model='cosine', hfcut=128, drift_order=1, fir_delays=[0], add_regs=None, add_reg_names=None, min_onset=-24, path=None)¶ Make a design matrix while avoiding framework
Parameters: see make_dmtx, plus :
path: string, optional: a path to write the output :
Returns: dmtx array of shape(nreg, nbframes): :
the sampled design matrix
names list of strings of len (nreg) :
the names of the columns of the design matrix
-
nipy.modalities.fmri.design_matrix.
make_dmtx
(frametimes, paradigm=None, hrf_model='canonical', drift_model='cosine', hfcut=128, drift_order=1, fir_delays=[0], add_regs=None, add_reg_names=None, min_onset=-24)¶ Generate a design matrix from the input parameters
Parameters: frametimes: array of shape(nbframes), the timing of the scans :
paradigm: Paradigm instance, optional :
description of the experimental paradigm
hrf_model: string, optional, :
that specifies the hemodynamic response function. Can be one of {‘canonical’, ‘canonical with derivative’, ‘fir’, ‘spm’, ‘spm_time’, ‘spm_time_dispersion’}.
drift_model: string, optional :
specifies the desired drift model, to be chosen among ‘polynomial’, ‘cosine’, ‘blank’
hfcut: float, optional :
cut frequency of the low-pass filter
drift_order: int, optional :
order of the drift model (in case it is polynomial)
fir_delays: array of shape(nb_onsets) or list, optional, :
in case of FIR design, yields the array of delays used in the FIR model
add_regs: array of shape(nbframes, naddreg), optional :
additional user-supplied regressors
add_reg_names: list of (naddreg) regressor names, optional :
if None, while naddreg>0, these will be termed ‘reg_%i’,i=0..naddreg-1
min_onset: float, optional :
minimal onset relative to frametimes[0] (in seconds) events that start before frametimes[0] + min_onset are not considered
Returns: DesignMatrix instance :