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: | |
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.