Ignore:
Timestamp:
12/13/11 19:17:07 (8 years ago)
Author:
aivar
Message:

Still working on fitted images.

Location:
trunk/projects/slim-plugin/src/main/java/imagej/slim/fitting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/fitting/AbstractBaseFittedImage.java

    r7832 r7833  
    66package imagej.slim.fitting; 
    77 
     8import java.awt.event.FocusEvent; 
     9import java.awt.event.FocusListener; 
     10import java.awt.image.IndexColorModel; 
     11 
    812//import ij.process.MyFloatProcessor; //TODO IJ hack; update to IJ2 ImgLib 
    913import ij.ImagePlus; 
     
    1216import imagej.slim.histogram.HistogramData; 
    1317import imagej.slim.histogram.HistogramDataChannel; 
     18import imagej.slim.histogram.HistogramTool; 
    1419 
    1520/** 
     
    3540        _histogramData = new HistogramData(title, histogramDataChannels); 
    3641        _image = new FloatProcessor(x, y); 
     42        _image.setColorModel(imagej.slim.histogram.HistogramTool.getIndexColorModel()); 
    3743        _imagePlus = new ImagePlus(title, _image); 
    3844        _imagePlus.show(); 
     45        _imagePlus.getWindow().addFocusListener(new FocusListener() { 
     46            public void focusGained(FocusEvent e) { 
     47                HistogramTool.getInstance().setHistogramData(_histogramData); 
     48            } 
     49             
     50            public void focusLost(FocusEvent e) { 
     51                 
     52            } 
     53        });   
    3954    } 
    4055 
     
    4762        return _title; 
    4863    } 
     64     
     65     /** 
     66     * Sets the color model used to display float values. 
     67     *  
     68     * @param colorModel  
     69     */    
     70    public void setColorModel(IndexColorModel colorModel) { 
     71        _image.setColorModel(colorModel); 
     72    }     
    4973     
    5074    /** 
     
    89113            // update palette bounds 
    90114            _image.setMinAndMax(minMax[0], minMax[1]); 
     115            System.out.println("min max " + minMax[0] + " " +  minMax[1]); 
    91116        } 
     117        else System.out.println("min max null"); 
    92118//        System.out.println("min max " + minMax[0] + " " + minMax[1]); 
    93119        // etc. 
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/fitting/FLIMImageFitter.java

    r7830 r7833  
    1010import imagej.slim.fitting.engine.IFittingEngine; 
    1111import imagej.slim.fitting.engine.ThreadedFittingEngine; 
     12import imagej.slim.histogram.HistogramTool; 
    1213 
    1314/** 
     
    4041            IFittedImage fittedImage = FLIMFittedImageFactory.getInstance().createImage(image, dimension, components); 
    4142            _fittedImages.add(fittedImage); 
    42         }  
     43        } 
     44         
     45        // Show histogram tool for the last image created 
     46        int lastIndex = images.length - 1; 
     47        HistogramTool.getInstance().setHistogramData(_fittedImages.get(lastIndex).getHistogramData()); 
    4348    } 
    4449     
     
    4853    public void beginFit() { 
    4954        for (IFittedImage fittedImage : _fittedImages) { 
     55            //fittedImage.setColorModel(HistogramTool.getLUT()); //TODO getIndexColorModel()); //TODO all the same really as far as I can tell, i.e. broken 
    5056            fittedImage.beginFit(); 
    5157        } 
  • trunk/projects/slim-plugin/src/main/java/imagej/slim/fitting/IFittedImage.java

    r7830 r7833  
    55 
    66package imagej.slim.fitting; 
     7 
     8import java.awt.image.IndexColorModel; 
    79 
    810import imagej.slim.histogram.HistogramData; 
     
    1315 */ 
    1416public interface IFittedImage { 
     17     
     18    /** 
     19     * Gets the title of this image. 
     20     *  
     21     * @return title 
     22     */ 
     23    public String getTitle(); 
     24     
     25    /** 
     26     * Sets the color model used to display float values. 
     27     *  
     28     * @param colorModel  
     29     */ 
     30    public void setColorModel(IndexColorModel colorModel); 
    1531 
    1632    /** 
    1733     * Gets the associated histogram data object. 
     34     *  
    1835     * @return 
    1936     */ 
Note: See TracChangeset for help on using the changeset viewer.