Ignore:
Timestamp:
12/21/11 23:32:51 (8 years ago)
Author:
aivar
Message:

SLIMPlugin: shows colorized range of values using 254 color palette.

Location:
trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramData.java

    r7847 r7848  
    44 */ 
    55package imagej.slim.histogram; 
     6 
     7import imagej.slim.fitting.IFittedImage; 
    68 
    79/** 
     
    1214 */ 
    1315public class HistogramData { 
     16    private IFittedImage _image; 
    1417    private String _title; 
    1518    private HistogramDataChannel[] _channel; 
     
    2932     * @param channel  
    3033     */ 
    31     public HistogramData(String title, HistogramDataChannel[] channel) { 
     34    public HistogramData(IFittedImage image, String title, 
     35            HistogramDataChannel[] channel) { 
     36        _image = image; 
    3237        _title = title; 
    3338        _channel = channel; 
     
    244249        return new double[] { minLUT, maxLUT }; 
    245250    } 
     251 
     252    public void redisplay() { 
     253        _image.redisplay(); 
     254    } 
    246255     
    247256    public int[] binValues(int bins) { 
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/histogram/HistogramTool.java

    r7847 r7848  
    193193            _histogramPanel.setBins(bins); 
    194194            _colorBarPanel.setMinMax(minView, maxView, minLUT, maxLUT); 
     195            //TODO changed is currently called from two places: 
     196            // i) the HistogramData listener will call it periodically during the 
     197            // fit. 
     198            // ii) if the user types in a new LUT range this gets called. 
     199            // iii) in the future more UI interactions will wind up here 
     200            // 
     201            _histogramData.redisplay(); 
    195202        } 
    196203    } 
     
    204211        public void minMaxChanged(double minView, double maxView, 
    205212                double minLUT, double maxLUT) { 
     213            System.out.println("CHANGED " + minView + " " + maxView + ", " + minLUT + " " + maxLUT); 
    206214            changed(minView, maxView, minLUT, maxLUT); 
    207215        } 
     
    336344                 _histogramData.setAutoRange(autoRange); 
    337345            } 
    338              // turn on/off the cursors 
    339             // they are usually at -1 & 255 
    340             // but if you are autoranging & showing all channels 
    341             // they need to be calculated 
    342             // autorange off, stuff shouldn't change right away 
    343             // autorange on, should calculate new bounds 
     346 
     347            if (autoRange) { 
     348                _histogramPanel.setCursors(null, null); 
     349                //TODO calculate new bounds 
     350            } 
     351            else { 
     352                //TODO if you are autoranging, not combining channels, but showing 
     353                // all channels, these cursors would need to be calculated 
     354                _histogramPanel.setCursors(INSET, INSET + WIDTH - 1); //TODO I was expecting INSET-1 here?? 
     355            } 
    344356        } 
    345357         
Note: See TracChangeset for help on using the changeset viewer.