Closed jonasteuwen closed 2 months ago
To install I had to pip install meson
pip install ninja
pip install dlup
and meson build
to get it working. Maybe others can test this in their setup and we can change the readme.md to reflect all of this. I also had to remove the pure=false
from the meson.build file (at line 7) because of meson version issues.
Attention: Patch coverage is 83.61757%
with 317 lines
in your changes missing coverage. Please review.
Project coverage is 85.73%. Comparing base (
8d31221
) to head (0009ba5
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The
WsiAnnotations
have been rewritten using boost.Polygon, replacing shapely. The current implementation with shapely has a few issues:The proposal is to keep
WsiAnnotations
around until v1.0.0, add deprecation warnings to the current calls that are not 1-1 compatible with the newSlideAnnotations
(available indlup.annotations_experimental
). In particular these features are implementeddlup.geometry.Polygon
: should be mostly compatible withshapely.geometry.Polygon
for our use casedlup.geometry.Point
: a point class, same as abovedlup.geometry.Box
: shapely doesn't support boxes but we do.The function
SlideAnnotations.read_region()
returns anAnnotationRegion
object rather than list of objects. You can access the polygons usingAnnotationRegion.polygons
, points usingAnnotationRegion.points
and boxes usingAnnotationRegion.boxes
. The first two behave as expected, but the boxes are not cropped to the read_region, so it is possible the (x, y) coordinate is negative (slightly outside of the read_region). In addition there is a callto_mask()
that generates the mask. The evaluation is lazy, so a call toread_region
does not execute the pipeline until you access the polygons, points, boxes or mask in the object.The
SlideAnnotations
has a few new calls:set_offset
: offsets all the annotations, useful in e.g. Halo annotationsscale
: scales all the annotations in place, useful if you have annotations at lower res and want to rescale to level 0as_dlup_xml
andfrom_dlup_xml
: this is our own defined schema which is able to serialiseSlideAnnotations
completely.reindex_polygons
: this sets an index for theto_mask()
in the polygons.relabel_polygons
: as expectedLazy evaluation
The library supports lazy evaluation, most operations are only performed when requesting masks or polygons.
WARNING: The operations might not all be thread-safe due to their in-place modification behaviour.
Something that might be nice to have
Please add more possible features.