Skip to content

Image reader read_region returns read-only np.ndarray #837

@ziyuanzhao2000

Description

@ziyuanzhao2000
  • TIA Toolbox version: 1.5.1
  • Python version: 3.9
  • Operating System:

Description

This is more like a question rather than reporting a bug.

I wonder if there's any reason that read_region and similar methods seem to return a read-only array? I understand that it might be for avoiding accidental tampering with research data, but it seems inefficient to have to copy the array, for example, to use the stain normalizers (like Vahadane) on the image.

For example, this excerpt

stain_normalizer = stainnorm.VahadaneNormalizer()
stain_normalizer.fit(target_image)

normed_sample = stain_normalizer.transform(sample.copy())

is from the stain normalizer notebook. I wonder if it's possible to load images with read-write access on the array, so we don't have to do that copy. Thanks for hearing out this suggestion!

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