Skip to content

Should we apply scale/offset to statistics? #811

@vincentsarago

Description

@vincentsarago

stats = []
for ix in indexes:
tags = dataset.tags(ix)
if all(stat in tags for stat in ["STATISTICS_MINIMUM", "STATISTICS_MAXIMUM"]):
stat_min = float(tags.get("STATISTICS_MINIMUM"))
stat_max = float(tags.get("STATISTICS_MAXIMUM"))
stats.append((stat_min, stat_max))

We allow users to apply scale/offset when reading the data (with unscale=True option), if present in the metadata, the stats will be forwarded to the ImageData object, if scale/offset was applied then the statistics won't make sense.

This is True if we assume the stats are computed with the raw pixel values, not with scale/offset applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions