Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scijava/scijava
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: scijava/scijava
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: scijava-ops-image/image-equation
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 1,022 files changed
  • 2 contributors

Commits on May 26, 2026

  1. Implement image.equation op

    This implementation brings back the image.equation Op from ImageJ Ops,
    but using Parsington instead of JavaScript for deterministic evaluation.
    
    - Equation.java — the image.equation Op with a Computer signature
      (String, RandomAccessibleInterval<T>)). Parses the expression once
      into a SyntaxTree, then iterates pixels with a localizing cursor,
      updating position before each evaluation. Any per-pixel runtime error
      yields NaN.
    
    - EquationEvaluator.java — extends Parsington's DefaultTreeEvaluator.
      Exposes p[0..n], x/y/z/t, pi/e, and reflects every public-static
      numeric java.lang.Math method.
    
    - EquationTest.java — 10 tests covering constants, p[i], axis
      shorthands, single- and multi-arg math, pi/e, a 3D image,
      reproducibility, random() distribution, and the NaN-on-bad-expression
      contract.
    
    Adds parsington as a dependency to scijava-ops-image.
    
    Notable design notes:
    - parens(...) returns the single arg unwrapped, or an Object[] for
      multi-arg, so function() can pick Math overloads.
    - brackets(...) returns a marker BracketIndex so function(fn, args)
      can distinguish p[i] from cos(x).
    - Multi-arg function args came through as unresolved Variable tokens;
      resolved via Parsington's value(arg) before reflection.
    - Single-threaded for now — Parsington's evaluator is stateful, and the
      op is documented as a demo helper, so top performance is not critical.
    
    Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
    ctrueden and claude committed May 26, 2026
    Configuration menu
    Copy the full SHA
    2c3c2bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a689e52 View commit details
    Browse the repository at this point in the history
Loading