ENH: support multiple labels in ContourExtractor2DImageFilter - #2323
Conversation
|
I force-pushed with performance improvements. It could be even better, but this is plenty good enough. I will change this Pull Request to non-draft once it has passed its GitHub checks. |
|
A next step for performance improvement could be to address the bounding box calculation for each label. Do we have something like |
|
This pull request adds a new |
|
Doxygen blocks are sufficient, as the documentation is generated from them. |
thewtex
left a comment
There was a problem hiding this comment.
ValuesAreLabels -> LabelContours
|
I just rebased to the current master branch and squashed the commits. This is ready for a final sanity check and merge. |
@Leengit Do you think the performance is good enough now? Just curious. 😃 I wonder if it would be possible/useful to make the iteration over the labels Anyway I don't have concrete plans to use the filter right now (sorry), I'm just trying to help a little bit! |
|
Timings for the algorithm are now good, about 17x speed compared to the initial implementation, and beating the competitors such as HistomicsTK. The loop over labels as an inner loop is a good idea ... it would involve having separate lists of contours for each label being built up in parallel. We are going to go with the parallel constructions, but using a multi-threaded approach: issue #2343, which @dzenanz has assigned to himself, and is awaiting the merging of this PR. @N-Dekker writes:
Very much appreciated! |
…abel_in_itkContourExtractor2DImageFilter
…abel_in_itkContourExtractor2DImageFilter
The previously existing function of ContourExtractor2DImageFilter is to trace the contour between regions of a 2-dimensional image defined by values that are higher and lower, respectively, than a specified contour value. To that we add a
LabelContoursOn()option; when set then every distinct value in the 2-dimensional image defines its own region, and boundaries for all such regions are generated.At present this is WIP. Please review for the API changes. The implementation works, but is not performant; it needs additional work.
PR Checklist