28 #include "../../core/kernel/WKernel.h"
29 #include "WMCalculateHistogram.h"
55 return "CalculateHistogram";
60 return "Calculates the histogram of the values found in the input dataset.";
66 shared_from_this(),
"Input data",
"A dataset to calculate the histogram from." ) );
70 shared_from_this(),
"Histogram",
"The calculated histogram." ) );
126 std::shared_ptr< WHistogramBasic > histo(
new WHistogramBasic(
m_data->getValueSet()->getMinimumValue(),
127 m_data->getValueSet()->getMaximumValue(),
129 for( std::size_t j = 0; j <
m_data->getValueSet()->size(); ++j )
131 histo->insert(
m_data->getValueSet()->getScalarDouble( j ) );
virtual void wait() const
Wait for the condition.
void setResetable(bool resetable=true, bool autoReset=true)
Sets the resetable flag.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
Class to encapsulate boost::condition_variable_any.
This data set type contains a 1D histogram.
Container which associate values with (uniform width) bins (aka intervals or buckets).
Calculates a histogram from WDataSetSingle.
virtual void connectors()
Initialize the connectors this module is using.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
std::shared_ptr< WCondition > m_propCondition
A property condition used to notify of changes in the properties.
virtual void moduleMain()
Entry point after loading the module.
virtual ~WMCalculateHistogram()
Destructor.
void updateOutput()
Calculate the histogram and update the output.
WPropInt m_histogramBins
A property for the number of bins in the histogram.
std::shared_ptr< WModuleInputData< WDataSetSingle > > m_dataInput
The input connector for the data.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
std::shared_ptr< WModuleOutputData< WDataSetHistogram1D > > m_histogramOutput
The output for the histogram.
WMCalculateHistogram()
Constructor.
std::shared_ptr< WDataSetSingle > m_data
The current input data.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual const std::string getName() const
Gives back the name of this module.
virtual void properties()
Initialize the properties for this module.
virtual void requirements()
Initialize requirements for this module.
Class offering an instantiate-able data connection between modules.
Class representing a single module of OpenWalnut.
virtual void properties()
Initialize properties in this function.
wlog::WStreamedLogger debugLog() const
Logger instance for comfortable debug logging.
void addConnector(std::shared_ptr< WModuleInputConnector > con)
Adds the specified connector to the list of inputs.
std::shared_ptr< WProperties > m_properties
The property object for the module.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
virtual void connectors()
Initialize connectors in this function.
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.