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.AbstractBatchFilterBatch 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.BatchFilterm_BatchFilterBatch filter to apply before selectionprotected booleanm_Invertwhether to invert the selection.protected intm_NumberInSubsetNumber of spectra to select in subsetprotected adams.data.filter.Filterm_PreFilterPre filter to apply before selection
-
Constructor Summary
Constructors Constructor Description KennardStone()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringbatchFilterTipText()Description for this propertyprotected doublecalculateDistance(Spectrum spec1, Spectrum spec2)Calculate the distance between any two spectra.voiddefineOptions()adams.data.filter.BatchFiltergetBatchFilter()Get the batch filter to apply before selectionbooleangetInvert()Get whether to return the remaining spectra are returned rather than the chosen ones.intgetNumberInSubset()get the number of spectra to select in subsetadams.data.filter.FiltergetPreFilter()Get the filter to apply before selectionStringglobalInfo()StringinvertTipText()Description for this property.StringnumberInSubsetTipText()Tip text for this propertyStringpreFilterTipText()Tip text for this propertyprotected adams.data.container.DataContainer[]processBatchData(adams.data.container.DataContainer[] data)protected adams.data.container.DataContainerprocessData(adams.data.container.DataContainer data)voidsetBatchFilter(adams.data.filter.BatchFilter value)Set the batch filter to apply before selectionvoidsetInvert(boolean value)Set whether to return the remaining spectra are returned rather than the chosen ones.voidsetNumberInSubset(int value)Set the number of spectra to select in subsetvoidsetPreFilter(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler
-
defineOptions
public void defineOptions()
- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin 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:
processBatchDatain 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:
processDatain classadams.data.filter.AbstractFilter
-
-