code: def dmtx_from_csv(path, frametimes=None):
      """Return a DesignMatrix instance from  a csv file
  
      Parameters
      ----------
      path: string, path of the .csv file
  
      Returns
      -------
      A DesignMatrix instance
      """
      import csv
  
      with open(path, newline="") as csvfile:
          dialect = csv.Sniffer().sniff(csvfile.read())
          csvfile.seek(0)
          reader = csv.reader(csvfile, dialect)
          boolfirst = True
          design = []
          for row in reader:
              if boolfirst:
                  names = [row[j] for j in range(len(row))]
                  boolfirst = False
              else:
                  design.append([row[j] for j in range(len(row))])
      x = np.array([[float(t) for t in xr] for xr in design])
      return DesignMatrix(x, 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 8 for calling a global function with example usage: dmtx_from_csv(path, frametimes) and returns: DesignMatrix