Changeset 7990


Ignore:
Timestamp:
04/19/12 15:37:24 (8 years ago)
Author:
aivar
Message:

SLIM Plugin: Trac #700 binning wasn't working. Implemented simple, square binning in sizes 3x3, 5x5, and 7x7.

Location:
trunk/projects/slim-plugin/src/main/java/loci/slim
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/slim-plugin/src/main/java/loci/slim/DecayImageWrapper.java

    r7889 r7990  
    1414import mpicbg.imglib.image.ImageFactory; 
    1515import mpicbg.imglib.io.ImageOpener; 
     16import mpicbg.imglib.outofbounds.OutOfBoundsStrategyMirrorFactory; 
    1617import mpicbg.imglib.type.numeric.RealType; 
    1718import mpicbg.imglib.type.numeric.real.DoubleType; 
     
    4041        _binIndex = binIndex; 
    4142 
     43//        OutOfBoundsStrategyMirrorFactory strategyFactory = new OutOfBoundsStrategyMirrorFactory<T>(); 
     44//        _cursor = image.createLocalizableByDimCursor(strategyFactory); 
    4245        _cursor = image.createLocalizableByDimCursor(); 
    4346    } 
  • trunk/projects/slim-plugin/src/main/java/loci/slim/SLIMProcessor.java

    r7989 r7990  
    6969import loci.formats.ImageReader; 
    7070import loci.slim.analysis.SLIMAnalysis; 
    71 import loci.slim.binning.SLIMBinning; 
     71import loci.slim.process.ISLIMBinner; 
     72import loci.slim.process.SLIMBinning; 
    7273import loci.slim.colorizer.DataColorizer; 
    7374import loci.slim.colorizer.DataColorizer2; 
     
    855856        // set up preprocessor chain 
    856857        IProcessor processor = decayImage; 
     858        ISLIMBinner binner = m_binning.getBinner(uiPanel.getBinning()); 
     859        if (null != binner) { 
     860            binner.init(m_width, m_height); 
     861            binner.chain(processor); 
     862            processor = binner; 
     863        } 
    857864        if (fitInfo.getThreshold() > 0) { 
    858865            IProcessor threshold = new Threshold(fitInfo.getStartDecay(), fitInfo.getStopDecay(), fitInfo.getThreshold()); 
     
    12821289    private Image<DoubleType> fitPixel(IUserInterfacePanel uiPanel, int x, int y) { 
    12831290        Image<DoubleType> fittedPixels = null; 
    1284  
     1291         
     1292        // set up the source 
     1293        IDecayImage decayImage = new DecayImageWrapper(m_image, m_width, m_height, m_channels, m_bins, m_binIndex); 
     1294        IProcessor processor = decayImage; 
     1295        ISLIMBinner binner = m_binning.getBinner(uiPanel.getBinning()); 
     1296        if (null != binner) { 
     1297            binner.init(m_width, m_height); 
     1298            binner.chain(processor); 
     1299            processor = binner; 
     1300        } 
     1301         
     1302        // set up the location 
     1303        int[] location = new int[] { m_x, m_y, m_channel }; 
     1304         
    12851305        // build the data 
    12861306        ArrayList<ICurveFitData> curveFitDataList = new ArrayList<ICurveFitData>(); 
     
    12951315            curveFitData = new CurveFitData(); 
    12961316            curveFitData.setParams(params.clone()); //TODO NO NO NO s/b either from UI or fitted point or fitted whole image 
    1297             yCount = new double[m_bins]; 
    1298             for (int b = 0; b < m_bins; ++b) { 
    1299                 yCount[b] = getData(m_cursor, channel, x, y, b); 
    1300             } 
     1317 
     1318            location[2] = channel; 
     1319            yCount = processor.getPixel(location); 
    13011320            int photons = 0; 
    13021321            for (int c = 0; c < m_bins; ++c) { 
    13031322                photons += yCount[c]; 
    13041323            } 
    1305 //            System.out.println("PHOTONS " + photons); 
     1324            System.out.println("PHOTONS " + photons); 
    13061325             
    13071326            curveFitData.setYCount(yCount); 
Note: See TracChangeset for help on using the changeset viewer.