IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
KMeansComputeCentersLvl1.h
1 // KMeansComputeCentersLvl1.h:
3 // ---------------------------
4 //
14 
15 #ifndef __IPSDKIPLCLASSIFICATION_KMEANSCOMPUTECENTERSLVL1_H__
16 #define __IPSDKIPLCLASSIFICATION_KMEANSCOMPUTECENTERSLVL1_H__
17 
21 
22 // Attributes headers
23 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/OutClustersCenters.h>
24 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/OutKMeansAssignmentInfo.h>
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/DataItem/OutOptNbEltsPerCluster.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InClassImg.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/InHomogeneousImg.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNbClusters.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/Optional/InOptSingleGreyMaskImg.h>
30 
31 namespace ipsdk {
32 namespace imaproc {
33 namespace classif {
34 
37 
38 // declare processor class
39 IPSDK_DECLARE_LVL1_PROCESSOR(ASYNC1, IPSDKIPLClassification, KMeansComputeCenters,
40  ipsdk::processor::If(ipsdk::processor::isSet(_pInOptSingleGreyMaskImg),
41  ipsdk::imaproc::matchSize(eMatchImageSizeType::eMIST_3d, _pInHomogeneousImg, _pInOptSingleGreyMaskImg),
43  (((ipsdk)(imaproc)(attr))(InHomogeneousImg))
44  (((ipsdk)(imaproc)(attr))(InClassImg))
45  (((ipsdk)(imaproc)(attr))(InOptSingleGreyMaskImg))
46  (((ipsdk)(imaproc)(attr))(InOptNbClusters))
47  (((ipsdk)(imaproc)(attr))(OutClustersCenters)(ipsdk::processor::allocate))
48  (((ipsdk)(imaproc)(attr))(OutOptNbEltsPerCluster)))
49 
50 // methods
51 public:
52 
53 protected:
54  ipsdk::core::ExecResult postProcess();
55 
56 // attributes
57 protected:
58  image::ImageConstPtr _pReinterpretedInImg;
59 
60  // declaration of dispatch results collection
61  IPSDK_DECLARE_STATIC_RESULT_COLL(attr::OutKMeansAssignmentInfo, KMeansAssignmentInfoColl);
62 };
63 
66 
67 } // end of namespace classif
68 } // end of namespace imaproc
69 } // end of namespace ipsdk
70 
71 #endif // __IPSDKIPLCLASSIFICATION_KMEANSCOMPUTECENTERSLVL1_H__
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
IPSDKBASEPROCESSING_API RulePtr none()
Definition of import/export macro for library.
boost::shared_ptr< const BaseImage > ImageConstPtr
#define IPSDK_DECLARE_STATIC_RESULT_COLL(AttributeType, CollType)
processor::OutputInitializerPtr allocate(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute)
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type isSet(const boost::shared_ptr< AttributeType > &pAttribute)
IPSDKBASEPROCESSING_API RulePtr If(const RulePtr &pPredicate, const RulePtr &pRuleTrue)