7 #ifndef __FWDATATOOLS_IMAGE_HPP__ 8 #define __FWDATATOOLS_IMAGE_HPP__ 10 #include "fwDataTools/config.hpp" 11 #include <fwDataTools/helper/Array.hpp> 13 #include <fwCore/base.hpp> 15 #include <fwData/Image.hpp> 17 #include <fwMath/Compare.hpp> 19 #include <fwTools/Type.hpp> 37 FWDATATOOLS_API
static void applyRoi( ::fwData::Image::sptr image,
38 ::fwData::Image::sptr roi );
44 FWDATATOOLS_API
static bool isRoiApplyed( ::fwData::Image::sptr image,
45 ::fwData::Image::sptr imgRoiApplyed,
46 ::fwData::Image::sptr roi );
51 template<
typename IMG_DEST_TYPE,
typename MASK_TYPE>
52 void mergeMask(::fwData::Image::sptr imgDest, ::fwData::Image::sptr mask, IMG_DEST_TYPE val );
58 template<
typename IMG_DEST_TYPE,
typename MASK_TYPE>
59 void Image::mergeMask(::fwData::Image::sptr imgDest, ::fwData::Image::sptr mask, IMG_DEST_TYPE val )
61 typedef IMG_DEST_TYPE ImgDestType;
62 typedef MASK_TYPE MaskType;
63 SLM_ASSERT(
"Image dest has not correct type", imgDest->getType().isOfType< ImgDestType >());
64 SLM_ASSERT(
"Image mask has not correct type", mask->getType().isOfType< MaskType >());
66 SLM_ASSERT(
"Images have not the same size", imgDest->getSize() == mask->getSize() );
67 SLM_ASSERT(
"Images have not the same spacing",
72 ::fwData::Array::sptr imgData;
73 ::fwData::Array::sptr maskData;
74 imgData = imgDest->getDataArray();
75 maskData = mask->getDataArray();
80 ImgDestType* imgIt = imgHelper.
begin<ImgDestType>();
81 MaskType* maskIt = maskHelper.
begin<MaskType>();
83 const ImgDestType* imgEnd = imgIt + maskData->getNumberOfElements();
85 for (; imgIt != imgEnd; ++imgIt, ++maskIt)
96 #endif // __FWDATATOOLS_IMAGE_HPP__
bool isContainerEqual(CONTAINER &containerA, CONTAINER &containerB, const float epsilon=0.00001F)
Returns true iff container a and b are equal with 'epsilon' error margin.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...