Skip to content

API proposal/discussion: make hrdic.Map.__getitem__ work like a dictionary instead of a list #102

@jni

Description

@jni

Currently, the indices to get grains out of hrdic.Map are off by one relative to the integer IDs in the hrdic.Map.grains image. That is, hrdic.Map[0] gets the grain that has value 1 in the image, hrdic.Map[1] gets the grain with value 2, and so on. (And this might be incorrect if the grains array has non-contiguous labels, not sure.) This is confusing! I understand that this is perhaps inherited from or inspired by skimage.measure.regionprops, but over there we regret that API choice and will probably move to a dictionary-like API with the label as the key in a later version.

Would there be interest in taking the same approach here?

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