imglib / imglib2-algorithm

Image processing algorithms for ImgLib2
http://imglib2.net/
Other
22 stars 20 forks source link

Add Op discovery annotations to ImgLib2-algorithm #94

Open gselzer opened 2 years ago

gselzer commented 2 years ago

This PR uses therapi-runtime-javadoc to declare all static functionality in imglib2-alrogithm as Ops. See this test for how these Ops can be called, and the module imglib/imglib2-algorithm-optest for an example of the structure required to call these annotated methods as Ops.

A new dependency on therapi-runtime-javadoc-scribe is added to the maven compiler plugin. For now, this was added to the imglib2-algorithm POM. Once pom-scijava-base 15.0.0 is propagated to imglib2-algorithm, we can remove almost everything added to this POM by this PR.

The only line needed once we depend on that version of pom-scijava-base is this line, which is responsible for informing therapi-runtime-javadoc-scribe of the set of packages it should process. This line must be changed once we bump the version, as the property used is under a different name.

Using therapi-runtime-javadoc-scribe, JSON files are generated for each file containing javadoc in each package specified by therapi.packages

Open questions:

TODO:

gselzer commented 2 years ago

A running list of static methods that do not conform to functional interfaces in scijava-function:

gselzer commented 8 months ago

@ctrueden @tpietzsch I've fully updated this PR such that it now uses (the unreleased) SciJava Ops Indexer. I can now automatically discover all annotated static methods in an environment containing both a local build of imglib2-algorithm and a local build of the SciJava Incubator. The PR will not build until we release the SciJava Ops Indexer, so I've left it as a draft, but bringing this work up-to-date made me excited for the possibilities of SciJava Ops!

hinerm commented 2 months ago

@tpietzsch In this PR we are discussing the minimum Java version to index libraries with Ops. I'm wondering if there is a need to keep imglib2-algorithm at Java 8, or if going to Java 11 is an option?

tpietzsch commented 2 months ago

@hinerm I don't think there is anything that would break with higher Java versions. As soon as Fiji finally moves to Java 21, (all of) ImgLib2 will too.

gselzer commented 1 week ago

TODO:

There are some methods whose signatures do not conform to the Ops style (e.g. here), where I've written a wrapper method that has been opified. The question, then, is what to do with the original methods. Should we consider deprecating them, @ctrueden?