View Javadoc
1   package com.github.celldynamics.quimp;
2   
3   import java.util.ArrayList;
4   
5   import ij.measure.ResultsTable;
6   
7   /**
8    * Keep statistics (outline and fluoro) for one cell along frames. This is format used by new QCONF
9    * file.
10   * 
11   * @author p.baniukiewicz
12   *
13   */
14  public class CellStats {
15  
16    /**
17     * List of statistic calculated for subsequent frames for the same object.
18     */
19    public ArrayList<FrameStatistics> framestat;
20  
21    /**
22     * Return list of statistic calculated for subsequent frames for the same object.
23     * 
24     * @return the framestat
25     */
26    public ArrayList<FrameStatistics> getFramestat() {
27      return framestat;
28    }
29  
30    /**
31     * Initialises empty container.
32     */
33    public CellStats() {
34      framestat = new ArrayList<>();
35    }
36  
37    /**
38     * Initialises container.
39     * 
40     * @param framestat stats for subsequent frames for one cell
41     */
42    public CellStats(ArrayList<FrameStatistics> framestat) {
43      this.framestat = framestat;
44    }
45  
46    /**
47     * Get number of frames.
48     * 
49     * @return the frames
50     */
51    public int getNumStoredFrames() {
52      return framestat.size();
53    }
54  
55    /**
56     * Add results stored in {@link FrameStatistics} object to ResultTable for all frames.
57     * 
58     * @param rt table to fill
59     * @param channelno channel number
60     * @see FrameStatistics#addFluoToResultTable(ResultsTable, int)
61     */
62    public void addFluosToResultTable(ResultsTable rt, int channelno) {
63      for (FrameStatistics fs : framestat) {
64        fs.addFluoToResultTable(rt, channelno);
65      }
66    }
67  
68    /**
69     * Add statistics for all frames to table.
70     * 
71     * @param rt IJ result table.
72     */
73    public void addStatsToResultTable(ResultsTable rt) {
74      for (FrameStatistics fs : framestat) {
75        fs.addStatToResultTable(rt);
76      }
77    }
78  }