-
Notifications
You must be signed in to change notification settings - Fork 0
Improved thresholding #266
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
Conversation
ctrueden
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.
Before we plunge ahead with this, I'd like to better understand why we need to move away from allowing thresholding on Iterable.
| */ | ||
| public abstract class AbstractApplyThresholdIterable<T> implements | ||
| Computers.Arity1<Iterable<T>, Iterable<BitType>> | ||
| Computers.Arity1<RandomAccessibleInterval<T>, RandomAccessibleInterval<BitType>> |
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.
Why does the change from Iterable to RAI enable better efficiency?
Does the fact that RAI implements IterableInterval in ImgLib2 v7 make a difference in our decision here?
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.
Why does the change from
IterabletoRAIenable better efficiency?
Well, I haven't tested, so better efficiency is probably a stretch to say, however this dependency can now make use of LoopBuilder, which is nice.
Does the fact that
RAIimplementsIterableIntervalin ImgLib2 v7 make a difference in our decision here?
Probably not? There are likely some changes (like this) that could be reverted, but I can't imagine this would break?
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.
I can't imagine this would break?
I wasn't suggesting that this change, together with the ImgLib2 v7 update, would break anything. Rather, I'm wondering if the ImgLib2 v7 update would somehow obviate the need to narrow the scope of the threshold ops from Iterable to RAI.
this dependency can now make use of LoopBuilder, which is nice.
Yep, that's good. But for Iterables generally, there is the spliterator() subsystem, which could potentially enable multithreaded thresholding over any Iterable. Though I suppose the "proxy" behavior of T instances might preclude the ability to loop in parallel that way...
Another option would be to keep the existing thresholding Ops for Iterable and simply add the RAI-specific ones at higher priority. Then we wouldn't need to bump scijava-ops-image to 2.0.0 in response to the backwards incompatibility.
The main problem here is that, for What I realized we could do, though, is something like I did here. The additions of type variables
|
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/52 |
f827f68 to
d3c820e
Compare
By using generics, these Ops are much more flexible
Broadened type variables allow for more efficient iteration over e.g. images
d3c820e to
d061c4d
Compare
|
I've given this PR some TLC - I'm much happier with how things work:
This is no longer the case - I used type variables for more powerful dependency resolution, as I alluded to here:
The |
edefad2 to
ad83c3a
Compare
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/fiji-friends-weekly-dev-update-thread/103718/60 |
This PR makes a few changes that improve the thresholding Ops:
RAI, instead of onIterable- I'm not terribly sure about this change, as it limits the scope of what we can threshold, however it enables better efficiency and I don't think we ever really needed theIterables capability...what do you think @hinerm?Interval -> RAIcreation capabilities - now leans on dependencies to createRAIs of many different element types.