Ticket #1951 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Image / Duplicate inadvertantly sets ImgPlus.channelMax to 0

Reported by: leek Owned by: leek
Priority: major Milestone: imagej2-b8-analysis
Component: Core Version:
Severity: minor Keywords:
Cc: bdezona Blocked By:
Blocking:

Description

When you use the Image / Duplicate command, the DefaultSamplerService calls createOutputImage which calls displayService.createDisplay which calls DefaultDatasetView.autoscale. At this point, all values for the ImgPlus are zero, so ImgPlus.channelMax gets set to 0 for all channels.

The code then calls DefaultSamplerService.copyData. Any subsequent calls to DefaultDataService.autoscale will believe that the imgPlus min and max have already been correctly calculated and will incorrectly use a maximum of zero.

I have a fix for this that I'll check in momentarily - copyData sets the channel minimum and maximum to NaN to force recalculation which is a conservative approach.

Change History

comment:1 Changed 6 years ago by leek

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

comment:2 Changed 6 years ago by leek

Checkin was 1cef2e7dce6f0677bd54726b42a1d397fb9cce92

Note: See TracTickets for help on using tickets.