Class ExperimentExplorer.AnnotationGroup

    • Field Detail

      • id

        private final int id
      • annotationValues

        private final Set<?> annotationValues
      • title

        private final String title
      • sum

        private final float[] sum
      • count

        private final int[] count
    • Constructor Detail

      • AnnotationGroup

        private AnnotationGroup​(int id,
                                Set<T> annotationValues,
                                int channels,
                                Formatter<T> formatter)
    • Method Detail

      • getId

        public int getId()
        The ID of the group. The ID is only useful within the objects AnnotationSummary objects lifetime. The first group that is created is given an ID of 1, the second 2, and so on.
        Returns:
        The ID
      • getTitle

        public String getTitle()
        Get the title of this annotation group. The title is created by concatenating all annotation values.
        Returns:
        The title
      • getAnnotationValues

        public Set<?> getAnnotationValues()
        Get all annotation values in this annotation group.
        Returns:
        A set containing all annotation values
      • getColor

        public String getColor()
        Get a color code for HTML that is as distinct as possible from the color of the other groups. The colors may repeat if there are many groups.
        Returns:
        The color string
      • getAwtColor

        public Color getAwtColor()
        Get the AWT color object that corresponds to the HTML color string. The color string must have been set with a seven-character string with 2 hex characters for every color component, eg. '#rrggbb'.
        Since:
        2.14
      • setColor

        public void setColor​(String color)
        Sets the color for this annotation group.
        Parameters:
        color - A HTML color code
        Since:
        2.14
      • addValue

        public void addValue​(int channel,
                             float intensity)
        Add an intensity value to this group.
        Parameters:
        channel - The number of the channel, starting with 1
        intensity - The spot's intensity
      • getSum

        public float getSum​(int channel)
        Get the sum of intensities for the specified channel.
        Parameters:
        channel - The number of the channel, starting with 1
        Returns:
        The sum of the intensities
        See Also:
        addValue(int, float)
      • getCount

        public int getCount​(int channel)
        Get the number of intensity values added to the specified channel.
        Parameters:
        channel - The number of the channel, starting with 1
        Returns:
        The number of values
        See Also:
        addValue(int, float)
      • getMean

        public float getMean​(int channel)
        Get the mean of the intensity values for the given channel.
        Parameters:
        channel - he number of the channel, starting with 1
        Returns:
        The mean of the values, or NaN if no values has been added
        See Also:
        addValue(int, float)
      • addStatistics

        public void addStatistics​(String key,
                                  float value)
        Add another statisitcal measurement to this group. All values with the same key are added together and can be retrieved with the getStatistics(String) method.
        Parameters:
        key - The key for the measurment
        value - The value to add
      • getStatistics

        public float getStatistics​(String key)
        Get the sum of all values added with the addStatistics(String, float) method with the given key.
        Parameters:
        key - The measurement key
        Returns:
        The sum of the added values or Float.NaN if no value is found
      • reset

        public void reset()
        Resets all collected statistics in this group.
        Since:
        2.14