Package adams.data.spectrumfilter
Class KennardStone
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.filter.AbstractFilter<T>
-
- adams.data.filter.AbstractBatchFilter
-
- adams.data.spectrumfilter.KennardStone
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.ShallowCopySupporter
,adams.core.SizeOfHandler
,adams.data.filter.BatchFilter
,adams.data.filter.Filter
,Serializable
,Comparable
public class KennardStone extends adams.data.filter.AbstractBatchFilter
Batch filter that applies the Kennard-stone algorithm to select a subset of spectra Created by Michael on 5/19/2016.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.data.filter.BatchFilter
m_BatchFilter
Batch filter to apply before selectionprotected boolean
m_Invert
whether to invert the selection.protected int
m_NumberInSubset
Number of spectra to select in subsetprotected adams.data.filter.Filter
m_PreFilter
Pre filter to apply before selection
-
Constructor Summary
Constructors Constructor Description KennardStone()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
batchFilterTipText()
Description for this propertyprotected double
calculateDistance(Spectrum spec1, Spectrum spec2)
Calculate the distance between any two spectra.void
defineOptions()
adams.data.filter.BatchFilter
getBatchFilter()
Get the batch filter to apply before selectionboolean
getInvert()
Get whether to return the remaining spectra are returned rather than the chosen ones.int
getNumberInSubset()
get the number of spectra to select in subsetadams.data.filter.Filter
getPreFilter()
Get the filter to apply before selectionString
globalInfo()
String
invertTipText()
Description for this property.String
numberInSubsetTipText()
Tip text for this propertyString
preFilterTipText()
Tip text for this propertyprotected adams.data.container.DataContainer[]
processBatchData(adams.data.container.DataContainer[] data)
protected adams.data.container.DataContainer
processData(adams.data.container.DataContainer data)
void
setBatchFilter(adams.data.filter.BatchFilter value)
Set the batch filter to apply before selectionvoid
setInvert(boolean value)
Set whether to return the remaining spectra are returned rather than the chosen ones.void
setNumberInSubset(int value)
Set the number of spectra to select in subsetvoid
setPreFilter(adams.data.filter.Filter value)
Set the filter to apply before selection-
Methods inherited from class adams.data.filter.AbstractFilter
checkData, cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.data.filter.Filter
cleanUp, compareTo, destroy, dontUpdateIDTipText, equals, filter, getDontUpdateID, reset, setDontUpdateID, shallowCopy, shallowCopy
-
-
-
-
Field Detail
-
m_NumberInSubset
protected int m_NumberInSubset
Number of spectra to select in subset
-
m_PreFilter
protected adams.data.filter.Filter m_PreFilter
Pre filter to apply before selection
-
m_BatchFilter
protected adams.data.filter.BatchFilter m_BatchFilter
Batch filter to apply before selection
-
m_Invert
protected boolean m_Invert
whether to invert the selection.
-
-
Method Detail
-
globalInfo
public String globalInfo()
- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.core.option.AbstractOptionHandler
-
defineOptions
public void defineOptions()
- Specified by:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.data.filter.AbstractFilter
-
setNumberInSubset
public void setNumberInSubset(int value)
Set the number of spectra to select in subset- Parameters:
value
- Size of subset
-
getNumberInSubset
public int getNumberInSubset()
get the number of spectra to select in subset- Returns:
- Size of subset
-
numberInSubsetTipText
public String numberInSubsetTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setPreFilter
public void setPreFilter(adams.data.filter.Filter value)
Set the filter to apply before selection- Parameters:
value
- Filter to apply
-
getPreFilter
public adams.data.filter.Filter getPreFilter()
Get the filter to apply before selection- Returns:
- Filter to apply
-
preFilterTipText
public String preFilterTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setBatchFilter
public void setBatchFilter(adams.data.filter.BatchFilter value)
Set the batch filter to apply before selection- Parameters:
value
- Batch filter
-
getBatchFilter
public adams.data.filter.BatchFilter getBatchFilter()
Get the batch filter to apply before selection- Returns:
- Batch filter
-
batchFilterTipText
public String batchFilterTipText()
Description for this property- Returns:
- Description for displaying in the GUI
-
setInvert
public void setInvert(boolean value)
Set whether to return the remaining spectra are returned rather than the chosen ones.- Parameters:
value
- true if to invert
-
getInvert
public boolean getInvert()
Get whether to return the remaining spectra are returned rather than the chosen ones.- Returns:
- true if to invert
-
invertTipText
public String invertTipText()
Description for this property.- Returns:
- Description for displaying in the GUI
-
processBatchData
protected adams.data.container.DataContainer[] processBatchData(adams.data.container.DataContainer[] data)
- Specified by:
processBatchData
in classadams.data.filter.AbstractBatchFilter
-
calculateDistance
protected double calculateDistance(Spectrum spec1, Spectrum spec2)
Calculate the distance between any two spectra. Currently just uses euclidean distance- Parameters:
spec1
- Spectrum1spec2
- Spectrum2- Returns:
- the distance
-
processData
protected adams.data.container.DataContainer processData(adams.data.container.DataContainer data)
- Specified by:
processData
in classadams.data.filter.AbstractFilter
-
-