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

Opened 2012-04-24T09:22:14-05:00

Last modified 2012-08-01T11:23:09-05:00

Clear/Clear Outside misbehaving

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b4-plugins
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1345


open clown
draw overlay
run edit Clear

pixels changed inside roi
(drawn in last color set in IJ2 rather than curr fg/bg values color)
(see OptionsChannels to see that two different values exist)

run edit Clear Outside\

interior roi pixels revert
exterior drawn in last color again
exception thrown:

[ERROR] ImageJ 1.x plugin threw exception
java.lang.IndexOutOfBoundsException: Index: 0, Size: 3

at java.util.ArrayList.rangeCheck(
at java.util.ArrayList.get(
at imagej.ext.display.AbstractDisplay.update(
at imagej.legacy.translate.OverlayHarmonizer.updateDisplay(
at imagej.legacy.translate.Harmonizer.updateDisplay(
at imagej.legacy.plugin.LegacyPlugin.updateDisplaysFromImagePluses(
at java.util.concurrent.FutureTask$Sync.innerRun(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Change History

comment:1 Changed 2012-04-24T10:49:48-05:00 by bdezonia

  • Owner changed from bdezonia to curtis
  • Status changed from new to assigned
  • Milestone changed from imagej-2.0.0-beta2 to imagej-2.0.0-beta3

Lets not worry about the fill value in this ticket. I'll address that elsewhere.

You can get a number of exceptions from this sequence. Clear Outside or Clear work by themselves fine. Its when you do one after the other that exceptions pop up. The following is common. Note its in code recently modified by Tobias and worked on by Grant and Curtis in the past,

[ERROR] Exception during event handling:

context = imagej.ImageJ@20dccfab
consumed = false
object = clown.jpg
[Subscriber] imagej.ui.swing.sdi.display.SwingSdiImageDisplay@7fb2380e
[Method] protected void

java.lang.IllegalArgumentException: Expected 3 converters but got 6

at net.imglib2.display.CompositeXYProjector.<init>(
at imagej.ext.display.AbstractDisplay.update(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(
at org.bushe.swing.event.ThreadSafeEventService.publish(
at org.bushe.swing.event.SwingEventService.access$001(
at org.bushe.swing.event.SwingEventService$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$000(
at java.awt.EventQueue$
at java.awt.EventQueue$
at Method)
at java.awt.EventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(

comment:2 Changed 2012-07-12T17:01:14-05:00 by curtis

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

comment:3 Changed 2012-07-19T21:43:02-05:00 by dscho

  • Blocking 1345 added

comment:4 Changed 2012-07-26T13:43:42-05:00 by bdezonia

Testing post beta 3: The exception error is gone.

Remaining issue: Open clown and draw rect. Run Clear and interior is filled with background (correct). Follow it with Clear Outside. The outer region is filled with background (correct). The interior region is restored to a view of the original clown data (incorrect). In IJ1 the central region stays as the background color from the previous clear.

comment:5 Changed 2012-07-26T15:43:44-05:00 by bdezonia

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

Fixed pixel munging error with commit 1e54c82e0cb643dcd1230aec3f24603ba6a66e36

comment:6 Changed 2012-08-01T11:22:55-05:00 by bdezonia

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:7 Changed 2012-08-01T11:23:03-05:00 by bdezonia

  • Owner changed from curtis to bdezonia
  • Status changed from reopened to assigned

comment:8 Changed 2012-08-01T11:23:09-05:00 by bdezonia

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