docs: def get_positions(elinfo, center=True):
      '''Computes the positions of the elctrodes based on the elinfo
  
      Parameters
      ----------
      elinfo: dict
          Contains electrode information from yaml file (dim, pitch, sortlist, plane, pos)
  
      Returns
      -------
      positions: np.array
          3d points with the centers of the electrodes
  
      '''
      electrode_pos = False
      # method 1: positions in elinfo
      if 'pos' in elinfo.keys():
          pos = np.array(elinfo['pos'])
          nelec = pos.shape[0]
          if len(pos.shape) == 1:
              if len(pos) == 2:
                  pos2d = np.array([pos])
                  if 'plane' not in elinfo.keys():
                      # print("'plane' field with 2D dimensions assumed to be 'yz")
                      plane = 'yz'
                  else:
                      plane = elinfo['plane']
                  if 'offset' not in elinfo.keys():
                      offset = 0
                  else:
                      offset = elinfo['offset']
                  pos = add_3dim(pos2d, plane, offset)
              elif len(pos) == 3:
                  pos = np.array([pos])
              elif len(pos) != 3:
                  raise AttributeError('pos attribute should be one or a list of 2D or 3D points')
          elif len(pos.shape) == 2:
              if pos.shape[1] == 2:
                  pos2d = pos
                  if 'plane' not in elinfo.keys():
                      # print("'plane' field with 2D dimensions assumed to be 'yz")
                      plane = 'yz'
                  else:
                      plane = elinfo['plane']
                  if 'offset' not in elinfo.keys():
                      offset = 0
                  else:
                      offset = elinfo['offset']
                  pos = add_3dim(pos2d, plane, offset)
              elif pos.shape[1] != 3:
                  raise AttributeError('pos attribute should be a list of 2D or 3D points')
          electrode_pos = True
  
      # method 2: dim, pithch, stagger
      if 'dim' in elinfo.keys():
          dim = elinfo['dim']
          if dim == 1:
              if 'plane' not in elinfo.keys():
                  # print("'plane' field with 2D dimensions assumed to be 'yz")
                  plane = 'yz'
              else:
                  plane = elinfo['plane']
              if 'offset' not in elinfo.keys():
                  offset = 0
              else:
                  offset = elinfo['offset']
              pos2d = np.array([[0, 0]])
              pos = add_3dim(pos2d, plane, offset)
          else:
              if 'pitch' not in elinfo.keys():
                  raise AttributeError("When 'dim' is used, also 'pitch' should be specified.")
              else:
                  pitch = elinfo['pitch']
  
              if isinstance(dim, (int, np.integer)):
                  dim = [dim, dim]
              if isinstance(pitch, (int, np.integer)) or isinstance(pitch, (float, np.float)):
                  pitch = [pitch, pitch]
              if len(dim) == 2:
                  d1 = np.array([])
                  d2 = np.array([])
                  if 'stagger' in elinfo.keys():
                      stagger = elinfo['stagger']
                  else:
                      stagger = None
                  for d_i in np.arange(dim[1]):
                      if stagger is not None:
                          if isinstance(stagger, (int, np.integer)) or isinstance(stagger, (float, np.float)):
                              if np.mod(d_i, 2):
                                  d1new = np.arange(dim[0]) * pitch[0] + stagger
                              else:
                                  d1new = np.arange(dim[0]) * pitch[0]
                          elif len(stagger) == len(dim):
                              d1new = np.arange(dim[0]) * pitch[0] + stagger[d_i]
                          else:
                              d1new = np.arange(dim[0]) * pitch[0]
                      else:
                          d1new = np.arange(dim[0]) * pitch[0]
                      d1 = np.concatenate((d1, d1new))
                      d2 = np.concatenate((d2, dim[0] * [pitch[1] * d_i]))
                  pos2d = np.vstack((d2, d1)).T
                  if 'plane' not in elinfo.keys():
                      # print("'plane' field with 2D dimensions assumed to be 'yz")
                      plane = 'yz'
                  else:
                      plane = elinfo['plane']
                  if 'offset' not in elinfo.keys():
                      offset = 0
                  else:
                      offset = elinfo['offset']
                  pos2d = np.concatenate((np.reshape(d2.T, (d1.size, 1)),
                                          np.reshape(d1.T, (d2.size, 1))), axis=1)
                  pos = add_3dim(pos2d, plane, offset)
  
              elif len(dim) >= 3:
                  d1 = np.array([])
                  d2 = np.array([])
                  if 'stagger' in elinfo.keys():
                      stagger = elinfo['stagger']
                  else:
                      stagger = None
                  for d_i, d in enumerate(dim):
                      if stagger is not None:
                          if isinstance(stagger, (int, np.integer)) or isinstance(stagger, (float, np.float)):
                              if np.mod(d_i, 2):
                                  d1new = np.arange(d) * pitch[0] + stagger
                              else:
                                  d1new = np.arange(d) * pitch[0]
                          elif len(stagger) == len(dim):
                              d1new = np.arange(d) * pitch[0] + stagger[d_i]
                          else:
                              d1new = np.arange(d) * pitch[0]
                      else:
                          d1new = np.arange(d) * pitch[0]
                      d1 = np.concatenate((d1, d1new))
                      d2 = np.concatenate((d2, d * [pitch[1] * d_i]))
                  pos2d = np.vstack((d2, d1)).T
                  if 'plane' not in elinfo.keys():
                      # print("'plane' field with 2D dimensions assumed to be 'yz")
                      plane = 'yz'
                  else:
                      plane = elinfo['plane']
                  if 'offset' not in elinfo.keys():
                      offset = 0
                  else:
                      offset = elinfo['offset']
                  pos = add_3dim(pos2d, plane, offset)
          electrode_pos = True
  
      if electrode_pos and center:
          centered_pos = center_mea(pos)
          # resort electrodes in case
          centered_pos_sorted = copy.deepcopy(centered_pos)
          if 'sortlist' in elinfo.keys() and elinfo['sortlist'] is not None:
              sortlist = elinfo['sortlist']
              for i, si in enumerate(sortlist):
                  centered_pos_sorted[si] = centered_pos[i]
          else:
              centered_pos_sorted = centered_pos
          return centered_pos_sorted
      elif electrode_pos and not center:
          # resort electrodes in case
          pos_sorted = copy.deepcopy(pos)
          if 'sortlist' in elinfo.keys() and elinfo['sortlist'] is not None:
              sortlist = elinfo['sortlist']
              for i, si in enumerate(sortlist):
                  pos_sorted[si] = pos[i]
          else:
              pos_sorted = pos
          return pos_sorted
      else:
          print("Define either a list of positions 'pos' or 'dim' and 'pitch'")
          return None