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

Improvements to XML import #1081

Open
3 tasks
birm opened this issue Feb 6, 2025 · 4 comments
Open
3 tasks

Improvements to XML import #1081

birm opened this issue Feb 6, 2025 · 4 comments

Comments

@birm
Copy link
Member

birm commented Feb 6, 2025

This is about the xml import utility: https://github.com/camicroscope/caMicroscope/blob/master/apps/port/import.html

  • From the xml, the line color under Annotation is a decimal representation of color, read this in
  • Sometimes (always?) the xml document is supporting polyline, not polygon. This has confused users who have drawn lines and caMicroscope tries to "complete" the polygon
  • Each XML Annotation group should be its own annotation object (toggleable independently)
@TejasNangru
Copy link

Hi,
I want to try this issue.

@chandrikarj
Copy link
Contributor

chandrikarj commented Feb 12, 2025

Hi @birm,

I've been working on this issue for the past couple of days and have made the following improvements to address the issues raised in this ticket:

-Color Representation Fix:
The line color in the XML annotation is now correctly parsed from a decimal representation to a hexadecimal format.

-Handling Polyline vs. Polygon:
The XML import utility now differentiates between Polyline and polygons.
Now, if the region type is Polyline, it is correctly mapped to a LineString, while Polygon regions remain unchanged.

-Independent Annotation Groups:
Each XML annotation group is now processed as a separate annotation object.

-Bounding Box Implementation:
I added Bounding Box support to efficiently store the extent of each annotation.
The bounding box is calculated as the smallest enclosing rectangle around the annotation, using the min/max X and Y coordinates.

Please take a look and let me know if this aligns with the expected outcome, and if any changes are needed. If everything looks good, I can proceed with opening a PR.

The videos demonstrating the changes are below :

BEFORE:

Screen.Recording.2025-02-12.at.11.46.13.PM.mov

AFTER:

Screen.Recording.2025-02-12.at.11.46.57.PM.mov

@birm
Copy link
Member Author

birm commented Feb 12, 2025

Wow, two people with interest in as many hours!

@chandrikarj at least at a glance, that looks better. Would you like to open a PR?

@chandrikarj
Copy link
Contributor

chandrikarj commented Feb 12, 2025

Thanks for taking a look @birm , I have opened a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants