NOTICE! This is a static HTML version of a legacy ImageJ Trac ticket.

The ImageJ project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Ticket #1228 (closed defect: fixed)

Opened 2012-06-18T15:35:21-05:00

Last modified 2014-05-06T10:14:20-05:00

Add functionality to OPS' EquationParser

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-unscheduled
Component: ImgLib2 OPS Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1632

Description (last modified by bdezonia)

It is a simple matter to enhance the OPS' equation syntax by adding more unary functions to the unary operation packages and then adding their signature to reservedWordLookup() in OP's parse subpackage Lexer class.

By enhancing the language we make ImageJ2's Process > Math > Equation command more powerful. We also add power to Imglib OPS' TextSpecifiedPointSet class.

We could look at other packages to see common functions we do not yet support. Some such packages to consider would be numpy, scipy, gnu scientific library, the jscience library, apache commons math, etc.

Some functions already of interest might be sigmoid, logit, logistic, harmonic oscialltor, gamma, and exp2 (is this just 2x?).

Change History

comment:1 Changed 2012-07-03T15:12:12-05:00 by bdezonia

Another simple extension: "tmin" and "tmax" which return the min and max possible values for the type of the input image. For instance a 16 bit unsigned image would return 0 for tmin and 65535 for tmax.

comment:2 Changed 2012-07-16T10:21:32-05:00 by bdezonia

And another function: step(x). step(x) = 0 if x < 0 and 1 otherwise. This matches Mathematica's implementation of the Heaviside Step Function. Note that step(0) == 1 here while using the textbook definition it should == 0.5.

Last edited 2012-07-16T10:38:19-05:00 by bdezonia

comment:3 Changed 2012-07-16T10:22:09-05:00 by bdezonia

See also ticket #1314

comment:4 Changed 2012-07-16T15:38:20-05:00 by bdezonia

  • Blocking 1333 added

comment:5 Changed 2012-07-23T12:25:08-05:00 by bdezonia

  • Description modified

comment:6 Changed 2012-07-23T13:49:02-05:00 by bdezonia

With imglib commit 0b39355b34f3dbb395f8b8033a358b248323940d tmin, tmax, and step added as equation tokens.

comment:7 Changed 2012-09-07T11:25:34-05:00 by bdezonia

  • Blocking 1460 added; 1333 removed
  • Milestone changed from imagej-2.0.0-beta4 to imagej-2.0.0-beta5

comment:8 Changed 2012-10-16T14:55:14-05:00 by bdezonia

Other funcs to add: min(x,y) (or x min y), max(x,y) or (x max y).

comment:9 Changed 2012-10-17T12:37:22-05:00 by bdezonia

With imglib commit d80e2a8dc8d34054fb5ef2fe961c6bc081de60f3 min() and max() added to equation language

Last edited 2012-10-17T12:37:54-05:00 by bdezonia

comment:10 Changed 2013-01-23T09:44:47-06:00 by bdezonia

  • Blocking 1632 added; 1460 removed
  • Milestone changed from imagej2-b7-ndim-data to imagej2-unscheduled

comment:11 Changed 2014-05-06T10:14:20-05:00 by curtis

  • Status changed from new to closed
  • Resolution set to fixed

ImgLib2 OPS has been supplanted by ImageJ OPS. The  ImageJ OPS equation op cheats by using Javascript, so the syntax is very powerful at the expense of performance. That's good enough for me for now, and with the ImageJ OPS framework it is always possible to add other higher-priority special case ops for performance, should it become necessary.