Ticket #427 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

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 8 years ago by curtis

This depends on #379.

comment:2 Changed 8 years ago 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 8 years ago 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 8 years ago 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 8 years ago by bdezonia

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

comment:6 Changed 8 years ago 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 8 years ago by bdezonia

Code in place in 9a22547fef3c50bc1944595e16283412d4913e1a.

comment:8 Changed 8 years ago by bdezonia

Rename in place in fca7e06a9daac55ad25b339fea9a396b2f2c4d1c

comment:9 Changed 8 years ago 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 8 years ago 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 8 years ago by bdezonia

  • Milestone changed from imagej-2.0-beta1 to biweekly-2011: Jul-18 to Jul-29
Note: See TracTickets for help on using tickets.