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 #515 (closed enhancement: fixed)

Opened 2011-05-12T16:24:33-05:00

Last modified 2011-09-02T13:40:32-05:00

Performance improve OPS

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b1-initial
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

IJ2 relies on the performance of OPS' AssignOperation. That class works on an array of input images modifying an output image. It is very general which may be costing us performance.

I have created a TransformOperation class in OPS that just modifies an Image in place (no other input images) and requires a UnaryOperator to apply to the input values. This should be faster. Incorporate its use in IJ2.

Note that further improvement of TransformOperation can happen if we break out a Condition into PositionalCondition and ValueCondition (since right now the TransformOperation has to call getPosition() on its iterator at every pixel to pass to a condition that may not even check the position). If we do this we can write a few transfrom operations that take various types of conditions. This would basically be trading generality for specificity to obtain performance.

Change History

comment:1 Changed 2011-05-27T16:34:32-05:00 by bdezonia

Ideally I'd like to construct a TransformOperation and tag it with a Condition which could be of three different types (ValueCondition, PositionCondition, and GeneralCondition which does both things). The operation can only have one condition defined. Setting any condition sets the others to null.

Then optimize the execute() loop to do the minimum amount of work (i.e. no iterator.getPosition() if no condition defined or only a ValueCondition defined). This avoids class explosion at the cost of some messiness in TransformOperation.

comment:2 Changed 2011-06-22T12:15:17-05:00 by bdezonia

Integrated TransformOperation into IJ2 as of c4ab8456e356cc873b4b00e5e1905b8dff78a631. I have not broken out separate position and value conditions. That optimization can happen later.

comment:3 Changed 2011-09-02T13:40:32-05:00 by bdezonia

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

Some time ago a whole new implementation of OPS was committed. This ticket is no longer valid.