IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AreaPercent2dMsrLvl3.h
1 // AreaPercent2dMsrLvl3.h:
3 // -----------------------
4 //
14 
15 #ifndef __IPSDKIPLGLOBALMEASURE_AREAPERCENT2DMSRLVL3_H__
16 #define __IPSDKIPLGLOBALMEASURE_AREAPERCENT2DMSRLVL3_H__
17 
20 
21 // Attributes headers
22 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/OutValues.h>
23 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Strip/YStrip2d/InBinLabYStrip2d1.h>
24 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Strip/YStrip2d/InOptMaskYStrip2d.h>
25 
26 namespace ipsdk {
27 namespace imaproc {
28 namespace glbmsr {
29 
32 
33 // declare processing algorithm
34 IPSDK_DECLARE_PROCESSING_ALGORITHM(IPSDKIPLGlobalMeasure, AreaPercent2dMsr,
35  ipsdk::processor::If(ipsdk::processor::isSet(_pInOptMaskYStrip2d),
36  ipsdk::imaproc::matchSize(_pInBinLabYStrip2d1, _pInOptMaskYStrip2d),
38  (((ipsdk)(imaproc)(attr))(InBinLabYStrip2d1))
39  (((ipsdk)(imaproc)(attr))(InOptMaskYStrip2d))
40  (((ipsdk)(imaproc)(attr))(OutValues)))
41 
42  // implementation of image processing data identifier retrieval method
43  // for function selector usage
44  IPSDK_DECLARE_ALGORITHM_FUNCTION_SELECTOR(((STRIP)(InBinLabYStrip2d1)));
45 
46  // declaration of parsed data during processing
47  IPSDK_DECLARE_ALGORITHM_PARSED_DATA(((RAWSTRIP)(InBinLabYStrip2d1))
48  ((RAWSTRIP)(InOptMaskYStrip2d)));
49 
50 // methods
51 public:
52 
53 protected:
56  ipsdk::core::ExecResult postProcess();
57 
59  template <typename T,
60  ipsdk::eInstructionSet::domain IS>
61  ipsdk::BoolResult genericProcessFunction(const ipsdk::processor::ProcessingInfo& info);
62 
64  template <ipsdk::eInstructionSet::domain IS>
65  void processBinary(const ipsdk::processor::ProcessingInfo& info, std::vector<ipReal64>& vSum);
66 
68  template <typename T,
69  ipsdk::eInstructionSet::domain IS>
70  void processLabel(const ipsdk::processor::ProcessingInfo& info, const T* pBufIn, const ipUInt8* pBufMask, const std::vector<T>& vLabels, std::vector<ipReal64>& vSum);
71 
72 // attributes
73 protected:
75  std::vector<ipReal64> _vSum;
76 
77 };
78 
81 
82 } // end of namespace glbmsr
83 } // end of namespace imaproc
84 } // end of namespace ipsdk
85 
86 #endif // __IPSDKIPLGLOBALMEASURE_AREAPERCENT2DMSRLVL3_H__
IPSDKBASEPROCESSING_API RulePtr none()
uint8_t ipUInt8
#define IPSDK_DECLARE_PROCESSING_ALGORITHM(libraryName, algoName, RuleString, attributeSeq)
#define IPSDK_DECLARE_ALGORITHM_PARSED_DATA(dataSeq)
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type isSet(const boost::shared_ptr< AttributeType > &pAttribute)
Definition of import/export macro for library.
#define IPSDK_DECLARE_ALGORITHM_FUNCTION_SELECTOR(dataTypeSeq)
IPSDKBASEPROCESSING_API RulePtr If(const RulePtr &pPredicate, const RulePtr &pRuleTrue)