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

Opened 2013-07-15T12:07:38-05:00

Last modified 2013-07-15T12:24:47-05:00

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:


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 2013-07-15T12:09:05-05:00 by leek

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

comment:2 Changed 2013-07-15T12:24:47-05:00 by leek

Checkin was 1cef2e7dce6f0677bd54726b42a1d397fb9cce92