itk-topologycontrol


Nameitk-topologycontrol JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/dyollb/ITKTopologyControl
SummaryITK external module to control topology of binary mask regions
upload_time2023-08-06 12:49:43
maintainer
docs_urlNone
authorBryn Lloyd
requires_python
licenseApache
keywords itk insighttoolkit
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ITKTopologyControl

[![Build Status](https://github.com/dyollb/ITKTopologyControl/workflows/Build,%20test,%20package/badge.svg)](https://github.com/dyollb/ITKTopologyControl/actions)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/dyollb/ITKTopologyControl/blob/main/LICENSE)
[![PyPI version](https://img.shields.io/pypi/v/itk-topologycontrol.svg)](https://badge.fury.io/py/itk-topologycontrol)
<img src="https://img.shields.io/pypi/dm/itk-topologycontrol.svg?label=pypi%20downloads&logo=python&logoColor=green"/>
<img src="https://img.shields.io/badge/python-%203.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11%20-3776ab.svg"/>

## Overview

This is a module for the Insight Toolkit ([ITK](https://github.com/InsightSoftwareConsortium/ITK)). The module includes a filter called `FixTopologyCarveOutside` which works like morphological closing, except that in the "erode" phase topological constraints are enforced to avoid re-opening holes. It is able to close holes in thin layers (e.g. skull) with a minimal thickness.

```python
    import itk
    skull_mask = itk.imread('path/to/skull_with_holes.mha').astype(itk.US)

    ImageType = type(skull_mask)
    MaskType = itk.Image[itk.UC, 3]

    top_control = itk.FixTopologyCarveOutside[ImageType, ImageType, MaskType].New()
    top_control.SetInput(skull_mask)
    top_control.SetRadius(5)
    top_control.Update()
    skull_mask_closed = top_control.GetOutput()

    itk.imwrite(skull_mask_closed, 'skull_mask_closed.mha')
```

Or using a custom mask (e.g. a sphere around a hole):

```python
    import itk
    custom_mask = itk.imread('path/to/custom_mask.mha').astype(itk.UC)
    skull_mask = itk.imread('path/to/skull_with_holes.mha').astype(itk.US)
    skull_mask_closed = itk.fix_topology_carve_outside(skull_mask, MaskImage=custom_mask, Radius=5)
    itk.imwrite(skull_mask_closed, 'skull_mask_closed.mha')
```

![Closing holes in skull](https://raw.githubusercontent.com/dyollb/ITKTopologyControl/main/doc/close_holes_skull.gif)

## Installation

To install the binary Python packages:

```shell
  python -m pip install itk-topologycontrol
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dyollb/ITKTopologyControl",
    "name": "itk-topologycontrol",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ITK InsightToolkit",
    "author": "Bryn Lloyd",
    "author_email": "lloyd@itis.swiss",
    "download_url": "https://github.com/dyollb/ITKTopologyControl",
    "platform": null,
    "description": "# ITKTopologyControl\n\n[![Build Status](https://github.com/dyollb/ITKTopologyControl/workflows/Build,%20test,%20package/badge.svg)](https://github.com/dyollb/ITKTopologyControl/actions)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/dyollb/ITKTopologyControl/blob/main/LICENSE)\n[![PyPI version](https://img.shields.io/pypi/v/itk-topologycontrol.svg)](https://badge.fury.io/py/itk-topologycontrol)\n<img src=\"https://img.shields.io/pypi/dm/itk-topologycontrol.svg?label=pypi%20downloads&logo=python&logoColor=green\"/>\n<img src=\"https://img.shields.io/badge/python-%203.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11%20-3776ab.svg\"/>\n\n## Overview\n\nThis is a module for the Insight Toolkit ([ITK](https://github.com/InsightSoftwareConsortium/ITK)). The module includes a filter called `FixTopologyCarveOutside` which works like morphological closing, except that in the \"erode\" phase topological constraints are enforced to avoid re-opening holes. It is able to close holes in thin layers (e.g. skull) with a minimal thickness.\n\n```python\n    import itk\n    skull_mask = itk.imread('path/to/skull_with_holes.mha').astype(itk.US)\n\n    ImageType = type(skull_mask)\n    MaskType = itk.Image[itk.UC, 3]\n\n    top_control = itk.FixTopologyCarveOutside[ImageType, ImageType, MaskType].New()\n    top_control.SetInput(skull_mask)\n    top_control.SetRadius(5)\n    top_control.Update()\n    skull_mask_closed = top_control.GetOutput()\n\n    itk.imwrite(skull_mask_closed, 'skull_mask_closed.mha')\n```\n\nOr using a custom mask (e.g. a sphere around a hole):\n\n```python\n    import itk\n    custom_mask = itk.imread('path/to/custom_mask.mha').astype(itk.UC)\n    skull_mask = itk.imread('path/to/skull_with_holes.mha').astype(itk.US)\n    skull_mask_closed = itk.fix_topology_carve_outside(skull_mask, MaskImage=custom_mask, Radius=5)\n    itk.imwrite(skull_mask_closed, 'skull_mask_closed.mha')\n```\n\n![Closing holes in skull](https://raw.githubusercontent.com/dyollb/ITKTopologyControl/main/doc/close_holes_skull.gif)\n\n## Installation\n\nTo install the binary Python packages:\n\n```shell\n  python -m pip install itk-topologycontrol\n```\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "ITK external module to control topology of binary mask regions",
    "version": "1.1.0",
    "project_urls": {
        "Download": "https://github.com/dyollb/ITKTopologyControl",
        "Homepage": "https://github.com/dyollb/ITKTopologyControl"
    },
    "split_keywords": [
        "itk",
        "insighttoolkit"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e74773039d387b806064783409d307f937e1300835ce242e5cb465799c7a2cf8",
                "md5": "f82fbed5a0076b0352b38c5633bdf522",
                "sha256": "4aadfe26eb45ca9aaa1dbd17b757480befffe09352d30786c1075915a07c2066"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f82fbed5a0076b0352b38c5633bdf522",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 1308560,
            "upload_time": "2023-08-06T12:49:43",
            "upload_time_iso_8601": "2023-08-06T12:49:43.797649Z",
            "url": "https://files.pythonhosted.org/packages/e7/47/73039d387b806064783409d307f937e1300835ce242e5cb465799c7a2cf8/itk_topologycontrol-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b48d6b2b68010bc4f43b18b16f732fa928091399748ead56239822dc2b992754",
                "md5": "a3eb85c214bd20a40377b5c4a60ba4b1",
                "sha256": "c2661974a312781e422f23a559b950fa5d5198c7df2495a847140f43f5c77f12"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a3eb85c214bd20a40377b5c4a60ba4b1",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 1347008,
            "upload_time": "2023-08-06T12:49:45",
            "upload_time_iso_8601": "2023-08-06T12:49:45.380208Z",
            "url": "https://files.pythonhosted.org/packages/b4/8d/6b2b68010bc4f43b18b16f732fa928091399748ead56239822dc2b992754/itk_topologycontrol-1.1.0-cp310-cp310-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ee35099abed1d7f666b24e7053b731a934d52a598c3e8b3f4be49d01603088aa",
                "md5": "9cd5d1627e7f7aeb30d148443d1d5d59",
                "sha256": "56802f2010899ebf134c17f4b6f60901b6209727990829b6083a29cf20acc65f"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "9cd5d1627e7f7aeb30d148443d1d5d59",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 589462,
            "upload_time": "2023-08-06T12:49:47",
            "upload_time_iso_8601": "2023-08-06T12:49:47.471403Z",
            "url": "https://files.pythonhosted.org/packages/ee/35/099abed1d7f666b24e7053b731a934d52a598c3e8b3f4be49d01603088aa/itk_topologycontrol-1.1.0-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6db4808cb28815bb521d81f32dace21695ff7cbae042662c05b1c111d53e31f9",
                "md5": "af435c4c322a661e0177fcaa92512071",
                "sha256": "3086a29a1a86260cfa8d6cf70c3876b1859e10a1f0dc45df754b46f08d22ee5a"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "af435c4c322a661e0177fcaa92512071",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 1308562,
            "upload_time": "2023-08-06T12:49:49",
            "upload_time_iso_8601": "2023-08-06T12:49:49.330490Z",
            "url": "https://files.pythonhosted.org/packages/6d/b4/808cb28815bb521d81f32dace21695ff7cbae042662c05b1c111d53e31f9/itk_topologycontrol-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ae3abf5ff6d0554eb9bbf9e316a23d45d3fd0315c8bdb5edb4758537f0fe7fe",
                "md5": "d4556816d6d4bba4d7b245056252a69a",
                "sha256": "091de6e0af2518a1a7d43b3acc3b86187967ed31535430157487b643dc3e8d80"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "d4556816d6d4bba4d7b245056252a69a",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 1347094,
            "upload_time": "2023-08-06T12:49:51",
            "upload_time_iso_8601": "2023-08-06T12:49:51.285361Z",
            "url": "https://files.pythonhosted.org/packages/8a/e3/abf5ff6d0554eb9bbf9e316a23d45d3fd0315c8bdb5edb4758537f0fe7fe/itk_topologycontrol-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bac16a540b1dee18bb3c83c58d6d68e314fe4b45cfd008facde94ed7b9625112",
                "md5": "702a876d4925cf8baef6ad83170db9fe",
                "sha256": "2c2328936d9699dcc6b371eb4fb5a2d67872583d18429e04b5e7774702ab7fd6"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "702a876d4925cf8baef6ad83170db9fe",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 589483,
            "upload_time": "2023-08-06T12:49:53",
            "upload_time_iso_8601": "2023-08-06T12:49:53.123279Z",
            "url": "https://files.pythonhosted.org/packages/ba/c1/6a540b1dee18bb3c83c58d6d68e314fe4b45cfd008facde94ed7b9625112/itk_topologycontrol-1.1.0-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba38448b77237ab4f72d62905e17e9c00443efe8251e111e4b1ed353f1dc0ee1",
                "md5": "f951ebadfe4c2efea4136fc33cf0a510",
                "sha256": "cc06bb524a73e3c030348a85a662ad8787bc567c61f22b3746614d24277d80c6"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f951ebadfe4c2efea4136fc33cf0a510",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 1309033,
            "upload_time": "2023-08-06T12:49:54",
            "upload_time_iso_8601": "2023-08-06T12:49:54.948377Z",
            "url": "https://files.pythonhosted.org/packages/ba/38/448b77237ab4f72d62905e17e9c00443efe8251e111e4b1ed353f1dc0ee1/itk_topologycontrol-1.1.0-cp37-cp37m-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8d0b28dabf56e4850e8b6ce1b31100a3094a6f14d9318896667ae65ee0294c8",
                "md5": "beae80b685f6e81c31269a99a116e496",
                "sha256": "84a4a1f81242dc6f1654c65219407338e8b03cfb1b399ba16551695fd81010aa"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp37-cp37m-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "beae80b685f6e81c31269a99a116e496",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 1347235,
            "upload_time": "2023-08-06T12:49:56",
            "upload_time_iso_8601": "2023-08-06T12:49:56.932859Z",
            "url": "https://files.pythonhosted.org/packages/d8/d0/b28dabf56e4850e8b6ce1b31100a3094a6f14d9318896667ae65ee0294c8/itk_topologycontrol-1.1.0-cp37-cp37m-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5dd304a3e556c01dba6762500a20faa2c893fcb88ff02e3340563dda7ae20be6",
                "md5": "11be421561867a0d2ec640e34fc08bfa",
                "sha256": "60c2ae316c2c6633593889b98726ad45b70ffbc16c849d9546490153071b6f32"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp37-cp37m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "11be421561867a0d2ec640e34fc08bfa",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 614010,
            "upload_time": "2023-08-06T12:49:58",
            "upload_time_iso_8601": "2023-08-06T12:49:58.920139Z",
            "url": "https://files.pythonhosted.org/packages/5d/d3/04a3e556c01dba6762500a20faa2c893fcb88ff02e3340563dda7ae20be6/itk_topologycontrol-1.1.0-cp37-cp37m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "200328de28453481ecb04b629de5f35802b978b8358e2cc2f7efa54c90c8c20b",
                "md5": "c606f7ccea2afc1d4cb572aa83ee1104",
                "sha256": "81bc031f11ea5d5ecc8c3e3c040c675c257f0a997e48d30f4ede6bb1d478a840"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "c606f7ccea2afc1d4cb572aa83ee1104",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 1309004,
            "upload_time": "2023-08-06T12:50:01",
            "upload_time_iso_8601": "2023-08-06T12:50:01.140613Z",
            "url": "https://files.pythonhosted.org/packages/20/03/28de28453481ecb04b629de5f35802b978b8358e2cc2f7efa54c90c8c20b/itk_topologycontrol-1.1.0-cp38-cp38-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "802263e40492dee85b194d6ec9fa9261e2d0d3dddc9c5228944c4f2f4f2feb49",
                "md5": "26b1f3c38d78fc41a2682f4970a2c3b4",
                "sha256": "e379c6d460c1076dec80fda7a1c6e4f1404ee3c78713214a27ba5902c8350209"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp38-cp38-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "26b1f3c38d78fc41a2682f4970a2c3b4",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 1346868,
            "upload_time": "2023-08-06T12:50:03",
            "upload_time_iso_8601": "2023-08-06T12:50:03.365471Z",
            "url": "https://files.pythonhosted.org/packages/80/22/63e40492dee85b194d6ec9fa9261e2d0d3dddc9c5228944c4f2f4f2feb49/itk_topologycontrol-1.1.0-cp38-cp38-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95baef8cbdb162b63aadf97f655279fd38035540d026059921a125d787c25d70",
                "md5": "5021e7361ae083061b2f67cb324ec1f3",
                "sha256": "33eaa640c64194ea55cd2b15597cc7f3e576e100034192495e3bcf9f455d6ed7"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "5021e7361ae083061b2f67cb324ec1f3",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 614282,
            "upload_time": "2023-08-06T12:50:04",
            "upload_time_iso_8601": "2023-08-06T12:50:04.844126Z",
            "url": "https://files.pythonhosted.org/packages/95/ba/ef8cbdb162b63aadf97f655279fd38035540d026059921a125d787c25d70/itk_topologycontrol-1.1.0-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "784b21a72060ccb7b90793e041e664f37c06036ae054401d8e9a8193be2f8267",
                "md5": "f8efe4a62ead435dff7438554c0ef604",
                "sha256": "59ac98907366d88a2d9ea4aa25bcb5d194fa686e277942b1b4db5432cc400cab"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f8efe4a62ead435dff7438554c0ef604",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 1308608,
            "upload_time": "2023-08-06T12:50:06",
            "upload_time_iso_8601": "2023-08-06T12:50:06.547033Z",
            "url": "https://files.pythonhosted.org/packages/78/4b/21a72060ccb7b90793e041e664f37c06036ae054401d8e9a8193be2f8267/itk_topologycontrol-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56abab6ce012e4027539937723faba0cc9871a3affab0fbd7a760995414875a9",
                "md5": "bad943d339c645f08803d1aea84a5456",
                "sha256": "f2bc6922f3beebc4f52ffef11ba1b124839474f7e72491435332204dd8dc0de4"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "bad943d339c645f08803d1aea84a5456",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 1347210,
            "upload_time": "2023-08-06T12:50:08",
            "upload_time_iso_8601": "2023-08-06T12:50:08.690618Z",
            "url": "https://files.pythonhosted.org/packages/56/ab/ab6ce012e4027539937723faba0cc9871a3affab0fbd7a760995414875a9/itk_topologycontrol-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18eb5f7263a1ba81b602c55602aec2c5bec305088cb98377c118bcef76ee58da",
                "md5": "50f4293909c9345f2169c5a072cd3be2",
                "sha256": "1966309b4b5080e5c8755ca02ed4cc0bdc990fcfa376ab154e5bfc217c8fa049"
            },
            "downloads": -1,
            "filename": "itk_topologycontrol-1.1.0-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "50f4293909c9345f2169c5a072cd3be2",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 590024,
            "upload_time": "2023-08-06T12:50:10",
            "upload_time_iso_8601": "2023-08-06T12:50:10.107680Z",
            "url": "https://files.pythonhosted.org/packages/18/eb/5f7263a1ba81b602c55602aec2c5bec305088cb98377c118bcef76ee58da/itk_topologycontrol-1.1.0-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-06 12:49:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dyollb",
    "github_project": "ITKTopologyControl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "itk-topologycontrol"
}
        
Elapsed time: 0.09984s