示例#1
0
    def understand(image_file):
        """Check to see if this looks like an TIFF format image, i.e. we can
        make sense of it."""

        try:
            read_basic_tiff_header(image_file)
            return True

        except Exception:
            pass

        return False
示例#2
0
def get_tiff_header(image_file):
    width, height, depth, header, order = read_basic_tiff_header(image_file)

    with open(image_file, "rb") as fh:
        header_bytes = fh.read(header)

    return width, height, depth // 8, order, header_bytes
def get_tiff_header(image_file):
    from dxtbx.format.FormatTIFFHelpers import read_basic_tiff_header
    width, height, depth, header, order = read_basic_tiff_header(image_file)

    header_bytes = open(image_file, 'rb').read(header)

    return width, height, depth // 8, order, header_bytes
示例#4
0
    def understand(image_file):
        """Check to see if this looks like a TIFF format image of the type
        expected from the DE detector"""

        btf = read_basic_tiff_header(image_file)
        if btf[3] is None:
            return True
        return False
  def get_tiff_header(image_file):
    '''Pun to get to the image header etc.'''

    width, height, depth, header, order = read_basic_tiff_header(
        image_file)

    header_bytes = FormatTIFF.open_file(image_file, 'rb').read(header)

    return width, height, depth // 8, order, header_bytes
    def get_tiff_header(image_file):
        """Pun to get to the image header etc."""

        width, height, depth, header, order = read_basic_tiff_header(
            image_file)

        header_bytes = FormatTIFF.open_file(image_file, "rb").read(header)

        return width, height, depth // 8, order, header_bytes
  def understand(image_file):
    '''Check to see if this looks like an TIFF format image, i.e. we can
    make sense of it.'''

    try:
      width, height, depth, header, order = read_basic_tiff_header(
          image_file)
      return True

    except: # intentional
      pass

    return False
    def _start(self):
        """Open the image file, read the image header, copy it into memory
        for future inspection."""

        width, height, depth, header, order = read_basic_tiff_header(
            self._image_file)

        self._tiff_width = width
        self._tiff_height = height
        self._tiff_depth = depth // 8
        self._tiff_header_bytes = FormatTIFF.open_file(self._image_file,
                                                       "rb").read(header)
        self._tiff_byte_order = order
示例#9
0
    def understand(image_file):
        '''Check to see if this looks like an TIFF format image, i.e. we can
    make sense of it.'''

        try:
            width, height, depth, header, order = read_basic_tiff_header(
                image_file)
            return True

        except:  # intentional
            pass

        return False
示例#10
0
  def _start(self):
    '''Open the image file, read the image header, copy it into memory
    for future inspection.'''

    width, height, depth, header, order = read_basic_tiff_header(
        self._image_file)

    self._tiff_width = width
    self._tiff_height = height
    self._tiff_depth = depth // 8
    self._tiff_header_bytes = FormatTIFF.open_file(
        self._image_file, 'rb').read(header)
    self._tiff_byte_order = order

    return
    def understand(image_file):
        """Check to see if this looks like an TIFF format image, i.e. we can
        make sense of it."""

        return bool(read_basic_tiff_header(image_file))