Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotations made by HALO for mrxs slide are not read correctly due to limit bounds #160

Closed
moerlemans opened this issue Aug 1, 2023 · 7 comments
Assignees
Labels
bug Something isn't working Stale

Comments

@moerlemans
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.
When loading an mrxs slide with limit_bounds true and an annotation with the TiledROIDataset.from_standard_tiling. It will not produce the correct annotations, but annotations at an offset equal to the limit bounds as HALO annotations are apperently not taking limit bounds into account in their coordinates.

To Reproduce
A clear and concise description on how to reproduce the problem.
Load slide image and halo annotation using the WsiAnnotations.from_halo_xml and make a dataset using TiledROIsSlideImageDataset.from_standard_tiling with limit_bounds=True. Visualize to check.

Expected behavior
A clear and concise description of what you expected to happen.
Expect the annotations to be returned in the good coordinate system in which the images are as well.

Environment
dlup version: 0.3.25
How installed: pip install -e .
Python version: 3.10
Operating System:

Additional context
Add any other context about the problem here.

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the Stale label Oct 1, 2023
@jonasteuwen jonasteuwen removed the Stale label Oct 9, 2023
Copy link

github-actions bot commented Dec 9, 2023

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

@jonasteuwen
Copy link
Contributor

This is probably fixes, depends on upstream changes to pyhaloxml.

@rharkes
Copy link
Contributor

rharkes commented Jan 4, 2024

Not in this case. The offsets are in the .mrxs file and need to be used to translate all the annotations. We had the same problem in QuPath, where I tried to fix it for one of our users. It requires some way to get the values out of the .mrxs. This was the class that did the work.

class offset_values {
    @SerializedName("COMPRESSED_STITCHING_ORIG_SLIDE_SCANNED_AREA_IN_PIXELS__LEFT = ")
    private Double left
    @SerializedName("COMPRESSED_STITCHING_ORIG_SLIDE_SCANNED_AREA_IN_PIXELS__TOP = ")
    private Double top

    final Double gettop(){
        return this.top-(this.top%256)
    }
    final Double getleft(){
        return this.left-(this.left%256)
    }
}

Sadly the .annotation files do not contain any option for global offset.

@jonasteuwen
Copy link
Contributor

@rharkes I think this is fixed now by offsetting in the reader

@rharkes
Copy link
Contributor

rharkes commented Jan 4, 2024

Good. I remembered it was a pretty annoying problem. When we thought it was fixed, the offset turned out to always be a multiple of 256. Even though the values in the mrxs data were not.

@jonasteuwen
Copy link
Contributor

That’s good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants