modalities.fmri.fmristat.outputters

Module: modalities.fmri.fmristat.outputters

Inheritance diagram for nipy.modalities.fmri.fmristat.outputters:

digraph inheritance7a05f38b18 { rankdir=LR; size="8.0, 12.0"; "fmristat.outputters.RegressionOutput" [URL="#nipy.modalities.fmri.fmristat.outputters.RegressionOutput",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A class to output things in GLM passes through arrays of data."]; "fmristat.outputters.RegressionOutputList" [URL="#nipy.modalities.fmri.fmristat.outputters.RegressionOutputList",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A class to output more than one thing"]; "fmristat.outputters.TOutput" [URL="#nipy.modalities.fmri.fmristat.outputters.TOutput",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="Output contrast related to a T contrast from a GLM pass through data."]; "fmristat.outputters.RegressionOutputList" -> "fmristat.outputters.TOutput" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Convenience functions and classes for statistics on images.

These functions and classes support the return of statistical test results from iterations through data.

The basic container here is the RegressionOutput. This does two basic things:

  • via __call__, processes a result object from a regression to produce something, usually an array

  • via slicing (__setitem__), it can store stuff, usually arrays.

We use these by other objects (see algorithms.statistics.fmri.fmristat) slicing data out of images, fitting models to the data to create results objects, and then passing them to these here RegressionOutput containers via call, to get useful arrays, and then putting the results back into the RegressionOutput containers via slicing (__setitem__).

Classes

RegressionOutput

class nipy.modalities.fmri.fmristat.outputters.RegressionOutput(img, fn, output_shape=None)[source]

Bases: object

A class to output things in GLM passes through arrays of data.

__init__(img, fn, output_shape=None)[source]
Parameters

img : Image instance

The output Image

fn : callable

A function that is applied to a models.model.LikelihoodModelResults instance

RegressionOutputList

class nipy.modalities.fmri.fmristat.outputters.RegressionOutputList(imgs, fn)[source]

Bases: object

A class to output more than one thing from a GLM pass through arrays of data.

__init__(imgs, fn)[source]

Initialize regression output list

Parameters

imgs : list

The list of output images

fn : callable

A function that is applied to a models.model.LikelihoodModelResults instance

TOutput

class nipy.modalities.fmri.fmristat.outputters.TOutput(contrast, effect=None, sd=None, t=None)[source]

Bases: nipy.modalities.fmri.fmristat.outputters.RegressionOutputList

Output contrast related to a T contrast from a GLM pass through data.

__init__(contrast, effect=None, sd=None, t=None)[source]

Initialize regression output list

Parameters

imgs : list

The list of output images

fn : callable

A function that is applied to a models.model.LikelihoodModelResults instance

Functions

nipy.modalities.fmri.fmristat.outputters.output_AR1(results)[source]

Compute the usual AR(1) parameter on the residuals from a regression.

nipy.modalities.fmri.fmristat.outputters.output_F(results, contrast)[source]

This convenience function outputs the results of an Fcontrast from a regression

Parameters

results : object

implementing Tcontrast method

contrast : array

contrast matrix

Returns

F : array

array of F values

nipy.modalities.fmri.fmristat.outputters.output_T(results, contrast, retvals=('effect', 'sd', 't'))[source]

Convenience function to collect t contrast results

Parameters

results : object

implementing Tcontrast method

contrast : array

contrast matrix

retvals : sequence, optional

None or more of strings ‘effect’, ‘sd’, ‘t’, where the presence of the string means that that output will be returned.

Returns

res_list : list

List of results. It will have the same length as retvals and the elements will be in the same order as retvals

nipy.modalities.fmri.fmristat.outputters.output_resid(results)[source]

This convenience function outputs the residuals from a regression