class_docstr: Determines if stimuli are correlated with motion or intensity
  parameters.
  
  Currently this class supports an SPM generated design matrix and requires
  intensity parameters. This implies that one must run
  :ref:`ArtifactDetect <nipype.algorithms.rapidart.ArtifactDetect>`
  and :ref:`Level1Design <nipype.interfaces.spm.model.Level1Design>` prior to
  running this or provide an SPM.mat file and intensity parameters through
  some other means.
  
  Examples
  --------
  
  >>> sc = StimulusCorrelation()
  >>> sc.inputs.realignment_parameters = 'functional.par'
  >>> sc.inputs.intensity_values = 'functional.rms'
  >>> sc.inputs.spm_mat_file = 'SPM.mat'
  >>> sc.inputs.concatenated_design = False
  >>> sc.run() # doctest: +SKIP
class_docstr_tok: ["Determines","if","stimuli","are","correlated","with","motion","or","intensity","parameters",".","Currently","this","class","supports","an","SPM","generated","design","matrix","and","requires","intensity","parameters",".","This","implies","that","one","must","run",":","ref",":","`","ArtifactDetect","<","nipype.algorithms.rapidart.ArtifactDetect",">","`","and",":","ref",":","`","Level1Design","<","nipype.interfaces.spm.model.Level1Design",">","`","prior","to","running","this","or","provide","an","SPM.mat","file","and","intensity","parameters","through","some","other","means",".","Examples","--","--","--","--",">",">",">","sc","=","StimulusCorrelation","(",")",">",">",">","sc.inputs.realignment_parameters","=","'functional.par'",">",">",">","sc.inputs.intensity_values","=","'functional.rms'",">",">",">","sc.inputs.spm_mat_file","=","'SPM.mat'",">",">",">","sc.inputs.concatenated_design","=","False",">",">",">","sc.run","(",")","#","doctest",":","+SKIP"]
docstr: Execute this module.
docstr_tok: ["Execute","this","module","."]
code: def _run_interface(self, runtime):
      """Execute this module."""
      import scipy.io as sio
  
      motparamlist = self.inputs.realignment_parameters
      intensityfiles = self.inputs.intensity_values
      spmmat = sio.loadmat(
          self.inputs.spm_mat_file, struct_as_record=False
      )
      nrows = []
      for i in range(len(motparamlist)):
          sessidx = i
          rows = None
          if self.inputs.concatenated_design:
              sessidx = 0
              mc_in = np.loadtxt(motparamlist[i])
              rows = np.sum(nrows) + np.arange(mc_in.shape[0])
              nrows.append(mc_in.shape[0])
          matrix = self._get_spm_submatrix(spmmat, sessidx, rows)
          self._stimcorr_core(
              motparamlist[i], intensityfiles[i], matrix, os.getcwd()
          )
      return runtime
  
imports: import os
  from copy import deepcopy
  from nibabel import load, funcs, Nifti1Image
  import numpy
  from ..interfaces.base import BaseInterface, traits, InputMultiPath, OutputMultiPath, TraitedSpec, File, BaseInterfaceInputSpec, isdefined
  from ..utils.filemanip import ensure_list, save_json, split_filename
  from ..utils.misc import find_indices, normalize_mc_params
  from ..None import logging, config
label_desc: Use image node_id 4 for calling the StimulusCorrelation obj's underlying member method code with example usage: obj._run_interface(runtime) and returns: runtime