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 #427 (closed defect: fixed)

Opened 2011-04-04T14:26:54-05:00

Last modified 2011-07-29T18:03:55-05:00

Make some Process > Math plugins have preview ability

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: Jul-18 to Jul-29
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By:


In IJ1 some of the Process > Math plugins allowed one to preview the results of a proposed value change before committing to it. This avility is absent from IJ2. Note that the Preview checkbox is present on those plugins' input dialogs but no code uses it.

Change History

comment:1 Changed 2011-04-29T10:39:51-05:00 by curtis

This depends on #379.

comment:2 Changed 2011-07-26T13:42:14-05:00 by bdezonia

An initial implementation is in 277fb26ba3871eafb7239c9e38cc1f75ee26466b.

Note that there are two issues:

1) During each preview the display refreshes many times (maybe once per dialog item?). It also may be the case that the Dataset save and restore code within each plugin is calling update() when it could be avoided.

2) The plugins cannot detect when cancel was selected. Thus if user choose Math::Add, selects preview, fill in value (such as 22), and then cancels the dialog the +22 has been applied to the Dataset already (and the data is wrong). Might need to extend PreviewPlugin to have a cancel() method so that we can cleanup.

comment:3 Changed 2011-07-26T15:47:23-05:00 by curtis

Regarding the second issue, PreviewPlugin now provides a cancel() method in 9adfe9d21522060645e4ab576b0983a9b5297e02. We will need to implement these on a plugin-by-plugin basis, though.

comment:4 Changed 2011-07-28T12:08:22-05:00 by bdezonia

Creating AbstractPreviewablePlugin and subclassing to handle preview in the plugins.

Note that in IJ1 only the Roi rectangle area is transformed by these plugins. Must make these plugins support regions after the IJ2 Roi code is in place.

comment:5 Changed 2011-07-28T12:34:07-05:00 by bdezonia

Hatched separate ticket (#696) for the issue of not transforming the roi rectangle region only

comment:6 Changed 2011-07-28T12:50:04-05:00 by curtis

Please call the abstract class AbstractPreviewPlugin, since it implements PreviewPlugin. Either that, or if you strongly prefer the other name, we can rename the interface to PreviewablePlugin. But it should be consistent.

comment:7 Changed 2011-07-28T14:12:31-05:00 by bdezonia

Code in place in 9a22547fef3c50bc1944595e16283412d4913e1a.

comment:8 Changed 2011-07-28T14:14:31-05:00 by bdezonia

Rename in place in fca7e06a9daac55ad25b339fea9a396b2f2c4d1c

comment:9 Changed 2011-07-28T14:58:27-05:00 by bdezonia

A couple issues:

  • the module api calls preview() once per number of widgets on input panel: too much!
  • if you set the slider of T1 Head dataset in the middle, start the Add... dialog, select 99, and preview you can see plane is not munged. Cancel. You can see plane 0 was munged by 99 and not unmunged via cancel.

comment:10 Changed 2011-07-28T18:00:42-05:00 by bdezonia

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

Last issue fixed in e8af5ec592cdd743dd11d8797a07bf16b9bbe783.

We could remove preview checkbox from the math plugins. However I think there are good reasons not to. If the checkbox were gone the preview wouldn't happen unless you entered a value and tabbed away from the field (to OK or Cancel). It's easier to just check the box.

comment:11 Changed 2011-07-29T18:03:55-05:00 by bdezonia

  • Milestone changed from imagej-2.0-beta1 to biweekly-2011: Jul-18 to Jul-29