Ticket #662 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Colors :: Split Channels can throw exception

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: Jul-05 to Jul-15
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

In cd09b8c05346c9ed7ada1d755a657c0cfbff0ce8:
Load Leaf, run Image :: Color :: Split Channels
Exception thrown in legacy layer

java.lang.IllegalArgumentException: Argument out of range: 1

at ij.ImageStack.getProcessor(ImageStack.java:250)
at imagej.legacy.LegacyUtils.setDatasetColorData(LegacyUtils.java:513)
at imagej.legacy.DatasetHarmonizer.updateDisplay(DatasetHarmonizer.java:155)
at imagej.legacy.plugin.LegacyPlugin.postPluginHarmonization(LegacyPlugin.java:175)
at imagej.legacy.plugin.LegacyPlugin.run(LegacyPlugin.java:120)
at imagej.plugin.PluginRunner.run(PluginRunner.java:84)
at imagej.plugin.PluginManager$1.run(PluginManager.java:151)
at java.lang.Thread.run(Thread.java:680)

Change History

comment:1 Changed 8 years ago by bdezonia

stepping through with debugger:

  • the three channel images are created correctly
  • the crash happens when its trying to harmonize the original leaf Dataset from the ImagePlus modified by the plugin
  • somehow the original ImagePlus has c,z,t == 1 and a completely empty stack.
  • plugin code does not look like it deletes slices.
  • plugin calls updateAndDraw(). This might cause harmonization while plugin is active (only preharm done up to that point) and the ImagePlus has already been locked.

comment:2 Changed 8 years ago by bdezonia

more debugging:

  • RGBStackSplitter does indeed deleteSlice() from original image unless alt key down. - Putting alt key down does not fix it in IJ2. Do we need to send setKeyDown() and setKeyUp() events to IJ from our keyboard events to support alt and shift and other things that IJ1 can react to. I think so.

comment:3 Changed 8 years ago by bdezonia

In 2ea5999118fe7ce2f7851645dae7bf80d1451089 I added event code to LegacyManager to make sure IJ1 knows status of ALT, SHIFT, CONTROL, and SPACE. Running the split channels with ALT key down runs to completion successfully.

Now in the legacy layer need to handle case where the ImagePlus has been emptied out by IJ1.

comment:4 Changed 8 years ago by bdezonia

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

Fixed in 7a05f757055c3ccf24c7b0afe5eaa5adea1468aa

Note: See TracTickets for help on using tickets.