← 输入框|github.com|刷新
Skip to content

Missing image.equation function from imagej-ops #287

Open

Description

@elevans

I'm working through converting the ImageJ/Fiji script templates to use SciJava Ops. The Richardson-Lucy Total Variation deconvolution imagej-ops Groovy script uses the equation function in the image namespace to create a grid image:

grid_img = ops.run("create.img", [x_dim, y_dim], new FloatType())
formula = "p[0]^2 * p[1]"
ops.image().equation(grid_img, formula)

If I remember correctly the equation function depends on JavaScript (Nashorn) which may complicate things. I'm not necessarily advocating that we add this to SciJava Ops, and as I understand it this is not a highly used function.

Activity

  1. gselzer commented on May 26, 2026

    @gselzer
    Member

    If I remember correctly the equation function depends on JavaScript (Nashorn) which may complicate things.

    Your memory is correct! Here's the commit where it was deleted.

    I'm not necessarily advocating that we add this to SciJava Ops, and as I understand it this is not a highly used function.

    I think this could actually be a fun Op to write. You could imagine an Op that:

  2. ctrueden commented on May 26, 2026

    @ctrueden
    Member

    I pushed a branch implementing image.equation with Parsington. All tests pass when compiled, including newly crafted unit tests, but I was unable to test manually in IntelliJ, due to the dreaded org.scijava.ops.api.OpMatchingException: No Ops found matching this request. When I look for ops.yaml in scijava-ops-image, I find nothing:

    $ find . -name ops.yaml
    ./scijava-ops-flim/target/classes/ops.yaml
    ./scijava-ops-flim/target/test-classes/ops.yaml
    ./scijava-ops-engine/target/test-classes/ops.yaml
    ./scijava-ops-benchmarks/target/classes/ops.yaml
    ./scijava-ops-benchmarks/target/test-classes/ops.yaml
    ./scijava-ops-opencv/target/classes/ops.yaml
    ./scijava-ops-opencv/target/test-classes/ops.yaml
    ./scijava-ops-opencv/src/main/resources/ops.yaml
    ./scijava-ops-tutorial/target/classes/ops.yaml
    ./scijava-ops-tutorial/target/test-classes/ops.yaml
    

    @gselzer Any hints on why the new Op is getting discovered for the unit tests, but not in my IDE?

  3. gselzer commented on May 27, 2026

    @gselzer
    Member

    @ctrueden I'm not sure in your case, but it might have to do with IntelliJ doing the builds. I do know that IntelliJ's Build -> Build Project is (currently) incapable of generating ops.yaml files. Here's what I tried:

    1. git checkout scijava-ops-image/image-equation. mvn clean install. Build completes with passing tests. EquationTest fails in IntelliJ. CreateImgTest (arbitrarily chosen) fails in IntelliJ
    2. git checkout main. mvn clean install. Build completes with passing tests. CreateImgTest passes in IntelliJ.
    3. git checkout scijava-ops-image/image-equation^. mvn clean install. Build completes with passing tests. EquationTest passes in IntelliJ. CreateImgTest passes in IntelliJ.
    4. git checkout scijava-ops-image/image-equation. mvn clean install. Build completes with passing tests. EquationTest passes in IntelliJ. CreateImgTest passes in IntelliJ
    5. IntelliJ Build -> Build Project. EquationTest fails in IntelliJ.

    In the past, I always found a CLI build necessary when I wrote a new Op. So maybe see if IntelliJ is automatically building or something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions