class_docstr: Parameters
  ----------
  fmri_image : `FmriImageList`
     object returning 4D array from ``np.asarray``, having attribute
     ``volume_start_times`` (if `volume_start_times` is None), and
     such that ``object[0]`` returns something with attributes ``shape``
  formula :  :class:`nipy.algorithms.statistics.formula.Formula`
  sigma :
  outputs :
  volume_start_times :
class_docstr_tok: ["Parameters","--","--","--","--","--","fmri_image",":","`","FmriImageList","`","object","returning","4D","array","from","``","np.asarray","``",",","having","attribute","``","volume_start_times","``","(","if","`","volume_start_times","`","is","None",")",",","and","such","that","``","object","[","0","]","``","returns","something","with","attributes","``","shape","``","formula",":",":","class",":","`","nipy.algorithms.statistics.formula.Formula","`","sigma",":","outputs",":","volume_start_times",":"]
code: def execute(self):
      def model_params(*args):
          return (self.sigma,)
  
      m = fmristat.model_generator(
          self.formula,
          self.data,
          self.volume_start_times,
          model_type=GLSModel,
          model_params=model_params,
      )
      r = fmristat.results_generator(m)
  
      def reshape(i, x):
          """
          To write output, arrays have to be reshaped --
          this function does the appropriate reshaping for the two
          passes of fMRIstat.
  
          These passes are i) 'slices through the z-axis'
                          ii) 'parcels of approximately constant AR1 coefficient'
          """
  
          if len(x.shape) == 2:
              if type(i) is int:
                  x.shape = (x.shape[0],) + self.fmri_image[0].shape[1:]
              if type(i) not in [type([]), type(())]:
                  i = (i,)
              else:
                  i = tuple(i)
              i = (slice(None, None, None),) + tuple(i)
          else:
              if type(i) is int:
                  x.shape = self.fmri_image[0].shape[1:]
          return i, x
  
      o = fmristat.generate_output(self.outputs, r, reshape=reshape)
  
file_path: nipy/nipy/modalities/fmri/spm/model.py
imports: import numpy
  import numpy.linalg
  from scipy.stats import f
  from nipy.algorithms.statistics.models.regression import GLSModel, OLSModel
  from nipy.core.api import Image
  from nipy.modalities.fmri.fmristat import model
  from nipy.modalities.fmri.fmristat.model import OLS
  from .None import correlation, reml
label_desc: Use image node_id 2 for calling the SecondStage obj's underlying member method code with example usage: obj.execute() and returns: self, i,  x