
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
This is a module for the Insight Toolkit (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.
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):
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')
To install the binary Python packages:
python -m pip install itk-topologycontrol
FAQs
ITK external module to control topology of binary mask regions
We found that itk-topologycontrol demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.