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

Opened 2011-05-20T10:08:05-05:00

Last modified 2011-05-20T13:46:54-05:00

Exceptions thrown with 12-bit revert

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: biweekly-2011: May-09 to May-20
Component: Legacy Compatibility Version:
Severity: serious Keywords:
Cc: Blocked By:
Blocking:

Description

Open Bridge sample. Convert type to 12-bit. Do File::Revert. Multiple exceptions thrown. One looks like perhaps a concurrent access issue. The following one is a class cast exception in Imglib. The screen is not updated to reflect that data is 8-bit again.


First exception:


Exception thrown by;EventService subscriber:imagej.display.DatasetView$3@4fe2fe5d. Subscriber class:class imagej.display.DatasetView$3
org.bushe.swing.exception.SwingException: Exception handling event topic event class=imagej.data.event.DatasetUpdatedEvent, event=imagej.data.event.DatasetUpdatedEvent@26f04d94, topic=null, eventObj=null
org.bushe.swing.exception.SwingException: Exception handling event topic event class=imagej.data.event.DatasetUpdatedEvent, event=imagej.data.event.DatasetUpdatedEvent@26f04d94, topic=null, eventObj=null

at org.bushe.swing.event.ThreadSafeEventService.handleException(ThreadSafeEventService.java:2021)
at org.bushe.swing.event.ThreadSafeEventService.handleException(ThreadSafeEventService.java:2009)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:975)
at org.bushe.swing.event.SwingEventService.access$001(SwingEventService.java:31)
at org.bushe.swing.event.SwingEventService$1.run(SwingEventService.java:88)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:678)
at java.awt.EventQueue.access$000(EventQueue.java:86)
at java.awt.EventQueue$1.run(EventQueue.java:639)
at java.awt.EventQueue$1.run(EventQueue.java:637)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:648)
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)


Second Exception:


Caused by: java.lang.ClassCastException: net.imglib2.img.basictypeaccess.array.ByteArray cannot be cast to net.imglib2.img.basictypeaccess.BitAccess

at net.imglib2.type.numeric.integer.Unsigned12BitType.updateContainer(Unsigned12BitType.java:87)
at net.imglib2.img.planar.PlanarRandomAccess.<init>(PlanarRandomAccess.java:73)
at net.imglib2.img.planar.PlanarImg.randomAccess(PlanarImg.java:231)
at net.imglib2.img.planar.PlanarImg.randomAccess(PlanarImg.java:1)
at net.imglib2.img.ImgPlus.randomAccess(ImgPlus.java:113)
at net.imglib2.display.CompositeXYProjector.map(CompositeXYProjector.java:107)
at imagej.display.DatasetView$3.onEvent(DatasetView.java:301)
at imagej.display.DatasetView$3.onEvent(DatasetView.java:1)
at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)

Change History

comment:1 Changed 2011-05-20T11:13:38-05:00 by bdezonia

  • Status changed from new to accepted

Pretty sure I've got it. The DataHarmonizer is setting plane references on return from plugin. However in this case the 12-bit image has an associated 8-bit ImagePlus. So the 12 bit planes (which should be in[]) are getting assigned 8 bit planes (byte[]) and that causes the cast exceptions in Imglib.

Need to update the harmonizer to do things intelligently (i.e. not assign plane if types are different).

Another issue: the legacy layer needs to forget an ImagePlus if a Dataset type changes to something not supported by IJ1.

comment:2 Changed 2011-05-20T11:58:23-05:00 by bdezonia

Fixed the DatsetHarmonizer to copy pixels by value if the plane types of the Dataset and ImagePlus are not compatible.

comment:3 Changed 2011-05-20T13:46:54-05:00 by bdezonia

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

Closing this ticket and opening a series of related tickets