# modalities.fmri.fmristat.outputters

## Module: `modalities.fmri.fmristat.outputters`

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

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)

  Bases: `object`

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

  __init__(img, fn, output_shape=None)
    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)

  Bases: `object`

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

  __init__(imgs, fn)

    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)

  Bases: `RegressionOutputList`

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

  __init__(contrast, effect=None, sd=None, t=None)

    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)

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

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

  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'))

  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)

  This convenience function outputs the residuals from a regression