Skip to main content

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

Build Status License PyPI version

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

itk_dissolve-1.0.7-cp311-abi3-win_amd64.whl (555.7 kB view details)

Uploaded CPython 3.11+ Windows x86-64

itk_dissolve-1.0.7-cp311-abi3-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ x86-64

itk_dissolve-1.0.7-cp311-abi3-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.28+ ARM64

itk_dissolve-1.0.7-cp311-abi3-manylinux_2_17_x86_64.whl (700.8 kB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp311-abi3-macosx_11_0_arm64.whl (470.7 kB view details)

Uploaded CPython 3.11+ macOS 11.0+ ARM64

itk_dissolve-1.0.7-cp311-abi3-macosx_10_9_x86_64.whl (572.3 kB view details)

Uploaded CPython 3.11+ macOS 10.9+ x86-64

itk_dissolve-1.0.7-cp310-cp310-win_amd64.whl (554.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

itk_dissolve-1.0.7-cp310-cp310-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

itk_dissolve-1.0.7-cp310-cp310-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

itk_dissolve-1.0.7-cp310-cp310-manylinux_2_17_x86_64.whl (708.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp310-cp310-macosx_11_0_arm64.whl (466.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

itk_dissolve-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl (572.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

itk_dissolve-1.0.7-cp39-cp39-win_amd64.whl (555.4 kB view details)

Uploaded CPython 3.9 Windows x86-64

itk_dissolve-1.0.7-cp39-cp39-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

itk_dissolve-1.0.7-cp39-cp39-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

itk_dissolve-1.0.7-cp39-cp39-manylinux_2_17_x86_64.whl (707.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp39-cp39-macosx_11_0_arm64.whl (466.9 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

itk_dissolve-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl (572.0 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

itk_dissolve-1.0.7-cp38-cp38-win_amd64.whl (582.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

itk_dissolve-1.0.7-cp38-cp38-manylinux_2_28_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

itk_dissolve-1.0.7-cp38-cp38-manylinux_2_28_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARM64

itk_dissolve-1.0.7-cp38-cp38-manylinux_2_17_x86_64.whl (707.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

itk_dissolve-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl (572.1 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2d904fe761c50f03e8086b4de824f89bf771eaf1653b49e4d3cb7f72e3c1f86d
MD5 f5d26bd303b5e5bd5e6b5ffa7b72fe79
BLAKE2b-256 dd314f19208c7135f5e528ce98afc452af076ee69898911ee8d35b8f58cb7808

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c0c24e25b8824fc780fe3375dc1308a4fd48dbdbceb3c12e09aaf67a36e09923
MD5 290d9ac6b160c0acd6316b53d8dab71f
BLAKE2b-256 e0da7ecfae0c5b19491ea2f54c20fabc846483d48bd889c2aea34bdaf96d82cd

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c92d991194ca23db748e180c3bcf15d2ccea503cdae43b0d235693e699226a8c
MD5 9a8b453c216bc0e14191e104dc04d718
BLAKE2b-256 0d8855bd356214226ec2df6cd9dacad1158edfd28ad1ed2a3ddfc5fcb650e136

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c59c0d569118c77a5d0a6403380e97694b1f23b94dbbff307164f1597081c807
MD5 678b391151bc73e6cfa27b3d72c22b0e
BLAKE2b-256 8b3c598970d586e38c46c8bbbd6185cea8654940be7d3b426c933b574a878d3c

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24d8ee24992b4c61262ef454da857a62cab3e5cb98af74043cff936ac2f04961
MD5 16160abc34b1716a6f19fd3f604f5823
BLAKE2b-256 f09e34e60b332aadaaad5cbf1386d7fb6dc8dfb54f70bb891f50eec095e795c8

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b6a53453649920da1b1c4ffef30950bf27f1988080735db4ea1892364123ad4
MD5 1e2929b9aa2c94211346784458363826
BLAKE2b-256 2df3ed9e51fdd51490369173b03078312c433599f6688e763b50ef67ab2713b0

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp311-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp311-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bf3ce4c86dbeed0fa30df8f8f63e39074616b9eac9696452e1d48f9439ffb6e2
MD5 7d819135ed3b4b33184b20075c067822
BLAKE2b-256 cc66d11260634c3d8276687f970cff9d33b94edae4f5214ba9e1033a1aeb5070

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c5592c471a3456bf37625652b7113f8888dcabe08414b25373bd1b7342d06c6b
MD5 4e7618083a24ab6b1744e26ded3655e6
BLAKE2b-256 e17b9bdee3b0990cf642739773d2344d34602e749a1269e92bb0d956e2594711

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60b58fcd81a79e2e9cc2a4ed0de5d57f2484e524bdf75f88399fe0e0feaba992
MD5 c3bbe9df18064c4da418b06b456f6ec9
BLAKE2b-256 cc707912cbd132f34f070adb7ebae19bf5e5d98f2c03e4730dba1be054fb2293

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 acc748e1fd0cfbc79613ca02375b38e4f9ce3fff15b17ed48df4caa99d0f8994
MD5 0dd31901deb5761e36ec3ac6590333e4
BLAKE2b-256 3c62de025a4325cb0a21d3c359fb52f31d7b29080ccac5a955e7c2808cdc4ba1

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 cf84e503abcd529363d9dba2b90b87cdeab9112f853d52cf6da5e1b6c1b80db5
MD5 208dd1de77a2d52261992d82daafa567
BLAKE2b-256 03a22d7c3955f3f0ec11cf137d2114d1646f84e0b2f4e370e608c1447e5ff8ea

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 541a7990c9e1008ad2d3704d29072bed16e59c61e09aaaa8636edcfd8370c511
MD5 ad5256832b35cb64f9a56d7a1e0bdf56
BLAKE2b-256 2f33d9c9800e3099e0e4334c2dc1dc27746ac1658e0fa35f21142baf764b6f2c

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3482ed195a676fb164fc785d05e5d96051dee40b4d90854303759c56bd066bb7
MD5 ef6cf8cbccd988828ff9d5ab8b5dfb8e
BLAKE2b-256 82bcf927929977c1f91500464598177f524f8862334b046fc8c45199ce022b67

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ffcc1b74e7e70ccaa5fc7e002b5d95e979c69b1b1a771d6fc1f1140aff1e071f
MD5 cc750db128b2e230029bac9d5ce89a86
BLAKE2b-256 8d4e1cfcacc6c1a1559a785061b5b0cbde8f22f26cb4d6c793ef9352a8c94657

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 12ff7ad36f88becfb1f5ca0a7a62d38cf76f0c0f88ad981941ad4b988e4e7934
MD5 5ee491c37cf4cee54671f5eb80785856
BLAKE2b-256 3fe59587993ee231f075f1c0f3c3fa694eff9120356c115d332e33d0014864e6

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b4bd170f2608786ad862338006ef51143c79bf03b3c413aa0bc4d1cd35f37d63
MD5 391b8aa9d3c8eef889929fec2b3d26e8
BLAKE2b-256 ef0515b5a88520a393925c0165dff4782a66a22968334a26b7672743342234f7

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 efe312f39209680dd62b8d5a2f0eaf64744257d754f10af6a9ca57f59895c074
MD5 c877d0c71eedb38480c73df8417f1c7c
BLAKE2b-256 780aa21e3d8c479ae62506b268a497f6a1deb1b7d6db9573a02a581f1cb9df75

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 24ad03712c954da1622aaf1dbaa6662c7ba884aeb72d40891b007d3b4f84db78
MD5 b861d8c60c609849708d0ebad9ff78a3
BLAKE2b-256 722faa0cc05315e97e8911929d19c5ffd9fdb7fd5c24aa46ffac32265488fe91

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cf983be4e93e84c4202d7d2e5d1a41de4daac3748e40e2a6b7811c568c892c0e
MD5 d140a83259b86216b3f1fdc70811d9fc
BLAKE2b-256 efc4d0afc89798eb69d7bfa61752b76b2b0fd7f11f338418054ccd62e54bf4e7

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d24f0dc319173478d92fd28c2b621da83bad417df2fdde5b871d59a3585ccfec
MD5 0566fd4da5061a38c16a9612c053877e
BLAKE2b-256 02d97366712f8bff0f6765bd963ad1a64b9c9dde4f3ecb2f40d108f13a263b9f

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c19ee57809c5cd84c7197811c884b70f7e017ecafb576448447fe27281cd61d4
MD5 4b53b4d373b3e8b7e72c7cee11b527cb
BLAKE2b-256 aca55619206d6d040ea881bd874697c68541fe3de454572db2137be89acbdeae

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 1fe4fe4d8fdac2c828da49893c43161470af51081ff9d8d17d1dadc6029000b6
MD5 cbc42dd1e01e3ebabefbacea0d38d639
BLAKE2b-256 865a9293597055451e657b777394393c426f59b68050864b52d56dc5c85d4ff3

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e6a99a726dce876fa5e21b972c00ca7cb8810a8141c94b0730ce18a07d3c4851
MD5 5fcd6dffacc19411c5247d2361aa46a5
BLAKE2b-256 7becd265e677651a4d272fc4b6aad764ccdb292b6b92050bb162d70e4813c317

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0d4d378f2e52ab19fb19c7fed043780a3217d9b78ff934ce6e05d2880c478972
MD5 303bb63ebf616067a5e17df1188c20be
BLAKE2b-256 39027673a0ffd5a7605b4b304970ec5705374dd60b126905013911e08a917de8

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp38-cp38-manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp38-cp38-manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b0d65cbf795d11e7aff2a55b36442674ea09d56acdb26e44f13d32a12c141ef0
MD5 63d6fc0aa722e80713abc389bda155c3
BLAKE2b-256 8ae7b1c04e930dcd3f99e5e0b4d5d16cd74a7d37c058cca27f675f6ba8128d6e

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55b643565999cea5adf431f2e553321199d74bd3ff48edff24c3b33fbafb4536
MD5 a8a394ffa49f9d19c00c2ea62fa1b43e
BLAKE2b-256 a747b941086832ab9828562541f3fb64f1afbc2df45d94551492744b67c6a8d1

See more details on using hashes here.

File details

Details for the file itk_dissolve-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for itk_dissolve-1.0.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4c3464c18698cd80d7566a876cad144d764601420ca949d538c72905b13ab20f
MD5 bb4518616b27e0c58d2d0e3bbfb4d5e0
BLAKE2b-256 4d09b546304028ba19f4f6c1aa0f29abeaae6b2a3df287c326380bd0b4d72ca8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page