pyhaloxml


Namepyhaloxml JSON
Version 3.0.2 PyPI version JSON
download
home_pageNone
SummaryRead and write the annotation files from Halo
upload_time2024-03-25 15:33:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords halo reader annotation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Mypy](https://github.com/rharkes/pyhaloxml/actions/workflows/mypy.yml/badge.svg)](https://github.com/rharkes/pyhaloxml/actions/workflows/mypy.yml)
[![Black](https://github.com/rharkes/pyhaloxml/actions/workflows/black.yml/badge.svg)](https://github.com/rharkes/pyhaloxml/actions/workflows/black.yml)
[![Pytest](https://github.com/rharkes/pyhaloxml/actions/workflows/pytest.yml/badge.svg)](https://github.com/rharkes/pyhaloxml/actions/workflows/pytest.yml)
[![Docs](https://readthedocs.org/projects/pyhaloxml/badge/?version=latest&style=flat)](https://readthedocs.org/projects/pyhaloxml)
# PyHaloXML
Python code to read/write .annotation files from Halo. Can export as .geojson for further analysis.

## Examples
[Example 1](https://github.com/rharkes/pyhaloxml/blob/main/examples/example1.py) : Move rectangles to a different layer and save as `.annotation`.

[Example 2](https://github.com/rharkes/pyhaloxml/blob/main/examples/example2.py) : Check if annotations have holes in them and save as `.geojson`.

[Example 3](https://github.com/rharkes/pyhaloxml/blob/main/examples/example3.py) : Show the wkt representation of the shapely polygon.

[Example 4](https://github.com/rharkes/pyhaloxml/blob/main/examples/example4.py) : 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](github.com/wimpomp/)!

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

## Development
* Install [Rust](https://rustup.rs/)
* 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.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyhaloxml",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "Halo, reader, annotation",
    "author": null,
    "author_email": "Rolf Harkes <r.harkes@nki.nl>",
    "download_url": "https://files.pythonhosted.org/packages/1f/75/f67249769df92a5b6f887e633c10008bea5c2b4b9e8ddb48a22156856e3c/pyhaloxml-3.0.2.tar.gz",
    "platform": null,
    "description": "[![Mypy](https://github.com/rharkes/pyhaloxml/actions/workflows/mypy.yml/badge.svg)](https://github.com/rharkes/pyhaloxml/actions/workflows/mypy.yml)\n[![Black](https://github.com/rharkes/pyhaloxml/actions/workflows/black.yml/badge.svg)](https://github.com/rharkes/pyhaloxml/actions/workflows/black.yml)\n[![Pytest](https://github.com/rharkes/pyhaloxml/actions/workflows/pytest.yml/badge.svg)](https://github.com/rharkes/pyhaloxml/actions/workflows/pytest.yml)\n[![Docs](https://readthedocs.org/projects/pyhaloxml/badge/?version=latest&style=flat)](https://readthedocs.org/projects/pyhaloxml)\n# PyHaloXML\nPython code to read/write .annotation files from Halo. Can export as .geojson for further analysis.\n\n## Examples\n[Example 1](https://github.com/rharkes/pyhaloxml/blob/main/examples/example1.py) : Move rectangles to a different layer and save as `.annotation`.\n\n[Example 2](https://github.com/rharkes/pyhaloxml/blob/main/examples/example2.py) : Check if annotations have holes in them and save as `.geojson`.\n\n[Example 3](https://github.com/rharkes/pyhaloxml/blob/main/examples/example3.py) : Show the wkt representation of the shapely polygon.\n\n[Example 4](https://github.com/rharkes/pyhaloxml/blob/main/examples/example4.py) : Create a .annotation file from coordinates.\n\n## Installation\n`pip install pyhaloxml`\n\n## Note on version 3\nThe 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. \n\n## Loading speed\nRust is used to match the negative regions to positive regions, thanks to [Wim Pomp](github.com/wimpomp/)!\n\nIt takes 41 seconds to load a 30.9MB file with 856454 vertices in 5769 regions with 731 holes.\n\n## Development\n* Install [Rust](https://rustup.rs/)\n* Clone the repository\n* `pip install -e .`\n\n### Notes on development\n* The xml is relatively simple. There are Annotations and an annotation contains regions.\n* 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.\n* 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.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Read and write the annotation files from Halo",
    "version": "3.0.2",
    "project_urls": {
        "Homepage": "https://github.com/rharkes/pyhaloxml"
    },
    "split_keywords": [
        "halo",
        " reader",
        " annotation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb9bd1792b93b0a0e3d305b61d72577d8055cfdd24ebedb86c0f4a6e94980f0f",
                "md5": "458211e4603bf50a148a43b7de3026ed",
                "sha256": "2f5ddc7fc4e19cde820e1a0f98b54820fde8a317f4aceb567df54fde9eac77aa"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2-cp310-abi3-macosx_10_12_x86_64.whl",
            "has_sig": false,
            "md5_digest": "458211e4603bf50a148a43b7de3026ed",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 235672,
            "upload_time": "2024-03-25T15:33:27",
            "upload_time_iso_8601": "2024-03-25T15:33:27.219366Z",
            "url": "https://files.pythonhosted.org/packages/fb/9b/d1792b93b0a0e3d305b61d72577d8055cfdd24ebedb86c0f4a6e94980f0f/pyhaloxml-3.0.2-cp310-abi3-macosx_10_12_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76f2bde362f1ab5da9e625e7a104d05bc01b874ad100b51e0848b440020f9528",
                "md5": "7755ad3bb2b7a95b9bf543fdf8e3efb8",
                "sha256": "84799f227619b8a8da0eae2668afbebcb18baa3a5f3291f305aca709004df718"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "7755ad3bb2b7a95b9bf543fdf8e3efb8",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 254337,
            "upload_time": "2024-03-25T15:33:29",
            "upload_time_iso_8601": "2024-03-25T15:33:29.081582Z",
            "url": "https://files.pythonhosted.org/packages/76/f2/bde362f1ab5da9e625e7a104d05bc01b874ad100b51e0848b440020f9528/pyhaloxml-3.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af1850a7b90bd2e9b225f409a0057a045f1da89f3a79a9f2c18c834c3a2e9c83",
                "md5": "3223ce469d96b724132eb8564d6e985b",
                "sha256": "1c92d24a2bf3481bf229778bf5d82cf4e3712a4da0f1d18bc86146caf00ac096"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
            "has_sig": false,
            "md5_digest": "3223ce469d96b724132eb8564d6e985b",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 271866,
            "upload_time": "2024-03-25T15:33:30",
            "upload_time_iso_8601": "2024-03-25T15:33:30.749662Z",
            "url": "https://files.pythonhosted.org/packages/af/18/50a7b90bd2e9b225f409a0057a045f1da89f3a79a9f2c18c834c3a2e9c83/pyhaloxml-3.0.2-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1767582e9a77b9bd36e43d70b6f81f1c2902838a5cafd9222f5f92f544a3d98d",
                "md5": "a4cbf14e778b82f345e070cea89dcb6d",
                "sha256": "4d0e8589ba558b82864182c9b4027fd6710edb8d7b2b0b75179c42f25201f614"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2-cp310-abi3-musllinux_1_1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a4cbf14e778b82f345e070cea89dcb6d",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 286575,
            "upload_time": "2024-03-25T15:33:32",
            "upload_time_iso_8601": "2024-03-25T15:33:32.448710Z",
            "url": "https://files.pythonhosted.org/packages/17/67/582e9a77b9bd36e43d70b6f81f1c2902838a5cafd9222f5f92f544a3d98d/pyhaloxml-3.0.2-cp310-abi3-musllinux_1_1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c26d13932001f1f4e5e1a9b2318b2103a42e9e93b92a0d2555fbd8dda4d4091",
                "md5": "d1cf0b2c86920677d6d5e9384bf2980f",
                "sha256": "cd00b0adaf1c0a8bfa7db08bffd77a2f5fef015786712783c716ec0356aaceb8"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2-cp310-abi3-win32.whl",
            "has_sig": false,
            "md5_digest": "d1cf0b2c86920677d6d5e9384bf2980f",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 123769,
            "upload_time": "2024-03-25T15:33:34",
            "upload_time_iso_8601": "2024-03-25T15:33:34.047374Z",
            "url": "https://files.pythonhosted.org/packages/5c/26/d13932001f1f4e5e1a9b2318b2103a42e9e93b92a0d2555fbd8dda4d4091/pyhaloxml-3.0.2-cp310-abi3-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5d4d819447bf4cb0bd3d590030b9ac1ddca88847e36b4f6708a00d2eb50e70ac",
                "md5": "81957693ff0821420896ddf5b24b3627",
                "sha256": "f3ec456176f0655ae62aecc1b610ae7c8c4cbaf0c4596ec5fa6fe681e41dee2c"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2-cp310-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "81957693ff0821420896ddf5b24b3627",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.10",
            "size": 125840,
            "upload_time": "2024-03-25T15:33:35",
            "upload_time_iso_8601": "2024-03-25T15:33:35.577635Z",
            "url": "https://files.pythonhosted.org/packages/5d/4d/819447bf4cb0bd3d590030b9ac1ddca88847e36b4f6708a00d2eb50e70ac/pyhaloxml-3.0.2-cp310-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f75f67249769df92a5b6f887e633c10008bea5c2b4b9e8ddb48a22156856e3c",
                "md5": "3c0c926e02bc5ea1c654fd6db951daf7",
                "sha256": "613681be3d7e3304b4d3d715a7b139da9d643b1a7b7831f4c0168bf904bcd402"
            },
            "downloads": -1,
            "filename": "pyhaloxml-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "3c0c926e02bc5ea1c654fd6db951daf7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 851236,
            "upload_time": "2024-03-25T15:33:36",
            "upload_time_iso_8601": "2024-03-25T15:33:36.723085Z",
            "url": "https://files.pythonhosted.org/packages/1f/75/f67249769df92a5b6f887e633c10008bea5c2b4b9e8ddb48a22156856e3c/pyhaloxml-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-25 15:33:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rharkes",
    "github_project": "pyhaloxml",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyhaloxml"
}
        
Elapsed time: 0.24112s