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

Opened 2012-08-15T13:42:14-05:00

Last modified 2012-08-23T12:16:17-05:00

Type changing can throw an exception

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

Description

Now that grayscale conversion code is in place the type changing process can cause an exception to be thrown.

Open clown
Change type to unsigned 8 bit
Things look correct but exception thrown (below)
It looks like the view thinks a channel axis should be present when it no longer is

Exception during event handling:

[Event] imagej.data.event.DatasetRGBChangedEvent
context = imagej.ImageJ@67a53697
consumed = false
object = clown.jpg
[Subscriber] imagej.data.display.DefaultImageDisplay@3bc56049
[Method] protected void imagej.data.display.DefaultImageDisplay.onEvent(imagej.data.event.DataUpdatedEvent)

java.lang.ArrayIndexOutOfBoundsException: 2

at net.imglib2.img.ImgPlus.axis(ImgPlus.java:281)
at imagej.data.DefaultDataset.axis(DefaultDataset.java:356)
at imagej.data.CombinedInterval.axis(CombinedInterval.java:170)
at imagej.data.CombinedInterval.axes(CombinedInterval.java:176)
at imagej.data.CombinedInterval.getAxes(CombinedInterval.java:133)
at imagej.data.display.DefaultImageDisplay.getAxes(DefaultImageDisplay.java:268)
at imagej.data.display.DefaultImageDisplay.update(DefaultImageDisplay.java:254)
at imagej.data.display.DefaultImageDisplay.onEvent(DefaultImageDisplay.java:604)
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 imagej.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:229)
at imagej.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:204)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)
at imagej.event.DefaultEventBus.access$101(DefaultEventBus.java:61)
at imagej.event.DefaultEventBus$1.run(DefaultEventBus.java:200)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
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)

Change History

comment:1 Changed 2012-08-15T14:22:50-05:00 by bdezonia

  • Blocking 1345 added

Note that results are correct and exception does not interfere with their display. This is not a showstopper bug.

comment:2 Changed 2012-08-23T12:16:17-05:00 by bdezonia

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

Fixed with commit cb7f57a892c055adffa3a3a853538151eb1b408f