imagej / imagej/imagej-ops

ApplyConstantThreshold: Not thread-safe

Open
#382 1 comment 0 reactions 1 assignee Claimed by @ctrueden View on GitHub
2016-07-hackathon
Dominant language
Java
Stars
94
Forks
44
PR merge metrics
No merged PRs in 30d

Description

From https://github.com/imagej/imagej-ops/blob/master/src/main/java/net/imagej/ops/special/hybrid/BinaryHybridCFI.java#L81 we see that `Op`s usually are thread-safe. However, https://github.com/imagej/imagej-ops/blob/master/src/main/java/net/imagej/ops/threshold/apply/ApplyConstantThreshold.java#L73 isn't. We can now override `getIndependentInstance` but this implies that _all_ `Op`s which are using this `Op` have to override `getIndependentInstance` (and call it on their children,...).

Any ideas how we can make this smarter? Can the `OpService` help us here?

Christian

PS: In the particular case of `ApplyConstantThreshold` we could introduce a `MapIIandConstantToII` and all others `RAI`. Then we can use a `BinaryMap` in the `ApplyConstantThreshold` which also seems to be more correct in comparison to updating a parameter manually. What do you think @LeonYang5114 @ctrueden?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.