mmcfilters
mmcfilters is an alpha research library for constructing and editing
morphological hierarchies, computing node attributes, and applying connected
filters and hierarchy operators. It provides a C++20 core and Python bindings.
The library represents hierarchies through a rooted connected-subset tree model. A morphological tree of partial partitions is the stricter case in which every node has a non-empty proper part. All supported image-domain trees use the same topology model, with an explicit smallest-node map and optional regular-grid geometry and adjacency.
Use mmcfilters for experiments that require mutable tree topology, direct
ownership of hierarchy state, incremental attributes, residual hierarchies, or
the filtering operators implemented by this project. For stable,
general-purpose hierarchical image processing, Higra
will often be the better choice.
Main capabilities
- construction of max-trees, min-trees, trees of shapes, and self-dual residual trees;
- generic rooted hierarchies with safe local and staged edits;
- a broad catalog of node attributes organized into gray-level, shape, moment, boundary, and tree-topology groups;
- a range of attribute-based filters and hierarchy operators, including pruning and non-pruning strategies;
- pixel contours and ordered geometric contour traces;
- import, export, and attribute projection for Higra-style hierarchies;
- typed altitude handling in C++ and a focused
np.uint8Python API.
Requirements
- Python 3.9–3.14 for the distributed Python package;
- NumPy 1.23 or newer;
- a C++20 compiler and CMake 3.20 or newer for source builds.
Installation
Install the Python package from PyPI:
python -m pip install mmcfilters
Install from a source checkout:
python -m pip install .
For a C++-only build and installation:
cmake -S . -B build -DMMCFILTERS_BUILD_PYTHON=OFF
cmake --build build
cmake --install build --prefix /path/to/prefix
The installed C++ package exports the mmcfilters::core target:
find_package(mmcfilters CONFIG REQUIRED)
target_link_libraries(my_target PRIVATE mmcfilters::core)
Quick start
import numpy as np
import mmcfilters
image = np.ascontiguousarray(
[
[3, 3, 2, 2],
[3, 4, 4, 2],
[1, 4, 5, 2],
[1, 1, 5, 0],
],
dtype=np.uint8,
)
# radius=1.5 selects 8-connectivity; use 1.0 for 4-connectivity.
tree = mmcfilters.MorphologicalTreeFactory.create_max_tree(image, radius=1.5)
root = tree.root
root_children = tree.children(root)
pixel = 10
smallest = tree.smallest_node(pixel)
support_pixels = list(tree.node_support(smallest))
component_mask = tree.reconstruct_node(smallest)
area = mmcfilters.Attribute.compute_single_topology_attribute(
tree,
mmcfilters.Attribute.AREA,
)
max_dist = mmcfilters.Attribute.compute_single_attribute(
tree,
mmcfilters.Attribute.MAX_DIST,
)
reconstructed_image = tree.reconstruct_from_node_altitudes()
Documentation
User guides
| Goal | Guide |
|---|---|
| Understand the tree model and construct hierarchies | Morphological trees |
| Use the Python interface | Python API |
| Compute attributes | Attributes |
| Apply filtering and hierarchy operators | Filters |
| Edit a tree safely | Editing API |
| Extract pixel contours or geometric traces | Pixel contours and contour traces |
| Import from or export to Higra | Higra interoperability |
Reproducibility
References
Contributor guides
- Attribute computer architecture
- Finite-window local-attribute C++ extension
- Scientific benchmark builds
License
mmcfilters is distributed under the GNU General Public License v3.0.
Metadata
Release files for mmcfilters 6.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mmcfilters-6.0.0.tar.gz | 577.1 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 37.3 MB
Release files / mmcfilters-6.0.0.tar.gz
| Download URL | mmcfilters-6.0.0.tar.gz |
|---|---|
| Size | 577.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf9d171553b128def0b7ef4d4332290dc9aa938e9d661eefabe503fc3a044891
|
|
BLAKE2b-256 checksum How to use checksums |
f29234076132db8bfc636e815d639dadc5b638aa35acb56f032c259c31391b98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp314-cp314-win_amd64.whl
| Download URL | mmcfilters-6.0.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
86352db589e9cdc9937769a3392262429158f495857b8d43ec23ad568b727cea
|
|
BLAKE2b-256 checksum How to use checksums |
6440fb6f02fa92d60f3f10a5f3719e6551eb35465f034afed13b9ab569919ced
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
1d453ae8c1df02791ce12b9e102e6bfb91cf1b461b115d84fd74cee9b7335f5a
|
|
BLAKE2b-256 checksum How to use checksums |
dcd8015a8a99e234679b54dcfc2ed92d7acce1dfd71dfc89f4ad0e3d6bb6a9d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp314-cp314-macosx_11_0_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp314-cp314-macosx_11_0_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.14 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
1ba181b1896c3e4d57ebb9ecc99dc4d53aeccaae57bbdd24f5ca45cdab97174d
|
|
BLAKE2b-256 checksum How to use checksums |
d9b9241575c6161156574db33e1b444e9b8b05dfa72367d0ed7686db9491a0ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | mmcfilters-6.0.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
821c981d56a33a442fd134929889b20dd4eb3f452b6c5e6bfee1fbccca233f9b
|
|
BLAKE2b-256 checksum How to use checksums |
dfad0c51aa344805f73343f891b810a50a7a1df9c709d049fbc8bc00608ade84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp313-cp313-win_amd64.whl
| Download URL | mmcfilters-6.0.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
86ff3a5cfd100753d733b8410c799b49c9cf25decc64e38d1e9a8c34ceb2418c
|
|
BLAKE2b-256 checksum How to use checksums |
bea68b47404e01bf9fb3c5382ad9a01ee54dc30d7a0fb93bda9480592a24d906
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
6c4367d3e7bfb63df19f9dba71de59a631f1afd4d692d878685d99a21c6d34ce
|
|
BLAKE2b-256 checksum How to use checksums |
e6cffeac637b95c37893de27554ca4f78147ea6bbac7b27efbff3fb2155292af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp313-cp313-macosx_11_0_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp313-cp313-macosx_11_0_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.13 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
b693d3c062b796baefe1fdb83c87459580a2d26bc4713cc89ead738658d7c8ad
|
|
BLAKE2b-256 checksum How to use checksums |
3a09fbe327dfb5bb093c743195fa5ec779f9305c38613baa74576b65a952c510
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | mmcfilters-6.0.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
92bc6f6db39333b00ec69ecd2edc38451208f8d836898d061a90078c902e7e5c
|
|
BLAKE2b-256 checksum How to use checksums |
86d6f9c785d87b4acb4df1b6893de49c5c941eb2bdb9916ad6058d0224a440d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp312-cp312-win_amd64.whl
| Download URL | mmcfilters-6.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
98461a46b93bb14e70532b911d1c322e67582ab3919bc5eda01f3c38cb9c934b
|
|
BLAKE2b-256 checksum How to use checksums |
3864765f49cf04a16a5453c483d910c1d95ef3863ffb85a21014ef1575d94d50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f98a91f19d7224a5c64d1cd942c5af83a1cac10111bf19da162a5840b5aa3b69
|
|
BLAKE2b-256 checksum How to use checksums |
2a219a94d6f4b9e28e3106f5f050997782f74f9d9bc1992aff561aa206e467a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp312-cp312-macosx_11_0_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp312-cp312-macosx_11_0_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
f5361bf68cdd49c0ff67c4ec26d260ae74c9613965523a544861ddff42586863
|
|
BLAKE2b-256 checksum How to use checksums |
834a86ba536408f4d20a93773810cb2868ac64ef36c85c0732d5709b53687fe4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | mmcfilters-6.0.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fe908bf34f3e05293946b12d85b6c17fac2bba66ca94998dcd7fe9746b391c54
|
|
BLAKE2b-256 checksum How to use checksums |
484eb4d51f3e31506ee37b2078dbbad305d1b724f08b2b386252cfe82ab7e0d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp311-cp311-win_amd64.whl
| Download URL | mmcfilters-6.0.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
beb4ead59a91695cea67b76a32236877dceb5fc828fb832fbfbb9ffabd2e411f
|
|
BLAKE2b-256 checksum How to use checksums |
d2b8b01271c64bd3bfce3cb15f62a91358aa95760aaa74baf0fed6984d2d7c13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9c2959f27591d3952fa45d31e3c683ffac5885762967f56a38318e8d67baece4
|
|
BLAKE2b-256 checksum How to use checksums |
0a5a0d3584bf3aa6dcc4ab76a68a72ff7bd99368355406de6af7d14cc92b8bcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp311-cp311-macosx_11_0_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp311-cp311-macosx_11_0_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.11 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
b96187981a5ce141dda7ea4a67b2c9d5a2c2292791b5ea36ea16ba563fa7c11f
|
|
BLAKE2b-256 checksum How to use checksums |
f0ed2a7bd8ea4744562f5f513d5546a41a45b1a79001a40c7132865669338809
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | mmcfilters-6.0.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
32319ae6be73d90d26e6d3d4e0afd6665ec3a12031e40f4559d85a48b066643f
|
|
BLAKE2b-256 checksum How to use checksums |
6cd8ea44d495430d7620f3714a91204ffda88bea390dd5f3c20fa0b94d118369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp310-cp310-win_amd64.whl
| Download URL | mmcfilters-6.0.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 1.3 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b973771bb1e15b7c4da0417ef94fd45075e5fd35dc68fcaae623ca0b6adff879
|
|
BLAKE2b-256 checksum How to use checksums |
f019e6d16da8baaa9ca1804fa89870bea2c1d9e2fcfe264fdeeeeb0f41ddbc3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9c312f443424d075dc99ea10299b5747c62d423cd13196ba3087739087db9c19
|
|
BLAKE2b-256 checksum How to use checksums |
36bbbf13b16aedcc4e7c57a6c7cac96e9c4ad6dc1b95070d654e03def5bd7cb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp310-cp310-macosx_11_0_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp310-cp310-macosx_11_0_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
e2b88af61e53b6f75400b69b027d77cbee453f74b29fc4caa0f7c0c4e4c11584
|
|
BLAKE2b-256 checksum How to use checksums |
c404e05f763e686a0e044eee072e8ae3b6d9bbdef2b192443dee2769753783f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | mmcfilters-6.0.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fee486fd19ee44a67ac38dcf7d7726c412562770b58bed0e363ae64d1fe86147
|
|
BLAKE2b-256 checksum How to use checksums |
7bfcc20415e7c7ee908a1c1993e482f6c9167969965a0693e2dd885afaf88c6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp39-cp39-win_amd64.whl
| Download URL | mmcfilters-6.0.0-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 1.4 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4fd36880d7e0f7b1dc5cfe4026101b962c7ecc83efc090ed355bc5b7d76cb3db
|
|
BLAKE2b-256 checksum How to use checksums |
3f721ec108177911fe0add2bc0cba35125540652d39e0081d5d7e04e81da3c14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4758c3eb4a32279e0a6da82f2004846a7a31f605c4db5aec305f829f73fa7b58
|
|
BLAKE2b-256 checksum How to use checksums |
568476d2cca90d2a17bf339f6580da2c8a832b227754ff9d40d3fc06b522522b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp39-cp39-macosx_11_0_x86_64.whl
| Download URL | mmcfilters-6.0.0-cp39-cp39-macosx_11_0_x86_64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.9 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
6247197d8b3f6d7b9a650efdf1c9b42c0eeca5d4207e1cadcae89ba0851fa336
|
|
BLAKE2b-256 checksum How to use checksums |
be401c31a9d1b4f6077191479c770d52116faf76244e865f3e7a5e47b458e11d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / mmcfilters-6.0.0-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | mmcfilters-6.0.0-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bf717935d1c46f51679d9f9540a995cc75a8c7c8449161437c7c85bad4980f81
|
|
BLAKE2b-256 checksum How to use checksums |
d8861fdda04bf737262a5c139cf79942692d5bd2b124ff1b552c79c15f6a4f3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Security for mmcfilters 6.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.