How to use the tifffile.tifffile.asbool function in tifffile

To help you get started, we’ve selected a few tifffile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github macronucleus / Chromagnon / Chromagnon / imgio / multitifIO.py View on Github external
def astype(value):
    if isinstance(value, six.string_types) and (value[0].isdigit() or value[-1].isdigit()):
        if value.isdigit():
            return int(value)
        else:
            try:
                return float(value)
            except:
                try:
                    return tifff.asbool(value)
                except:
                    return value
    else:
        try:
            return tifff.asbool(value)
        except:
            return value
github macronucleus / Chromagnon / Chromagnon / imgio / multitifIO.py View on Github external
def astype(value):
    if isinstance(value, six.string_types) and (value[0].isdigit() or value[-1].isdigit()):
        if value.isdigit():
            return int(value)
        else:
            try:
                return float(value)
            except:
                try:
                    return tifff.asbool(value)
                except:
                    return value
    else:
        try:
            return tifff.asbool(value)
        except:
            return value