Ignore:
Timestamp:
01/11/12 20:38:35 (8 years ago)
Author:
aivar
Message:

Refactoring

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

Legend:

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

    r7864 r7865  
    8282 
    8383// Kludge in the new stuff: 
    84 import imagej.slim.fitting.OutputImageParser; 
     84import imagej.slim.fitting.FitInfo; 
     85import imagej.slim.fitting.IInputImage; 
     86import imagej.slim.fitting.IOutputImage; 
     87import imagej.slim.fitting.images.ColorizedImageParser; 
    8588import imagej.slim.fitting.params.IGlobalFitParams; 
    8689import imagej.slim.fitting.params.LocalFitParams; 
     
    9194import imagej.slim.fitting.config.Configuration; 
    9295import imagej.slim.fitting.FitInfo; 
    93 import imagej.slim.fitting.FLIMImageFitter; 
    94 import imagej.slim.fitting.FLIMImageFitter.OutputImage; 
     96import imagej.slim.fitting.images.ColorizedImageFitter; 
     97import imagej.slim.fitting.images.ColorizedImageFitter.ColorizedImageType; 
    9598import imagej.slim.fitting.FitInfo.FitAlgorithm; 
    9699import imagej.slim.fitting.FitInfo.FitFunction; 
     
    661664                case EACH: 
    662665                    // fit every pixel 
    663                     fittedImage = fitEachPixelXYZ(uiPanel); 
     666                    fittedImage = fitAllPixels(uiPanel); 
    664667                    break; 
    665668            } 
     
    682685        fitInfo.setAnalysisList(uiPanel.getAnalysisList()); 
    683686        fitInfo.setFitAllChannels(uiPanel.getFitAllChannels()); 
    684         fitInfo.setStart(uiPanel.getStart()); 
    685         fitInfo.setStop(uiPanel.getStop()); 
     687        fitInfo.setStartDecay(uiPanel.getStart()); 
     688        fitInfo.setStopDecay(uiPanel.getStop()); 
    686689        fitInfo.setThreshold(uiPanel.getThreshold()); 
    687690        fitInfo.setChiSquareTarget(uiPanel.getChiSquareTarget()); 
    688         fitInfo.setBinning(uiPanel.getBinning()); 
    689          
     691        fitInfo.setBinning(uiPanel.getBinning());    
    690692        fitInfo.setX(uiPanel.getX()); 
    691693        fitInfo.setY(uiPanel.getY()); 
    692694        fitInfo.setParameterCount(uiPanel.getParameterCount()); 
    693          
    694          
    695695        fitInfo.setParameters(uiPanel.getParameters()); 
    696696        fitInfo.setFree(uiPanel.getFree()); 
     
    699699    } 
    700700     
    701     private void newFitData(IGrayScaleImage grayScalePanel, IUserInterfacePanel uiPanel) { 
    702         Image<DoubleType> fittedImage = null; 
    703         FitInfo fitInfo = new FitInfo(); 
    704    
    705         // only one fit at a time 
    706         synchronized (m_synchFit) { 
    707              
    708         } 
    709         m_channel        = grayScalePanel.getChannel(); 
    710  
    711         m_region         = uiPanel.getRegion(); // this is either SUMMED/ROI/POINT/EACH -- which type of fit 
    712         m_algorithm      = uiPanel.getAlgorithm(); 
    713         m_function       = uiPanel.getFunction(); 
    714         m_fitAllChannels = uiPanel.getFitAllChannels(); 
    715  
    716         m_x              = uiPanel.getX(); 
    717         m_y              = uiPanel.getY(); 
    718         m_startBin       = uiPanel.getStart(); 
    719         m_stopBin        = uiPanel.getStop(); 
    720         m_threshold      = uiPanel.getThreshold(); 
    721  
    722         m_param          = uiPanel.getParameters(); 
    723         m_free           = uiPanel.getFree(); 
    724     } 
     701    private IInputImage wrapInputImage() { 
     702        IInputImage returnValue = null; 
     703        return returnValue; 
     704    } 
     705     
     706    private IOutputImage wrapOutputImage() { 
     707        IOutputImage returnValue = null; 
     708        return returnValue; 
     709    } 
     710 
    725711 
    726712    /* 
     
    10761062         
    10771063        //TODO new style code starts only here: 
    1078         FLIMImageFitter imageFitter = new FLIMImageFitter(); 
     1064        ColorizedImageFitter imageFitter = new ColorizedImageFitter(); 
    10791065        int components = 0; 
    10801066        boolean stretched = false; 
     
    10941080        } 
    10951081        String outputs = uiPanel.getFittedImages(); 
    1096         OutputImageParser parser = new OutputImageParser(outputs, components, stretched); 
    1097          
    1098         OutputImage[] outputImages = parser.getOutputImages(); 
     1082        ColorizedImageParser parser = new ColorizedImageParser(outputs, components, stretched); 
     1083         
     1084        ColorizedImageType[] outputImages = parser.getColorizedImages(); 
    10991085        imageFitter.setUpFit(outputImages, new int[] { m_width, m_height }, components); 
    11001086        imageFitter.beginFit(); 
     
    11851171     * are updated at the end of this function. 
    11861172     */ 
    1187     private void processPixels(ICurveFitData[] data, ChunkyPixel[] pixels, FLIMImageFitter imageFitter) { 
     1173    private void processPixels(ICurveFitData[] data, ChunkyPixel[] pixels, ColorizedImageFitter imageFitter) { 
    11881174        if (null == _fittingEngine) { 
    11891175            _fittingEngine = Configuration.getInstance().getFittingEngine(); 
     
    12501236        IGlobalFitParams globalFitParams; 
    12511237        List<ILocalFitParams> localFitParams = new ArrayList<ILocalFitParams>(); 
    1252         FLIMImageFitter imageFitter; //it's confusing to have both an imageFitter and a fittingEngine 
     1238        ColorizedImageFitter imageFitter; //it's confusing to have both an imageFitter and a fittingEngine 
    12531239       
    12541240        return null; 
    12551241    } 
    12561242 
    1257     private Image<DoubleType> fitEachPixelXYZ(IUserInterfacePanel uiPanel) { 
     1243    private Image<DoubleType> fitAllPixels(IUserInterfacePanel uiPanel) { 
    12581244        long start = System.nanoTime(); 
    12591245        int pixelCount = 0; 
     
    12941280         
    12951281        //TODO new style code starts only here: 
    1296         FLIMImageFitter imageFitter = new FLIMImageFitter(); 
     1282        ColorizedImageFitter imageFitter = new ColorizedImageFitter(); 
    12971283        int components = 0; 
    12981284        boolean stretched = false; 
     
    13121298        } 
    13131299        String outputs = uiPanel.getFittedImages(); 
    1314         OutputImageParser parser = new OutputImageParser(outputs, components, stretched); 
    1315          
    1316         OutputImage[] outputImages = parser.getOutputImages(); 
    1317         imageFitter.setUpFit(outputImages, new int[] { m_width, m_height }, components); 
     1300        ColorizedImageParser parser = new ColorizedImageParser(outputs, components, stretched); 
     1301         
     1302        ColorizedImageType[] colorizedImages = parser.getColorizedImages(); 
     1303        imageFitter.setUpFit(colorizedImages, new int[] { m_width, m_height }, components); 
    13181304        imageFitter.beginFit();        
    13191305 
     
    13901376     * @param imageFitter  
    13911377     */ 
    1392     private void processPixels(IFittingEngine fittingEngine, ChunkyPixel[] pixels, IGlobalFitParams globalFitParams, List<ILocalFitParams> localFitParams, FLIMImageFitter imageFitter) { 
     1378    private void processPixels(IFittingEngine fittingEngine, ChunkyPixel[] pixels, IGlobalFitParams globalFitParams, List<ILocalFitParams> localFitParams, ColorizedImageFitter imageFitter) { 
    13931379        List<IFitResults> results = fittingEngine.fit(globalFitParams, localFitParams); 
    13941380 
     
    14041390   
    14051391    // copied 1/12 to modify into "processPixels" above: 
    1406     private void processPixelsXYZhuhuh(ICurveFitData[] data, ChunkyPixel[] pixels, FLIMImageFitter imageFitter) { 
     1392    private void processPixelsXYZhuhuh(ICurveFitData[] data, ChunkyPixel[] pixels, ColorizedImageFitter imageFitter) { 
    14071393        if (null == _fittingEngine) { 
    14081394            _fittingEngine = Configuration.getInstance().getFittingEngine(); 
     
    14561442     * are updated at the end of this function. 
    14571443     */ 
    1458     private void processPixelsXYZ(ICurveFitData[] data, ChunkyPixel[] pixels, FLIMImageFitter imageFitter) { 
     1444    private void processPixelsXYZ(ICurveFitData[] data, ChunkyPixel[] pixels, ColorizedImageFitter imageFitter) { 
    14591445        if (null == _fittingEngine) { 
    14601446            _fittingEngine = Configuration.getInstance().getFittingEngine(); 
Note: See TracChangeset for help on using the changeset viewer.