7 #include "fwData/registry/macros.hpp" 8 #include "fwData/Exception.hpp" 9 #include "fwData/Image.hpp" 10 #include "fwData/Histogram.hpp" 36 Histogram::csptr other = Histogram::dynamicConstCast(_source);
38 "Unable to copy" + (_source ? _source->getClassname() : std::string(
"<NULL>"))
51 Histogram::csptr other = Histogram::dynamicConstCast(_source);
53 "Unable to copy" + (_source ? _source->getClassname() : std::string(
"<NULL>"))
63 for(
long value : other->m_values )
84 SLM_ASSERT(
"The minimum value can't be greater than the maximum value", _min <= _max);
103 SLM_ASSERT(
"The minimum value can't be greater than the maximum value", _min < _max);
117 while( indexMin < indexMax )
119 nbPixels +=
m_values.at( indexMin++ );
fwHistogramValues m_values
Histogram values.
#define SLM_TRACE_FUNC()
Trace contextual function signature.
float m_minValue
The minimum pixel value within the histogram (a default value is set to 0).
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Implements data exception class.
FWDATA_API void cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
This class defines the histogram of an image.
float m_maxValue
The maximum pixel value within the histogram (a default value is set to 100).
float m_binsWidth
The pixel width of the bins (a default value is set to 1).
FWDATA_API void shallowCopy(const Object::csptr &_source) override
Defines shallow copy.
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
FWDATA_API long getNbPixels(float _min, float _max)
Return the number of pixels of the histogram that are within the range defined by the given parameter...
virtual FWDATA_API ~Histogram()
Destructor.
FWDATA_API bool isInRange(float _pixel)
Return true if the given pixel value is set within histogram's boudaries.
FWDATA_API Histogram(::fwData::Object::Key key)
Constructor.
Contains the representation of the data objects used in the framework.
FWDATA_API void fieldShallowCopy(const ::fwData::Object::csptr &source)
A shallow copy of fields (objects in m_children)
FWDATA_API void initialize(float min, float max, float binsWidth)
Initialize the histogram.
FWDATA_API void addPixel(float pixel)
Add the given pixel value into the histogram.
virtual const std::string & getClassname() const override
return full object's classname with its namespace, i.e. fwCore::BaseObject