Skip to main content

Read and write the annotation files from Halo

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.0.0.tar.gz (850.5 kB view details)

Uploaded Source

Built Distributions

pyhaloxml-3.0.0-cp310-abi3-win_amd64.whl (125.8 kB view details)

Uploaded CPython 3.10+ Windows x86-64

pyhaloxml-3.0.0-cp310-abi3-win32.whl (123.7 kB view details)

Uploaded CPython 3.10+ Windows x86

pyhaloxml-3.0.0-cp310-abi3-musllinux_1_1_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+ musllinux: musl 1.1+ x86-64

pyhaloxml-3.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+ manylinux: glibc 2.17+ x86-64

pyhaloxml-3.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.0 MB view details)

Uploaded CPython 3.10+ manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyhaloxml-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl (238.7 kB view details)

Uploaded CPython 3.10+ macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pyhaloxml-3.0.0.tar.gz
  • Upload date:
  • Size: 850.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyhaloxml-3.0.0.tar.gz
Algorithm Hash digest
SHA256 9a18309df5b85f6eccd0fbfdb82ebbcb5f4eadf68546d37cbfd64b722dc6a68a
MD5 f4aec288889a2754e082ef60c62be1c1
BLAKE2b-256 2f00dfc08e4368bcdf45e53df7d658fc36964f24add62dd16ad38c763b2cc84a

See more details on using hashes here.

File details

Details for the file pyhaloxml-3.0.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: pyhaloxml-3.0.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 125.8 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyhaloxml-3.0.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 abbe43e2710aa7550ad0605059985dc8d11c6a3b8e04f1721f8b7fc4ad5fa70c
MD5 e8088a3aec7793d39db3e13d7b1be62e
BLAKE2b-256 3176259ea24b28abcf35e62018815de60012bdb24c06f893c86c1d8e25e0408c

See more details on using hashes here.

File details

Details for the file pyhaloxml-3.0.0-cp310-abi3-win32.whl.

File metadata

  • Download URL: pyhaloxml-3.0.0-cp310-abi3-win32.whl
  • Upload date:
  • Size: 123.7 kB
  • Tags: CPython 3.10+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pyhaloxml-3.0.0-cp310-abi3-win32.whl
Algorithm Hash digest
SHA256 d1f4d6b59bec23f7c195a834c1d7382d78ab060ea176bff6b5805adb3a18fb99
MD5 1e026407abcc54f2b7077ecd0cb358db
BLAKE2b-256 e5925e6e882647db9a0b2ee2297051ecf7c4617ae89160600f981b4aacecebef

See more details on using hashes here.

File details

Details for the file pyhaloxml-3.0.0-cp310-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for pyhaloxml-3.0.0-cp310-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 4dad25dfba7a34c59a22bcfc99b3716662f0c2c5e37d1c305f463ed3fa74ac34
MD5 4850e1aad5c816d83054bb5e5312cce0
BLAKE2b-256 d2d9378b477f522f58daaa2ff39f2265c9eb0ff8564d361c418e4d1137e74de1

See more details on using hashes here.

File details

Details for the file pyhaloxml-3.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhaloxml-3.0.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 53096511d278af464b93d8f00c68ea18f24a0e21654968505154eefed7f2ae9f
MD5 71628b8f80dfd42891124c3e1f8979c6
BLAKE2b-256 1f90bc58011c69fda6810c1ef5e69d050e4510d0b5f45735c450c3661fece0ce

See more details on using hashes here.

File details

Details for the file pyhaloxml-3.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pyhaloxml-3.0.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d7e7acfdebdac5b76a6d5403f7d1436ea9733810f2b28b9c367739cc7f055933
MD5 5a72c24bedd2e3e76a3f9c5a0fcb6275
BLAKE2b-256 7e1f618dab6ac01def05c55c5c534288ad8036a2778a9a08bba711711614bff0

See more details on using hashes here.

File details

Details for the file pyhaloxml-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyhaloxml-3.0.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4e614a5d2262f7ece1afd2ac9a3e9a1a0f2dca21899f2a8666da3ed6b5e35770
MD5 4a51311cde977133ae24837b6cde94d0
BLAKE2b-256 9d0571b7d61c432e9b109b373b6b306eb20e123437dfc19efc5d1757e1e823a2

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