Ticket #1367 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Minimize the number of images that get opened by the legacy layer

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b4-plugins
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: G.Landini@… Blocked By:
Blocking: #1170, #1331

Description

Between beta 3 and beta 4 in the ij2 developer mailing list Gabriel Landini reported:

Not sure if this has been flagged before.
When running an IJ1 plugin that creates an ImagePlus but it is not shown, the
same plugin in IJ2 shows the image.

Is this something that can be resolved? If not, it might be impossible or
painfully slow to run IJ1 plugins that create a large number of temporary
ImagePlus but are not shown to be processed and then closed. In IJ2 they are
all shown making the whole process very slow.

Attachments

BinaryReconstruct_.java Download (7.4 KB) - added by bdezonia 7 years ago.
First of two plugins needed to recreate issue
GreyscaleReconstruct_.java Download (6.6 KB) - added by bdezonia 7 years ago.
Second of two plugins needed to recreate problem

Change History

comment:1 Changed 7 years ago by bdezonia

  • Blocking 1170 added

comment:2 Changed 7 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta5 to imagej-2.0.0-beta4

This ticket must target beta4 as long as it blocks #1170.

comment:3 Changed 7 years ago by bdezonia

With commit 2ebd06347ff4412d8274b0fbf52b778d2e598f09 I have optimized ImagePlus tracking to skip those ImagePluses that do not have windows or ImageProcessors associated with them.

Gabriel, please test and let me know if its fixed. Thanks.

comment:4 Changed 7 years ago by bdezonia

Note that the change was to more closely mirror IJ1's behavior in regards to updateAndDraw() and repaintWindow() methods. When ImagePluses have no ImageProcessor set or have no associated window IJ1 does not do anything.

comment:5 Changed 7 years ago by bdezonia

With commit 095765ebb7d5dbc1006d42616c3b8ec0402071fb further optimization in place.

comment:6 Changed 7 years ago by bdezonia

Finalized closing behavior with commit 6244fc0da522e30f82b40a2e7b3a6959546c61d2

comment:7 Changed 7 years ago by bdezonia

Gabriel, I've figured out how to replicate your issue with those plugins. My previous fix was insufficient. I'll debug further.

comment:8 Changed 7 years ago by bdezonia

With commit ddb0441c65f7366e0288f472528e42cd4d3c73e3 the repeated creation of windows has been dispatched. Additional testing required but looks good so far.

Gabriel, I think it is now fixed.

Changed 7 years ago by bdezonia

First of two plugins needed to recreate issue

Changed 7 years ago by bdezonia

Second of two plugins needed to recreate problem

comment:9 Changed 7 years ago by bdezonia

To duplicate issue run GreyscaleReconstruct which itself calls BinaryReconstruct. First create a binary mask and open particles for binary test image. Run the plugin. On IJ1 it works and only ever opens one image. On IJ2 prefix it opened images until memory exhausted. With fix this is no longer the case.

comment:10 follow-up: ↓ 11 Changed 7 years ago by bdezonia

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

comment:11 in reply to: ↑ 10 Changed 7 years ago by landinig

  • Status changed from closed to reopened
  • Resolution fixed deleted

Replying to bdezonia:

Yes, this seems to be resolved. Thank you, Barry.

There is another perhaps associated issue.
If an ImagePlus is asked to be hidden, it does not get hidden.

For example, from a plugin I call the BinaryLabel plugin which creates a new image
called "Labelled" and I try to hide it. In IJ2 it remains open.

This works in IJ1:
IJ.run(imp2,"BinaryLabel ", "white");
IJ.selectWindow("Labelled");
imp5 = IJ.getImage();
ip5=imp5.getProcessor();
imp5.hide();

comment:12 Changed 7 years ago by bdezonia

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

Gabriel, that issue is indeed different. I'll open a new ticket and CC you. Closing this ticket.

comment:13 Changed 7 years ago by bdezonia

  • Blocking 1331 added
Note: See TracTickets for help on using tickets.