7 #ifndef __SCENE2D_PROCESSING_COMPUTEHISTOGRAMFUNCTOR_HXX__ 8 #define __SCENE2D_PROCESSING_COMPUTEHISTOGRAMFUNCTOR_HXX__ 10 #include "scene2D/processing/SComputeHistogram.hpp" 12 #include <fwDataTools/fieldHelper/MedicalImageHelpers.hpp> 13 #include <fwDataTools/helper/Array.hpp> 14 #include <fwDataTools/helper/ImageGetter.hpp> 29 ::fwData::Image::csptr image;
30 ::fwData::Histogram::sptr histogram;
36 template<
class IMAGETYPE>
39 ::fwData::Image::csptr image = param.image;
40 ::fwData::Histogram::sptr histogram = param.histogram;
44 IMAGETYPE min = std::numeric_limits<IMAGETYPE>::max();
45 IMAGETYPE max = std::numeric_limits<IMAGETYPE>::min();
51 histogram->initialize( min, max, param.binsWidth );
53 ::fwData::Array::sptr array = image->getDataArray();
56 IMAGETYPE* itr = arrayHelper.
begin<IMAGETYPE>();
57 IMAGETYPE* itrEnd = arrayHelper.end<IMAGETYPE>();
59 for(; itr != itrEnd; ++itr)
61 histogram->addPixel( static_cast< float >( *itr ) );
This bundles contains data and services used to display a 2D Qt scene.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Functor use to compute the histogram of the image.
Parameters of the functor.