code: def make_dmtx(
      frametimes,
      paradigm=None,
      hrf_model="canonical",
      drift_model="cosine",
      hfcut=128,
      drift_order=1,
      fir_delays=[0],
      add_regs=None,
      add_reg_names=None,
      min_onset=-24,
  ):
      """Generate a design matrix from the input parameters
  
      Parameters
      ----------
      frametimes: array of shape(nbframes), the timing of the scans
      paradigm: Paradigm instance, optional
                description of the experimental paradigm
      hrf_model: string, optional,
                 that specifies the hemodynamic response function.
                 Can be one of {'canonical', 'canonical with derivative',
                 'fir', 'spm', 'spm_time', 'spm_time_dispersion'}.
      drift_model: string, optional
                   specifies the desired drift model,
                   to be chosen among 'polynomial', 'cosine', 'blank'
      hfcut: float, optional
             cut period of the low-pass filter
      drift_order: int, optional
                   order of the drift model (in case it is polynomial)
      fir_delays: array of shape(nb_onsets) or list, optional,
                  in case of FIR design, yields the array of delays
                  used in the FIR model
      add_regs: array of shape(nbframes, naddreg), optional
                additional user-supplied regressors
      add_reg_names: list of (naddreg) regressor names, optional
                     if None, while naddreg>0, these will be termed
                     'reg_%i',i=0..naddreg-1
      min_onset: float, optional
          minimal onset relative to frametimes[0] (in seconds)
          events that start before frametimes[0] + min_onset are not considered
  
      Returns
      -------
      DesignMatrix instance
      """
      # check arguments
      frametimes = np.asarray(frametimes, dtype=np.float64)
  
      # check that additional regressor specification is correct
      n_add_regs = 0
      if add_regs is not None:
          if add_regs.shape[0] == np.size(add_regs):
              add_regs = np.reshape(add_regs, (np.size(add_regs), 1))
          n_add_regs = add_regs.shape[1]
          assert add_regs.shape[0] == np.size(frametimes), ValueError(
              "incorrect specification of additional regressors: "
              f"length of regressors provided: {add_regs.shape[0]}, number of "
              f"time-frames: {np.size(frametimes)}"
          )
  
      # check that additional regressor names are well specified
      if add_reg_names is None:
          add_reg_names = ["reg%d" % k for k in range(n_add_regs)]
      elif len(add_reg_names) != n_add_regs:
          raise ValueError(
              "Incorrect number of additional regressor names was provided"
              "(%s provided, %s expected) % (len(add_reg_names),"
              "n_add_regs)"
          )
  
      # computation of the matrix
      names = []
      matrix = np.zeros((frametimes.size, 0))
  
      # step 1: paradigm-related regressors
      if paradigm is not None:
          # create the condition-related regressors
          matrix, names = _convolve_regressors(
              paradigm,
              hrf_model.lower(),
              frametimes,
              fir_delays,
              min_onset,
          )
  
      # step 2: additional regressors
      if add_regs is not None:
          # add user-supplied regressors and corresponding names
          matrix = np.hstack((matrix, add_regs))
          names += add_reg_names
  
      # setp 3: drifts
      drift, dnames = _make_drift(
          drift_model.lower(), frametimes, drift_order, hfcut
      )
      matrix = np.hstack((matrix, drift))
      names += dnames
  
      # step 4: Force the design matrix to be full rank at working precision
      matrix, _ = _full_rank(matrix)
  
      # complete the names with the drift terms
      return DesignMatrix(matrix, names, frametimes)
  
file_path: nipy/nipy/modalities/fmri/design_matrix.py
imports: from warnings import warn
  import numpy
  from .hemodynamic_models import _orthogonalize, compute_regressor
label_desc: Use image node_id 7 for calling a global function with example usage: make_dmtx(frametimes, paradigm, hrf_model, drift_model, hfcut, drift_order, fir_delays, add_regs, add_reg_names, min_onset) and returns: DesignMatrix