Ticket #1479 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

Surface Plot doesn't always work

Reported by: bdezonia Owned by: bdezonia
Priority: major Milestone: imagej2-b5-scripting
Component: Legacy Compatibility Version: 2.0.0-beta4
Severity: serious Keywords:
Cc: Blocked By:
Blocking: #1459

Description (last modified by bdezonia) (diff)

Open Organ Of Corti
Split Channels
Select channel 3 image (blue)
Run Analyze :: Surface Plot
Asked if run on all 15 images: say yes
The command does not work and a dialog shows "ImageJ 1.x threw an exception"

This sequence works fine in IJ1 version 1.47a and 1.47c
Also doing a basic surface plot of some loaded sample data does work in IJ2.

Change History

comment:1 Changed 7 years ago by bdezonia

  • Description modified (diff)

comment:2 Changed 7 years ago by bdezonia

  • Blocking 1459 added

comment:3 Changed 7 years ago by bdezonia

After thoroughly debugging this I know the issue. IJ1 is calling imp.show on an ImagePlus that is in an inconsistent state. It has an int[] for the first slice and byte[]'s for the remaining ones. This is due to poor initialization code. It does not affect IJ1 due to some blind luck but does affect IJ2 because we intercept imp.show() and do some processing. I have emailed Wayne a one line initialization fix and have asked him to change code. Awaiting reply.

The proposed fix:

Changing line 70 of SurfacePlotter from this:

stack.addSlice(null, new byte[plot.getWidth()* plot.getHeight()]);

to this:

stack.addSlice(null, plot.duplicate().getPixels());

comment:4 Changed 7 years ago by bdezonia

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

From Wayne: This change is in the ImageJ 1.47d9 daily build

comment:5 Changed 7 years ago by curtis

  • Milestone changed from imagej-2.0.0-beta6 to imagej-2.0.0-beta5-new
Note: See TracTickets for help on using tickets.