{"id":17190707,"url":"https://github.com/dyollb/itktopologycontrol","last_synced_at":"2025-04-13T19:32:13.297Z","repository":{"id":60430393,"uuid":"528559960","full_name":"dyollb/ITKTopologyControl","owner":"dyollb","description":"ITK external module to control topology of binary mask regions","archived":false,"fork":false,"pushed_at":"2024-09-10T06:10:53.000Z","size":5496,"stargazers_count":1,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T10:21:33.485Z","etag":null,"topics":["cpp","image-preprocessing","itk","itk-module","python","segmentation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dyollb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-24T19:08:10.000Z","updated_at":"2024-09-09T00:22:05.000Z","dependencies_parsed_at":"2024-09-08T15:43:12.061Z","dependency_job_id":"139a41a2-3927-421d-8774-30aa97687c72","html_url":"https://github.com/dyollb/ITKTopologyControl","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":0.5,"last_synced_commit":"fd0355a5e0d20c37804ae985f1b2471a5c057d77"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2FITKTopologyControl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2FITKTopologyControl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2FITKTopologyControl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2FITKTopologyControl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyollb","download_url":"https://codeload.github.com/dyollb/ITKTopologyControl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248768015,"owners_count":21158573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","image-preprocessing","itk","itk-module","python","segmentation"],"created_at":"2024-10-15T01:23:39.640Z","updated_at":"2025-04-13T19:32:10.812Z","avatar_url":"https://github.com/dyollb.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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\u003cimg src=\"https://img.shields.io/pypi/dm/itk-topologycontrol.svg?label=pypi%20downloads\u0026logo=python\u0026logoColor=green\"/\u003e\n\u003cimg src=\"https://img.shields.io/badge/python-%203.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11%20-3776ab.svg\"/\u003e\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyollb%2Fitktopologycontrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyollb%2Fitktopologycontrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyollb%2Fitktopologycontrol/lists"}