Skip to main content

Read and write the annotation files from Halo

Reason this release was yanked:

It had no wheels

Project description

Mypy Black Pytest Docs

PyHaloXML

Python code to read/write .annotation files from Halo. Can export as .geojson for further analysis.

Examples

Example 1 : Move rectangles to a different layer and save as .annotation.

Example 2 : Check if annotations have holes in them and save as .geojson.

Example 3 : Show the wkt representation of the shapely polygon.

Example 4 : Create a .annotation file from coordinates.

Installation

pip install pyhaloxml

Note on version 3

The matching of negative to positive regions now needs to be done by the user after loading the data. The examples have been updated. This needed to happen because negative regions can be unmatched in Halo. This would cause errors when loading.

Loading speed

Rust is used to match the negative regions to positive regions, thanks to Wim Pomp!

It takes 41 seconds to load a 30.9MB file with 856454 vertices in 5769 regions with 731 holes.

Development

  • Install Rust
  • Clone the repository
  • pip install -e .

Notes on development

  • The xml is relatively simple. There are Annotations and an annotation contains regions.
  • Regions can be either positive or negative. However regions in an annotation are not hierarchical. So there is no telling what negative region should go with what positive region.
  • This package expects a negative region to be fully enclosed by one positive region. The matching is done by taking a single point that is inside or on the border of the negative region and checking if it is inside a positive region.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhaloxml-3.1.1.tar.gz (845.9 kB view details)

Uploaded Source

File details

Details for the file pyhaloxml-3.1.1.tar.gz.

File metadata

  • Download URL: pyhaloxml-3.1.1.tar.gz
  • Upload date:
  • Size: 845.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyhaloxml-3.1.1.tar.gz
Algorithm Hash digest
SHA256 4103f6caf5e1f6cd31e5b6d5271c7768bc570f55ac608bdf77f1e1677c7b128f
MD5 ae47678c3dcdd7b31963acf9231641d7
BLAKE2b-256 eba1c8faf0217e1b83dd706299acdb00323579b306859263566f193e3fff3a0b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page