This module contains several utiility functions to perform GLM on datasets that are organized according to the layout chosen in brainvisa. It is thus assumed that: 1. within a certain ‘base_path’ directory(*),
there are directories named with a certain session_id, that contain the fMRI data ready to analyse
Based on this architecture, the module conatins functionalities to - estimate the design matrix - load the data - estimate the linear model - estimate contrasts related to the linear model - write output imges - write an html page that summarizes the results
Note that contrast specification relied on the contrast_tools module
Author : Lise Favre, Bertrand Thirion, 2008-2010
Contrast computation utility
Parameters : | contrast_struct, ConfigObj instance or string :
misc: misc object instance, :
Complete_Paths: dictionary or string, :
glms, dictionary of nipy.neurospin.glm.glm.glm instances :
model=’default’, string, :
|
---|
Estimation of the design matrix and update of misc info
Parameters : | misc_file: string, :
output_file: string, :
session: string, :
paradigm_file: string, :
concerning the following parameters, please refer to : nipy.neurospin.utils.design_matrix : |
---|---|
Returns : | dmtx: nipy.neurospin.utils.design_matrix.DesignMatrix :
|
This function returns a dictionary with all the paths of all the paths where something id read or written in a standard GLM. The hard-coded paths reflect brainvisa database conventions. Additionally, this creates the missing output directories.
Parameters : | base_path: string, :
sessions: list of strings :
fmri_wc: string, :
model_id: string, :
misc_id: string, optional :
mask_id: string, optional :
paradigm_id: string, optional :
contrast_id: string, optional :
design_id: string, optional :
glm_dump: string, optional, :
glm_config: string, optional, :
|
---|---|
Returns : | paths, dictionary :
|
This function generate standard output paths for all the contrasts and arranges them in a dictionary
Parameters : | output_dir_path: string, :
contrasts: ConfigObj instance, :
z_file: bool, optional :
stat_file: bool, optional :
con_file: bool, optional, :
res_file: bool, optional :
html_file: bool, optional, :
|
---|
Call the GLM Fit function with apropriate arguments
Parameters : | fMRI_path: string or list of strings, :
design_matrix: DesignMatrix instance, :
output_glm: string, optional :
glm_info: string,optional :
fit: string, Optional, :
mask_url: string, Optional, :
data_scaling: bool, Optional :
|
---|---|
Returns : | glm, a nipy.neurospin.glm.glm instance representing the GLM : |
Return an array of image data masked by mask data
Parameters : | image_path string or list of strings :
mask_path=None: string that yields the mask path : |
---|---|
Returns : | image_data a data array that can be 1, 2, 3 or 4D :
|
Parameters : | contrast a structure describing :
ContrastId, string, the contrast identifier : dim the dimension of the contrast : mask_url path of the mask image related to the data : kargs, might have ‘z_file’, ‘stat_file’, ‘con_file’, ‘res_file’, ‘html_file’ :
|
---|
volume saving utility for masked volumes
Parameters : | shape, tupe of dimensions of the data : path, string, output image path : affine, transformation of the grid to a coordinate system : mask=None, binary mask used to reduce the volume size : data=None data to be put in the volume : descrip=None, a string descibing what the image is : |
---|
volume saving utility for masked volumes
Parameters : | path, string, output image path : mask_image, string, :
data=None data to be put in the volume : descrip=None, a string descibing what the image is : |
---|