imagej / imagej-ops

ImageJ Ops: "Write once, run anywhere" image processing
https://imagej.net/libs/imagej-ops
BSD 2-Clause "Simplified" License
89 stars 42 forks source link

Make op method extensible - TODO #363

Open lnyng opened 8 years ago

lnyng commented 8 years ago

See #348

As mentioned, the filter namespace and logic namespace were not not refactored in that PR. The reason is that, the filter namespace is still under refactoring (#336), and the logic namespace could crash if such refactoring is applied.

The logic namespace has conflicts between some PrimitiveLogic ops and some generic logic ops (which are typed on T, not T extends Type<T>). For example:

ops().logic().greaterThan(10, 11);         // should it returns BoolType or boolean?

To solve this problem, more work might need to be done. Since I am not currently working on this project, I file this issue just as a reminder.

ctrueden commented 8 years ago

I think we should resolve this now, at least with respect to the logic namespace. To have a clean separation of SciJava Ops, we need logic ops that work on primitives. So the example above should use boolean (or Boolean), not BoolType. With the right Converter implementations, it should be OK. In general, we can probably use BoolType (or BooleanType, whatever) for the computer implementations, while using primitives for the function ones. (I.e.: since Java primitive wrappers are immutable, they can't be used with computers.)