-
-
Notifications
You must be signed in to change notification settings - Fork 717
PERF: Parallelize ContourExtractor2DImageFilter #2384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PERF: Parallelize ContourExtractor2DImageFilter #2384
Conversation
4e0f48d to
ac684b6
Compare
|
Unfortunately, |
|
Maybe @N-Dekker is willing to extend |
Yes, exactly, except for the zero part. I need to be able to set what value is returned when a pixel is outside of the region. |
|
FWIW, there may be more than one region in play. There's the region #1 that we've been discussing that determines when a pixel value should be ignored and instead the set constant is returned. But, I also have a shaped iterator or range that is traversing a slightly different region #2. Because of its radius and other parameters the region #2 exploration may end up requesting values for individual pixels outside of region #1, and it is those pixels that I want to get the set constant for. Also, in some cases the pixels outside of region #1 might also be outside of the image. I'd like to get the set constant in those cases too, rather than an exception or error. |
Honestly I was not aware of this use case, during the initial development of By default, As far as I can see, If the value for a pixel outside the region shouldn't always be zero, is the value still known at compile-time? If not, how or when is the value estimated? |
|
I like your analysis ... all we need is a new policy!
Runtime. This is being used by a superpixel calculating routine and this step starts with a region of labels. The user can use uchar, int32_t, or float, etc. as labels. Each time there is a clump of pixels with the same value, I want to draw a contour around the entirity of it. I set the border-pixel value to be a value not used as a label by the user, so that border region is always recognized as "other". (In particular, If the the label type is char and the user uses all 256 possible values as labels, the user gets an exception!) |
9e9df05 to
07f0581
Compare
|
@Leengit Still under construction, but please have a look: The idea is that If you're in a hurry, you may just copy https://github.com/N-Dekker/ITK/blob/RegionalConstantBoundaryImageNeighborhoodPixelAccessPolicy/Modules/Core/Common/include/itkRegionalConstantBoundaryImageNeighborhoodPixelAccessPolicy.h and adjust it to your needs. |
|
Thanks @N-Dekker. I have to work on something else now, so I will probably just wait until your code is merged. On a related note, if the |
aef4da6 to
8bc2919
Compare
|
This is now ready for review. By using (Shaped)RegionRange objects instead of (Shaped)RegionIterator objects we're using better code, and we bypass Issue #2387. |
27ecd0e to
ba620c9
Compare
Modules/Filtering/Path/include/itkContourExtractor2DImageFilter.hxx
Outdated
Show resolved
Hide resolved
dzenanz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be merged as-is. Alternatively, the last two commits could be squashed into the other commits.
d96471d to
6025c64
Compare
I squashed them. |
Co-authored-by: Dženan Zukić <dzenan.zukic@kitware.com>
6025c64 to
ca23a2b
Compare
|
I rebased to the current upstream/master, 38dec0a. |
This pull request addresses the same issue as Pull Request #2371 of @dzenanz but I am submitting this new pull request because I am cautious about submitting to his pull request, I've rebased to merged master-branch commits in the same code, and I have built on his code to a fair degree. It is probably best to not merge both that pull request and this pull request.
Much of this code is co-authored with @dzenanz.
PR Checklist