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

Opened 2013-05-29T15:27:28-05:00

Last modified 2013-05-30T11:11:18-05:00

Exception in thresholding

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b7-ndim-data
Component: Core Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1563


Open attached file
Change view to 2nd plane
Run adjust threshold
Exception thrown:

[ERROR] Exception during event handling:

[Event] imagej.display.event.DisplayUpdatedEvent
context = org.scijava.Context@561777b1
consumed = false
display = type=interface, name=2-plane.tif, objects={,}
[Subscriber] imagej.ui.DefaultUIService [priority = 0.0]
[Method] protected void imagej.ui.DefaultUIService.onEvent(imagej.display.event.DisplayUpdatedEvent)

java.lang.IllegalArgumentException: invalid position for dimension #0: 1 > 0

at imagej.ui.swing.viewer.image.OverlayFigureView.updateFigure(
at imagej.ui.swing.viewer.image.OverlayFigureView.update(
at imagej.ui.swing.viewer.image.JHotDrawImageCanvas.update(
at imagej.ui.swing.viewer.image.SwingDisplayPanel.redraw(
at imagej.ui.viewer.AbstractDisplayViewer.onDisplayUpdatedEvent(
at imagej.ui.DefaultUIService.onEvent(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(
at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(
at org.bushe.swing.event.ThreadSafeEventService.publish(
at org.scijava.event.DefaultEventBus.access$101(
at org.scijava.event.DefaultEventBus$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEventImpl(
at java.awt.EventQueue.access$400(
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(


2-plane.tif (117.5 KB) - added by bdezonia 2013-05-29T15:27:38-05:00.

Change History

Changed 2013-05-29T15:27:38-05:00 by bdezonia

comment:1 Changed 2013-05-29T15:28:47-05:00 by bdezonia

After some debugging I have some more info. The ThresholdOverlay that gets created seems to start with Z dimension of 2 but eventually goes to Z dimension of 1.

comment:2 Changed 2013-05-30T10:20:03-05:00 by bdezonia

Okay here is the scoop. During the initialization of the Threshold dialog a temp threshold is put in place. It happens to exclude all items in the first plane. During the setRange() call the bounds are invalidated because the Condition of a ConditionalPointSet changed. Thus the next call to dimension(d) recalcs bounds and this time there is only one value for the Z plane. Thus though dims start at 2 they correctly go to 1. Users of this must take the transcience of the dims into account.

comment:3 Changed 2013-05-30T11:11:18-05:00 by bdezonia

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

Fixed with commit 779975c76bd6b4a0edd076ca929ec082e7c2ead8