Morphological image processing for 3D multi-label images.
Project description
fastmorph: multilabel 3D morphological image processing functions.
import fastmorph
# may be binary or unsigned integer 2D or 3D image
labels = np.load("my_labels.npy")
# multi-label capable morphological operators
# they use a 3x3x3 all on structuring element
# dilate picks the mode of surrounding labels
# by default only background (0) labels are filled
morphed = fastmorph.dilate(labels, parallel=2)
# processes every voxel
morphed = fastmorph.dilate(labels, background_only=False, parallel=2)
morphed = fastmorph.erode(labels)
morphed = fastmorph.opening(labels, parallel=2)
morphed = fastmorph.closing(labels, parallel=2)
# Dilate only supports binary images at this time.
# Radius is specified in physical units, but
# by default anisotropy = (1,1,1) so it is the
# same as voxels.
morphed = fastmorph.spherical_dilate(labels, radius=1, parallel=2, anisotropy=(1,1,1))
# open and close require dialate to work and so are binary only for now
morphed = fastmorph.spherical_open(labels, radius=1, parallel=2, anisotropy=(1,1,1))
morphed = fastmorph.spherical_close(labels, radius=1, parallel=2, anisotropy=(1,1,1))
# The rest support multilabel images.
morphed = fastmorph.spherical_erode(labels, radius=1, parallel=2, anisotropy=(1,1,1))
# Note: for boolean images, this function will directly call fill_voids
# and return a scalar for ct
# For integer images, more processing will be done to deal with multiple labels.
# A dict of { label: num_voxels_filled } for integer images will be returned.
# Note that for multilabel images, by default, if a label is totally enclosed by another,
# a FillError will be raised. If remove_enclosed is True, the label will be overwritten.
filled_labels, ct = fastmorph.fill_holes(labels, return_fill_count=True, remove_enclosed=False)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastmorph-1.0.0.tar.gz
(21.9 kB
view hashes)
Built Distributions
Close
Hashes for fastmorph-1.0.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0480d755341f3052e457bcafbaf29c4dbaa62eec86a2a2e93f702d99c4458c8e |
|
MD5 | 115d9d05a84505203fd7a4faad11cadc |
|
BLAKE2b-256 | 3903f7fe079ecdb1504e21ce502e63197bc95249690b9b2b4304589c3c914b48 |
Close
Hashes for fastmorph-1.0.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a001093c8c1d53c8eb9ecbe385f0bc9d45059d19e92cd3cc2d1e148136ab2ce2 |
|
MD5 | 7d9453af724587d063c8428805806a5c |
|
BLAKE2b-256 | 1a43d2fc3945940872045380aff26b248fc80c582461a4b83576bda27d0cdf08 |
Close
Hashes for fastmorph-1.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc445658dd81cad8a4625c2ebf1b1d3fb7c63d3f935f04a32d1c49263c4a39d |
|
MD5 | 9407fd0ba03529a9806f8a9aecf4bd26 |
|
BLAKE2b-256 | 9871a570c23ad3dde2b389986234afa3919067aa7a24a3fd26cf83fc43a60e60 |
Close
Hashes for fastmorph-1.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d2a8075627ce7a99152586958dbc48d6466d15bb24523472696dfd98a07cec7 |
|
MD5 | 0c174cd5d696164c48125450bf13a10d |
|
BLAKE2b-256 | bc109ed80152c6e194949ff703329d5d3ad4963f6cd68c512aaf42931e5e5f78 |
Close
Hashes for fastmorph-1.0.0-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d63080637879d74fb1e5a3dc38efaecb6068299219faf7fd47d4da23037935f5 |
|
MD5 | cf44c6070b61ce4963ca4ceece01a269 |
|
BLAKE2b-256 | 8eab94450c0440b6954f4ef74698e7e6ce2b59fdd6c978d0f7457a5a050ede33 |
Close
Hashes for fastmorph-1.0.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cae0b25932ecc918147c1d527861db79d202c167419bdf0c9001b1eaa72b23cd |
|
MD5 | 2b612a26a25557e5f31cf8a4ced479a8 |
|
BLAKE2b-256 | 885cf83ddadf8056516da896cd0e2eff1ddebdd20bea7492221b2c6952145738 |
Close
Hashes for fastmorph-1.0.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42a2121616bedc5440ee50e1fd526e198121c45866f0719c76bbb0a0dea4cf69 |
|
MD5 | 89d7a3081752d50c18c5cfb167379064 |
|
BLAKE2b-256 | a0f7563190a5a40e6cc7631f4c745d4f007d8e49252ddd1a45c9758a0486ecbb |
Close
Hashes for fastmorph-1.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f752a46a6124e30c3a53a0ae246406c0d2ffa849e349c1acd794e20bbf28ba3a |
|
MD5 | 2e32db87ee4044f4142b607fc65af96e |
|
BLAKE2b-256 | 1e140f98e6120641411fe7586a1665674cff74a681eccc1f4682a463a6dbcd62 |
Close
Hashes for fastmorph-1.0.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e036d6b399efdccd69770b9ec7a50cfef30a007b55d85b2e0f74cba971d9004 |
|
MD5 | 5cd3b8252f967405b879f803d2c1a96d |
|
BLAKE2b-256 | 6d95358cc82062378b8c90a4158e9b93308d66a8b832baab888f1acaf362cd86 |
Close
Hashes for fastmorph-1.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47c9285944cd594fbe8cf3e292195d1b0cd72612b5727f72ab76846e214386c |
|
MD5 | e5b77a473eeaa3497a1550302b51b238 |
|
BLAKE2b-256 | 42a52a15c98a0c5208637702c57f04f2fab30d3a2580f790aa57be2ba04439e6 |
Close
Hashes for fastmorph-1.0.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f748674e5e89bf0ff78c9d68af2989e10a8d0fb7c2f41abe8430a3f1fc4445 |
|
MD5 | 9464865852371d355a4032382376aba9 |
|
BLAKE2b-256 | cd08d85fc39affe9d48d062b0433ef5ea2f881ae6bd41b43c626eb7b59f6723c |
Close
Hashes for fastmorph-1.0.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a0b23bae2f1effa3d40df9adfbb180238af972a23a4e28224034d15a6878281 |
|
MD5 | 4f378304e61084b7e36ec02cff4bbec6 |
|
BLAKE2b-256 | 94329267c578e267dcad0ed5f1d8afaab3658fa558470721d3b8245bb0069739 |
Close
Hashes for fastmorph-1.0.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f21e32f88bfbb4fffafe911f4ca6b1ec4b516ec70e506782c954165f779d9e |
|
MD5 | e23786b9143e906a083f956f5531f091 |
|
BLAKE2b-256 | 1f3877958ddb56a721ec08895cd0ab97e5185cab122b9ea12b72cd5fec654bdc |
Close
Hashes for fastmorph-1.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abac00fa219f87f537e5c9b269cc5cdf75652bc709c8dadbdce1829f3464ed6a |
|
MD5 | a07e42bdb7eeb886e7212308990eab88 |
|
BLAKE2b-256 | 33b9de73ba9f96309ddef5ca85346abd1b0bf691256c187385b48c721800062e |
Close
Hashes for fastmorph-1.0.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb89c72bd676911435d1c012a8fc6ce53092ce91a645edda5c5b45c3b8611a4c |
|
MD5 | 5547ca13861db9ce6603ea3ae926fb1f |
|
BLAKE2b-256 | e67053465b755a01611c1b45b694a6267c5552f77c596e4e98a5fd2f312f7d37 |
Close
Hashes for fastmorph-1.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 431dec9299868fdacdad3a8b480bb9a1fac83fc79012e6f2c4eb279cf89047e2 |
|
MD5 | 3e04da0a5b83d7dbbe403ce7502a7641 |
|
BLAKE2b-256 | f417f81ec836f3877ebecc9a8be3824a2e3f1faaa7d6cb33124b8c37327d5130 |
Close
Hashes for fastmorph-1.0.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 675514525378293c1192424e660781294ef44c94fddffe8b6f8e30a13a0f851e |
|
MD5 | acf3ff7e764abfe61b1e402e634d08ad |
|
BLAKE2b-256 | b4ca61e5d1e55590c7e950fd87f2be9ec2577e8e62f02b2d9ffac69f6ed93a2f |
Close
Hashes for fastmorph-1.0.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8cbd63ed9d06de5fcbe730da8011a99a97b988518407c1157ae920fd34097336 |
|
MD5 | 3514e4902abef2f9fbe531d756bc2e85 |
|
BLAKE2b-256 | 7e499e456438d46c06c509599bac4371932672f7ddae6fae4ba0e3eba85853eb |
Close
Hashes for fastmorph-1.0.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f7fc7eeb0bb0ef45d15c7e41cd8020b13d475fc1d436760eb9dcc6a06e975d |
|
MD5 | 1fbf85dc618d9bc8f543de5c08d044fa |
|
BLAKE2b-256 | 2193c0d1a77a3fc88c3c5b3f5651d143cef26b971f22a6f5fbc49381fe7e2709 |
Close
Hashes for fastmorph-1.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c9e58f836a4843edf1950ef33590fa6ea76392c798f6d6d6bbb4a6a6f226aba |
|
MD5 | ecf115ba6d6de496e3eed8b484c62477 |
|
BLAKE2b-256 | 63d0a81d9064b7ef2f7cc588ed70024de107b7142ea82a618a6713f27494e488 |
Close
Hashes for fastmorph-1.0.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 443bbccff3534a83163e6a5e069a0bb86fd2768ee45d8a04b00cd414a3d23e1c |
|
MD5 | ab7453418fbc48eea062bb684a03b609 |
|
BLAKE2b-256 | 13715fa133eef7dfe1e0e8934cb1614a8470d17698110300e10e347b7f025dc6 |
Close
Hashes for fastmorph-1.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8345895d00174b3a840ec6671fb6999602751e5a76e6059bf93d38684512bc5d |
|
MD5 | bc00797571bc9780df891e9812f4fdca |
|
BLAKE2b-256 | 290d2ed60725f00a2e09ae8b996f10d7e8982be751049225b361e1a84e64c2a9 |
Close
Hashes for fastmorph-1.0.0-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efad4a2f26798423766bb8124fddb466812fa70886e7605159984c751d53ca55 |
|
MD5 | 00744ed7a71c55202274956eaec328e1 |
|
BLAKE2b-256 | 9f3f6ca8fe4c33992597bbd656b69105c693e3c58d35fd64386b7caf4ba7b736 |
Close
Hashes for fastmorph-1.0.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df238a8950ae733cd91a7a83e48f1c4cfb6c726a4651da6c2377f1275759c01 |
|
MD5 | 0ce155ed4574cedfd891b47f6b4cf8fb |
|
BLAKE2b-256 | 7a9fe36c0439febbfa5b7533c5c615d034da4a9529b2848a7c84ff7605923886 |
Close
Hashes for fastmorph-1.0.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55d2eaad24970b323510cb4c55e5a32a5e1a05b35b7cf86330c0960f9b726b38 |
|
MD5 | daffbc8518b1f3d6a96d13419d6d5fbb |
|
BLAKE2b-256 | f83aabe20e168311d43ab8d9e4c2d5f659c18fc8f63aedd7e663ba61b974f8cd |
Close
Hashes for fastmorph-1.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb38718e15ecd9885cedf96102aefbec59e6fad531cb02920f3a929c3569703f |
|
MD5 | b17b7038897131bcb2cd90ae4e15001b |
|
BLAKE2b-256 | 6ebefe509759aa33ca806104ebde4ade7a026e9a0acba03e54f06b69557d91ca |
Close
Hashes for fastmorph-1.0.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db6a4c89e3d75edd9cf6da6046ba5a7a234cb35398f94faf9daf1b3b7bc67ce1 |
|
MD5 | de49e735b6fe6c9f327dabac85b62b9b |
|
BLAKE2b-256 | 00e2ba5cca453f0c096f09b8e8e952916ae696e09503b652f3a8dfbc5a247535 |
Close
Hashes for fastmorph-1.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d18586aa0f39c07fd650524a28196f7cb39588339fbbe0498e4d8cc1edc4bade |
|
MD5 | df0d5d7f50b2ef38e1c9b0f866006544 |
|
BLAKE2b-256 | 05ba0632a78dddfcc023291338d6d781c31976adc63e58341878b790843ae99c |
Close
Hashes for fastmorph-1.0.0-cp38-cp38-macosx_11_0_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad2d879d4b73d103b6bf41398366de9cb684cf808724be9b6325aee064efee42 |
|
MD5 | f50bd9edd005e488fbdb2fbb69feb229 |
|
BLAKE2b-256 | 1a97d3bbee3317f47f0124f2b2c87642e1576fae44d3cf146e142ed878d768ec |