docs: def _determine_datatype(fields):
      """Determine the numpy dtype of the data."""
  
      # Convert the NRRD type string identifier into a NumPy string identifier using a map
      np_typestring = _TYPEMAP_NRRD2NUMPY[fields['type']]
  
      # This is only added if the datatype has more than one byte and is not using ASCII encoding
      # Note: Endian is not required for ASCII encoding
      if np.dtype(np_typestring).itemsize > 1 and fields['encoding'] not in ['ASCII', 'ascii', 'text', 'txt']:
          if 'endian' not in fields:
              raise NRRDError('Header is missing required field: "endian".')
          elif fields['endian'] == 'big':
              np_typestring = '>' + np_typestring
          elif fields['endian'] == 'little':
              np_typestring = '<' + np_typestring
          else:
              raise NRRDError('Invalid endian value in header: "%s"' % fields['endian'])
  
      return np.dtype(np_typestring)