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

Opened 2011-09-26T13:18:46-05:00

Last modified 2011-09-28T10:49:02-05:00

Exception bug when adding an axis to an image

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b1-initial
Component: Display API Version:
Severity: serious Keywords:
Cc: Blocked By:


If you add an axis to an image it is possible to get an exception trace in SwingImageDisplay::makeLabel().

Change History

comment:1 Changed 2011-09-26T13:27:38-05:00 by bdezonia

This bug can be hard to duplicate. I tend to have luck adding an axis to the Boats sample image but it only fails occasionally.

Note - my earlier label of SwingImageDisplay is not right. It is SwingDisplayPanel.

I have debugged this far enough to see that there is a race condition between the SwingDisplayPanel::makeLabel() code and code elsewhere that updates the view that owns the Dataset that is changing.

Basically it is possible for the dataset dims and the view's plane position to be out of sync and incompatible. We can add innoculation code here to make sure data is always compatible but that is not the best fix.

Best would be to avoid the race condition altogether. The problem happens when SwingImageDisplay initiates a setZoom() call due to a DatasetRestructuredEvent. The ZoomEvent is handled in SwingDisplayPanel where it calls makeLabel(). The code from SwingImageDisplay is tagged with warnings about timing issues. Might be best to fix the call there.

comment:2 Changed 2011-09-26T13:49:23-05:00 by bdezonia

Removing the panReset() and setZoom() code from SwingImageDisplay fixes this bug but resurrects 605 & 627. Need to find a solution that works for all three!

comment:3 Changed 2011-09-26T13:49:49-05:00 by bdezonia

For reference: #605 & #627

comment:4 follow-up: ↓ 6 Changed 2011-09-27T16:49:25-05:00 by bdezonia

It turns out #695 and #627 were resurrected without regard to panReset() and panZoom(). Will eliminate these calls.

comment:5 Changed 2011-09-28T10:39:20-05:00 by bdezonia

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

Fixed in 4d1d8f1f6b2cfcf70d0e197055e8e4c98019618f

comment:6 in reply to: ↑ 4 Changed 2011-09-28T10:49:02-05:00 by bdezonia

Replying to bdezonia:

It turns out #695 and #627 were resurrected without regard to panReset() and panZoom(). Will eliminate these calls.

Typo: not #695 but #605.

So it should refer to #605 & #627