docs: def parse_vector(x, dtype=None):
      """Parse NRRD vector from string into (N,) :class:`numpy.ndarray`.
  
      See :ref:`user-guide:int vector` and :ref:`user-guide:double vector` for more information on the format.
  
      Parameters
      ----------
      x : :class:`str`
          String containing NRRD vector
      dtype : data-type, optional
          Datatype to use for the resulting Numpy array. Datatype can be :class:`float`, :class:`int` or :obj:`None`. If
          :obj:`dtype` is :obj:`None`, then it will be automatically determined by checking any of the vector elements
          for fractional numbers. If found, then the vector will be converted to :class:`float`, otherwise :class:`int`.
          Default is to automatically determine datatype.
  
      Returns
      -------
      vector : (N,) :class:`numpy.ndarray`
          Vector that is parsed from the :obj:`x` string
      """
  
      if x[0] != '(' or x[-1] != ')':
          raise NRRDError('Vector should be enclosed by parentheses.')
  
      # Always convert to float and then truncate to integer if desired
      # The reason why is parsing a floating point string to int will fail (i.e. int('25.1') will fail)
      vector = np.array([float(x) for x in x[1:-1].split(',')])
  
      # If using automatic datatype detection, then start by converting to float and determining if the number is whole
      # Truncate to integer if dtype is int also
      if dtype is None:
          vector_trunc = vector.astype(int)
  
          if np.all((vector - vector_trunc) == 0):
              vector = vector_trunc
      elif dtype == int:
          vector = vector.astype(int)
      elif dtype != float:
          raise NRRDError('dtype should be None for automatic type detection, float or int')
  
      return vector