be.hogent.tarsos.util.histogram.peaks
Class PeakDetector

java.lang.Object
  extended by be.hogent.tarsos.util.histogram.peaks.PeakDetector

public final class PeakDetector
extends java.lang.Object

Author:
Joren Six

Nested Class Summary
static interface PeakDetector.PeakDetectionStrategy
           
 
Field Summary
static PeakDetector.PeakDetectionStrategy ABSOLUTEHEIGHT
           
static PeakDetector.PeakDetectionStrategy LOCALHEIGHTSCORE
           
 
Method Summary
static double calculateLocalHeightScore(Histogram histogram, int index, int windowSize)
          The local height score defines a measure for the height of a peak within a window.
static java.util.List<Peak> detect(Histogram histogram)
           
static java.util.List<Peak> detect(Histogram histogram, int windowSize, int thresholdFactor)
           
static java.util.List<Peak> detectNumberOfPeaks(Histogram histogram, int numberOfPeaks)
          Finds the requested number of (most salient) peaks in the histogram.
static Histogram newPeakDetection(java.util.List<Peak> peaks)
          Create a histogram with peak information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCALHEIGHTSCORE

public static final PeakDetector.PeakDetectionStrategy LOCALHEIGHTSCORE

ABSOLUTEHEIGHT

public static final PeakDetector.PeakDetectionStrategy ABSOLUTEHEIGHT
Method Detail

newPeakDetection

public static Histogram newPeakDetection(java.util.List<Peak> peaks)
Create a histogram with peak information. Instead of triangular peaks it creates a histogram (with the same resolution (bin widths) as the original) with peaks in the form of gaussian curves.

Parameters:
peaks - A list With Peaks
Returns:
a histogram with peak information. Can be used to match with other histograms (files)

detect

public static java.util.List<Peak> detect(Histogram histogram,
                                          int windowSize,
                                          int thresholdFactor)

calculateLocalHeightScore

public static double calculateLocalHeightScore(Histogram histogram,
                                               int index,
                                               int windowSize)
The local height score defines a measure for the height of a peak within a window. The score is the height minus the mean (height in the window) divided by the standard deviation (of the height in the window). The window size is defined in number of classes in the given histogram.

Parameters:
histogram - The histogram to calculate the local height score for.
index - The index of the bin to calculate the score for.
windowSize - The window size used to calculate the mean, standard deviation and score.
Returns:
The local height score.

detectNumberOfPeaks

public static java.util.List<Peak> detectNumberOfPeaks(Histogram histogram,
                                                       int numberOfPeaks)
Finds the requested number of (most salient) peaks in the histogram.

Parameters:
histogram - The histogram.
numberOfPeaks - The number of peaks.
Returns:
A list of peaks equal in size as the requested number of peaks.

detect

public static java.util.List<Peak> detect(Histogram histogram)