Inheritance diagram for nipy.modalities.fmri.fmristat.model:
This module defines the two default GLM passes of fmristat
The results of both passes of the GLM get pushed around by generators, which know how to get out the (probably 3D) data for each slice, or parcel (for the AR) case, estimate in 2D, then store the data back again in its original shape.
The containers here, in the execute methods, know how to reshape the data on the way into the estimation (to 2D), then back again, to 3D, or 4D.
It’s relatively easy to do this when just iterating over simple slices, but it gets a bit more complicated when taking arbitrary shaped samples from the image, as we do for estimating the AR coefficients, where we take all the voxels with similar AR coefficients at once.
Bases: object
Second pass through fmri_image.
Parameters: | fmri_image : FmriImageList
formula : nipy.algorithms.statistics.formula.Formula rho : Image
outputs : : volume_start_times : : |
---|
Methods
execute() |
Bases: object
These images have their values filled in as the model is fit, and are saved to disk after being completely filled in.
They are saved to disk by calling the ‘save’ method.
The __getitem__ and __setitem__ calls are delegated to a private Image. An exception is raised if trying to get/set data after the data has been saved to disk.
Methods
save() | Save current Image data to disk |
Save current Image data to disk
Bases: object
First pass through fmri_image.
Parameters: | fmri_image : FmriImageList or 4D image
formula : nipy.algorithms.statistics.formula.Formula outputs : : volume_start_times : : |
---|
Methods
execute() |
Estimate AR parameters using bias correction from fMRIstat.
Parameters: | resid: array-like :
model: an OLS model used to estimate residuals : |
---|---|
Returns: | output : array
|
Write out results of a given output.
In the regression setting, results is generally going to be a scipy.stats.models.model.LikelihoodModelResults instance.
Parameters: | outputs : sequence
iterable : object
reshape : callable
|
---|
Generator for the models for a pass of fmristat analysis.
Create an output file of the AR1 parameter from the OLS pass of fmristat.
Parameters: | outfile : : fmri_image : FmriImageList or 4D image
clobber : bool
|
---|---|
Returns: | regression_output : RegressionOutput instance |
output F statistic images
Parameters: | outfile : str
contrast : array
fmri_image : FmriImageList or Image
clobber : bool
|
---|---|
Returns: | f_reg_out : RegressionOutput instance
|
Return t contrast regression outputs list for contrast
Parameters: | outbase : string
contrast : array
fmri_image : FmriImageList or Image
effect : {True, False}, optional
sd : {True, False}, optional
t : {True, False}, optional
clobber : {False, True}, optional
|
---|---|
Returns: | reglist : RegressionOutputList instance
|
Notes
Note that this routine uses the corresponding output_T routine in outputters, but indirectly via the TOutput object.
Create an output file of the residuals parameter from the OLS pass of fmristat.
Uses affine part of the first image to output resids unless fmri_image is an Image.
Parameters: | outfile : : fmri_image : FmriImageList or 4D image
clobber : bool
|
---|---|
Returns: | regression_output : : |
Generator for results from an iterator that returns (index, data, model) tuples.
See model_generator.