Commit 7e919b9
authored
feat(fill_holes_v2): true multi-label fill holes (#10)
* fix: remove debug code
* feat: add morphological closing feature
* fix: remove debug profile
* redesign: get rid of morphological close, add 1 to labels
* fix: reduce "escape" for holes on borders by using 4 connectivty
* fix: give an adjustable threshold for how much a hole can poke out
* fix: got this mostly working
* fix: preserve labels as "filled" if they simply are touching a lot of other labels
* fix: ensure bg contacts have non-zero surface contact
* perf: reduce peak memory usage
* perf: use crackle for low memory representations
* feat: make crackle-codec an optional dependency
* fix: switch from Sequence to Iterator
* docs: add docstring to fill_holes_v2
* refactor: add fill_holes_v1 as alias for fill_holes
* fix: trying to replicate exactly hole filling semantics
* fix: remove debug code
* fix: remove debug code
* fix: matched scipy! found a bug in fill_voids?
* feat: add merge threshold back in
* fix: referencing non-existent edges
* fix: incorrect optimization
* fix: incorrect threshold direction
* feat: allow closing of background on border
* ci: update cibuildwheel
* fix: bool dtype
* fix: return proper dtype
* test: check fill_holes_v2 for correctness
* install: add scipy to dev requirements
* ci: install scipy
* perf: add special handling for binary images
* refactor: remove unneeded special handling for binary images
* docs: describe hole filling algorithm
* fix: discard the sentinel
* feat: perform real hole filling in 2d
* fix: treat zero correctly
* fix: make everything work with fixed borders
* refactor: remove unreachable branch
* fix: don't reprocess an already processed hole
* fix: removed explored hole group
* fix: type annotation and return type for edge hole
* perf: handle large hole groups more efficiently
* fix: more suitable variable
* fix: better annotations
* docs: describe hole filling techniques
* fix: ensure holes touch the border properly
* fix: don't allow setting return_crackle when crackle is not present
* perf: delete remap variable after use
* fix: harmonize anisotropy type and generalize to float
* fix: handle fill holes on a solid color
* fix: fill holes on no color
* test: check if fix borders works right
* fix: handle fix_borders without skipping over labels that are fully filled
* test: check zero image works
* docs: correct the documentation1 parent ab9e756 commit 7e919b9
5 files changed
Lines changed: 484 additions & 5 deletions
File tree
- .github/workflows
- fastmorph
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
67 | 103 | | |
68 | 104 | | |
69 | 105 | | |
70 | 106 | | |
71 | 107 | | |
72 | 108 | | |
73 | | - | |
| 109 | + | |
74 | 110 | | |
75 | 111 | | |
76 | 112 | | |
77 | | - | |
| 113 | + | |
78 | 114 | | |
79 | 115 | | |
80 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | 4 | | |
3 | 5 | | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
112 | 197 | | |
113 | 198 | | |
114 | 199 | | |
| |||
0 commit comments