Changeset 7673 for trunk/projects


Ignore:
Timestamp:
03/25/11 20:18:24 (9 years ago)
Author:
aivar
Message:

CurveFitData needs to keep track of how many pixels went into each data point (so that the IRF can be scaled appropriately).

Location:
trunk/projects/curve-fitter/src/main/java/loci/curvefitter
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/projects/curve-fitter/src/main/java/loci/curvefitter/AbstractCurveFitter.java

    r7668 r7673  
    8787 
    8888    @Override 
    89     public double[] getInstrumentResponse() { 
    90         return m_instrumentResponse; 
     89    public double[] getInstrumentResponse(int pixels) { 
     90        double[] instrumentResponse = null; 
     91        if (null != m_instrumentResponse) { 
     92            instrumentResponse = new double[m_instrumentResponse.length]; 
     93            for (int i = 0; i < instrumentResponse.length; ++i) { 
     94                instrumentResponse[i] = pixels * m_instrumentResponse[i]; 
     95            } 
     96        } 
     97        return instrumentResponse; 
    9198    } 
    9299 
  • trunk/projects/curve-fitter/src/main/java/loci/curvefitter/CurveFitData.java

    r7670 r7673  
    4848    int m_x; 
    4949    int m_y; 
     50    int m_pixels; 
    5051    double[] m_params; 
    5152    double[] m_yCount; 
     
    8384    public void setY(int y) { 
    8485        m_y = y; 
     86    } 
     87 
     88    @Override 
     89    public int getPixels() { 
     90        return m_pixels; 
     91    } 
     92 
     93    @Override 
     94    public void setPixels(int pixels) { 
     95        m_pixels = pixels; 
    8596    } 
    8697 
  • trunk/projects/curve-fitter/src/main/java/loci/curvefitter/ICurveFitData.java

    r7289 r7673  
    8888 
    8989    /** 
     90     * Sets how many pixels went into this data point. 
     91     * 
     92     * @param pixels 
     93     */ 
     94    public void setPixels(int pixels); 
     95 
     96    /** 
     97     * Gets how many pixels went into this data point. 
     98     * 
     99     * @return number of pixels 
     100     */ 
     101    public int getPixels(); 
     102 
     103    /** 
    90104     * Gets parameters of the fit.  Could represent multiple components. 
    91105     * Input and output to the fit. 
     
    144158     */ 
    145159    public void setYFitted(double yFit[]); 
    146  
    147     /** 
    148      * Gets chi square of fit.  Output from fit only. 
    149      * 
    150      * @return chi square 
    151      */ 
    152    // public double getChiSquare(); 
    153  
    154     /** 
    155      * Sets chi square of fit. 
    156      * 
    157      * @param chiSquare 
    158      */ 
    159    // public void setChiSquare(double chiSquare); 
    160160} 
  • trunk/projects/curve-fitter/src/main/java/loci/curvefitter/ICurveFitter.java

    r7290 r7673  
    104104     * Get instrument response data.  Input to fit only. 
    105105     * 
     106     * @param scale to this number of pixels 
    106107     * @return array of data or null if not set 
    107108     */ 
    108     public double[] getInstrumentResponse(); 
     109    public double[] getInstrumentResponse(int pixels); 
    109110 
    110111    /** 
  • trunk/projects/curve-fitter/src/main/java/loci/curvefitter/SLIMCurveFitter.java

    r7669 r7673  
    186186                z.setValue(  data.getParams()[1]); 
    187187 
     188                // get IRF curve, if any 
     189                double[] instrumentResponse = getInstrumentResponse(data.getPixels()); 
    188190                int nInstrumentResponse = 0; 
    189                 if (null != m_instrumentResponse) { 
    190                     nInstrumentResponse = m_instrumentResponse.length; 
     191                if (null != instrumentResponse) { 
     192                    nInstrumentResponse = instrumentResponse.length; 
    191193                } 
    192194 
    193195                returnValue = s_library.RLD_fit( 
    194196                        m_xInc, 
    195                         data.getYCount(), //TODO data get data??? 
     197                        data.getYCount(), 
    196198                        start, 
    197199                        stop, 
    198                         m_instrumentResponse, 
     200                        instrumentResponse, 
    199201                        nInstrumentResponse, 
    200202                        data.getSig(), 
Note: See TracChangeset for help on using the changeset viewer.