This is a module for the Insight Toolkit (ITK) that provides filters to replace regions within a masked region with the surrounding labels.
Project description
ITKDissolve
Overview
This is a module for the Insight Toolkit (ITK) that provides functionality to discard pixels within a masked region. Unlike masking, the pixels in the masked region are replaced (dissolved) by their nearest pixels outside the mask. This can be useful to clean-up label fields, e.g. to remove small islands/holes or remove entire labels, and replace them by the adjacent labels.
The module includes a filter called DissolveMaskImageFilter.
import itk
labels = itk.imread('path/to/labels.mha').astype(itk.US)
mask = itk.imread('path/to/mask.mha').astype(itk.UC)
ImageType = type(labels)
MaskType = type(mask)
dissolve = itk.DissolveMaskImageFilter[ImageType, MaskType].New()
dissolve.SetInput(labels)
dissolve.SetMaskImage(mask)
dissolve.Update()
modified_labels = dissolve.GetOutput()
itk.imwrite(modified_labels, 'modified_labels2.mha')
Or using the pythonic API:
import itk
labels = itk.imread('path/to/labels.mha').astype(itk.US)
mask = itk.imread('path/to/mask.mha').astype(itk.US)
modified_labels = itk.dissolve_mask_image_filter(labels, mask_image=mask)
itk.imwrite(modified_labels, 'path/to/modified_labels.mha')
Installation
To install the binary Python packages:
python -m pip install itk-dissolve
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file itk_dissolve-1.0.6-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 542.4 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb3dfeab2d0bbd9da638f7e15169d0079186d3aae6152c9c462090992fde9d4d |
|
MD5 | 9698fd5598b2f725ccadd695219dd4f3 |
|
BLAKE2b-256 | f44c3add1eb93336003647db810c1d662c686208f8c3d09ac7c925ef5a8e7bb5 |
File details
Details for the file itk_dissolve-1.0.6-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3d20168ad4ca427c05f1b73bc4ffa702e56e54605128ec3b9c6222715a2936b |
|
MD5 | 37bd5ee75c84b471dea6df8421a14755 |
|
BLAKE2b-256 | d98d2a417f691637b2babf30ad70e7e911dfa667372729928af6d57e5d4623f4 |
File details
Details for the file itk_dissolve-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144e209d66638bb3f4e749aaf0ebf407c72586942a54a0f63c170204a9fba269 |
|
MD5 | 9a1085434df4d1e580996cd627a8fc22 |
|
BLAKE2b-256 | 89dba3f2af80a0a3ab204012b88cf9b434ca10e534943e4f23f454c060c8b314 |
File details
Details for the file itk_dissolve-1.0.6-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a980e363ea7087acd9d2ff9287be76266b1524fe63b60afd8d732334405d7743 |
|
MD5 | 7801b3e889d2de98bbc3369284e4e14e |
|
BLAKE2b-256 | b2f4bb46392b8573f465becb649f2853bf91e64c32ce2bea601ebf6537000a6f |
File details
Details for the file itk_dissolve-1.0.6-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 542.4 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e205dc76d62dab6586304c83982f6591fc5c5c1727f032eb0abdb663b429b656 |
|
MD5 | ddf47152a77938ee9de206a10d941874 |
|
BLAKE2b-256 | c15d97f380552b8648e1abb638a810e13eb24bfe09c4c886428531c92f7f7492 |
File details
Details for the file itk_dissolve-1.0.6-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63a8b80feaa3bf9e72de6ffe7ffd4f437f9c0b492e140be55d2b873dc6821235 |
|
MD5 | 1c03e46fc1e2150d0c621e76d02069c1 |
|
BLAKE2b-256 | fca5b2ba6b011ce116ba4dca4b176da7ff612bda7f485e33ac233e6fdede2b11 |
File details
Details for the file itk_dissolve-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a21b4d0c13c6c1d9fa37d97fdadb2a42158a320715cfbc7a0a27b2125cdabaa0 |
|
MD5 | 63fdd3d3c3f0cc75920997862f34231f |
|
BLAKE2b-256 | d7463e09cf9ab37b85327da16941ffac2f1080e7b9fb2e3f140bf0a8256a6240 |
File details
Details for the file itk_dissolve-1.0.6-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 879479cbbe60854741719d4a7f36afa6e296786fea1c78cb3902c23fe43582a3 |
|
MD5 | 84f1271c0c0fe1c254ce71d2719e38c9 |
|
BLAKE2b-256 | ef380d4ac6038745e039713e64b91b27a407a77cd3868332262e630328b4970d |
File details
Details for the file itk_dissolve-1.0.6-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 543.0 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75e98f57ce1e3990b3bba5dde608a5034a0d5b6957077ae9fcab2559a299429 |
|
MD5 | 4dd840241a9fdd66a527fc5ba4d6dd66 |
|
BLAKE2b-256 | 85f430e1569e12f08eb7ff36de89bb015a24c4d982bab67ad763272e8cd756be |
File details
Details for the file itk_dissolve-1.0.6-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a44e1f8a6487add03d0d6b480c2650d7b1ee4b5a5add763b1a4824163550234 |
|
MD5 | 9b8a4d2efeccbdbb24401fe962b3e2c8 |
|
BLAKE2b-256 | 46732e9b649150548caff90326ba3c7c08d3e413b891c102d918da236a01a9c1 |
File details
Details for the file itk_dissolve-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6d592164a51abde28bed707abc0c0ec4fd827fd618b54415bfb4834b9bfc4fa |
|
MD5 | 9e77747bc6b366a778051848fb9ec72d |
|
BLAKE2b-256 | 8be91cca369e9392ece4b28ec94850bee4860b0a919cfd95f6586246c6efb17a |
File details
Details for the file itk_dissolve-1.0.6-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0360ba3474c8e9650c9ac5b02a55f27b64f8890c421f2cbd43973cdc0c3b31eb |
|
MD5 | d6236e188c93e5eee45f12a430fc63e2 |
|
BLAKE2b-256 | 7f28208d73f07437a5997fa0b6fa1c0d0ffd96c21f88be1340519629819c9a16 |
File details
Details for the file itk_dissolve-1.0.6-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 569.9 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71e006aa54118e5b7c5f82344af5eb25b7153a1f8e51b282c1562d571799c59a |
|
MD5 | d695088a8b0835a819e0a2bd9b317921 |
|
BLAKE2b-256 | c3794b7700fe6816de7f4bb63d2cad6f218bb39ac9a33c514db0b82dcf62d9a8 |
File details
Details for the file itk_dissolve-1.0.6-cp38-cp38-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e64bc7964261bd7c9c0bd364ae483993775e344319eb5758e990455d83152db |
|
MD5 | 59f84d275c7d5bc492522782c676a61e |
|
BLAKE2b-256 | 26b5d9a2608343d19cf6ed6c62df54dfec3b4a1c16ed4b54dcc99d77061eb807 |
File details
Details for the file itk_dissolve-1.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54228cee91043d6605ee5f33567197e02b2895ac7489cdd594b83fa256a59ab6 |
|
MD5 | 0154b9709328d8ff9885681a3dd052c4 |
|
BLAKE2b-256 | 412fa5850675896d86b07ee443443fb0894d6ae09fd3872d5ba9fad37524f1d1 |
File details
Details for the file itk_dissolve-1.0.6-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e7fa8415ab09332aabab84513cfa86a94b9336a1e9ddc38440e9cce5a1ee0bd |
|
MD5 | 27364aeefe70c5bf1d1a66fd03d3bafb |
|
BLAKE2b-256 | 52855af20eb134ae693bff2db6ba558547a2902bf306fbd4c56d91ff80e90a28 |
File details
Details for the file itk_dissolve-1.0.6-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 567.5 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1dc920704c351bc78052faf6531e04608aad0f6003fd30aa7750881d04c456c |
|
MD5 | 0412cd2e56c9c7a05a0b2d54ff983523 |
|
BLAKE2b-256 | d1656605429b64edf27b4df2280ec34f5a2b2f95b2281b42bc4d8fc4ff6c33fd |
File details
Details for the file itk_dissolve-1.0.6-cp37-cp37m-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp37-cp37m-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.7m, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d82c959e0bf2554fb31ab05323ef00b99231dde681ee6eec4785c51753750d37 |
|
MD5 | ae9b7f39740c5606eb4e23f04ab0458d |
|
BLAKE2b-256 | 7c6ff25a57206175a08891feab9f2561314d472f39904043a48fc3a7a8b5c66b |
File details
Details for the file itk_dissolve-1.0.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e2ccc1cc9d56e100e8a33d7b1750796327f1af33a3a0bfcf84620d206ba9b47 |
|
MD5 | 54590f9e62bb75d4d3c439addc29d4cc |
|
BLAKE2b-256 | 0f837b81f142bf5c1b8de37baa0e427f1d60a98aece68bd47636739bac8cdeb9 |
File details
Details for the file itk_dissolve-1.0.6-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: itk_dissolve-1.0.6-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.3 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74d0d1c256b0368c682489dc1a9eef804e21c45bd1dee6400fa5c6abc4c6f226 |
|
MD5 | 13c2f1abbf908e745b5b2d4ddc2fd287 |
|
BLAKE2b-256 | d0893dba7ef30c39a974082bbb1312c81854f096a7836d92b0ceae3a811045d1 |