Ticket #1897 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

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

Description

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 = imagej.data.display.DefaultImageDisplay@1691a0c3: type=interface imagej.data.display.DataView, name=2-plane.tif, objects={imagej.data.display.DefaultDatasetView@5422fe09, imagej.data.display.DefaultOverlayView@27299442}
[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.data.Position.setPosition(Position.java:337)
at imagej.data.display.AbstractDataView.getPlanePosition(AbstractDataView.java:131)
at imagej.ui.swing.tools.overlay.DefaultJHotDrawAdapter.updateFigure(DefaultJHotDrawAdapter.java:140)
at imagej.ui.swing.tools.overlay.DefaultJHotDrawAdapter.updateFigure(DefaultJHotDrawAdapter.java:1)
at imagej.ui.swing.viewer.image.OverlayFigureView.updateFigure(OverlayFigureView.java:202)
at imagej.ui.swing.viewer.image.OverlayFigureView.update(OverlayFigureView.java:185)
at imagej.ui.swing.viewer.image.JHotDrawImageCanvas.update(JHotDrawImageCanvas.java:445)
at imagej.ui.swing.viewer.image.SwingDisplayPanel.redraw(SwingDisplayPanel.java:210)
at imagej.ui.viewer.AbstractDisplayViewer.onDisplayUpdatedEvent(AbstractDisplayViewer.java:111)
at imagej.ui.DefaultUIService.onEvent(DefaultUIService.java:481)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:248)
at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:223)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)
at org.scijava.event.DefaultEventBus.access$101(DefaultEventBus.java:60)
at org.scijava.event.DefaultEventBus$1.run(DefaultEventBus.java:200)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:708)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:669)
at java.awt.EventQueue$2.run(EventQueue.java:667)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:678)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Attachments

2-plane.tif Download (117.5 KB) - added by bdezonia 6 years ago.

Change History

Changed 6 years ago by bdezonia

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

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

Fixed with commit 779975c76bd6b4a0edd076ca929ec082e7c2ead8

Note: See TracTickets for help on using tickets.