code: def get_numpy_type(dicom_header):
      
  
      format_string = '%sint%d' % (('u', '')[dicom_header.PixelRepresentation], dicom_header.BitsAllocated)
      try:
          numpy.dtype(format_string)
      except TypeError:
          raise TypeError("Data type not understood by NumPy: format='%s', PixelRepresentation=%d, BitsAllocated=%d" %
                          (format_string, dicom_header.PixelRepresentation, dicom_header.BitsAllocated))
      return format_string
docs: Make NumPy format code, e.g. "uint16", "int32" etc
      from two pieces of info:
      mosaic.PixelRepresentation -- 0 for unsigned, 1 for signed;
      mosaic.BitsAllocated -- 8, 16, or 32
  
      :param dicom_header: the read dicom file/headers
      :returns: numpy format string