IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
WatershedBinarySeparation3dImgLvl1.h
1 // WatershedBinarySeparation3dImgLvl1.h:
3 // -------------------------------------
4 //
14 
15 #ifndef __IPSDKIPLADVANCEDMORPHOLOGY_WATERSHEDBINARYSEPARATION3DIMGLVL1_H__
16 #define __IPSDKIPLADVANCEDMORPHOLOGY_WATERSHEDBINARYSEPARATION3DIMGLVL1_H__
17 
23 #include <IPSDKIPL/IPSDKIPLAttributes/DataItem/StatsResult.h>
24 #include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Tools/WatershedInternalTypes.h>
25 
26 // Attributes headers
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/3d/InBinImg3d.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InDilateFactor.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Enumerate/InWatershedSeparationMode.h>
30 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Enumerate/InOptWatershedProcMode.h>
31 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNbMinDataByThread.h>
32 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk1DistImg.h>
33 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk1Img.h>
34 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1Img.h>
35 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1BinImg.h>
36 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutBinLabImg.h>
37 
38 namespace ipsdk {
39 namespace imaproc {
40 namespace advmorpho {
41 
44 
45 // declare processor class
46 IPSDK_DECLARE_LVL1_PROCESSOR(REP_ASYNC1, IPSDKIPLAdvancedMorphology, WatershedBinarySeparation3dImg,
47  (ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutBinLabImg) &&
48  ipsdk::imaproc::customImageProperty(_pOutBinLabImg, allowedBufferType(_pInWatershedSeparationMode)) &&
49  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutWk1DistImg) &&
50  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutWk1Img) &&
51  ipsdk::imaproc::customImageProperty(_pOutWk1Img, allowedWk1BufferType(_pInWatershedSeparationMode)) &&
52  ipsdk::processor::ifIsSet(_pOutOptWk1Img,
53  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutOptWk1Img))),
54  (((ipsdk)(imaproc)(attr))(InBinImg3d))
55  (((ipsdk)(imaproc)(attr))(InDilateFactor))
56  (((ipsdk)(imaproc)(attr))(InWatershedSeparationMode))
57  (((ipsdk)(imaproc)(attr))(InOptWatershedProcMode))
58  (((ipsdk)(imaproc)(attr))(InOptNbMinDataByThread))
59  (((ipsdk)(imaproc)(attr))(OutWk1DistImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_UInt16))
60  (((ipsdk)(imaproc)(attr))(OutWk1Img)(customOutput)(outputWk1Watershed(_pInBinImg3d, _pInWatershedSeparationMode)))
61  (((ipsdk)(imaproc)(attr))(OutOptWk1Img))
62  (((ipsdk)(imaproc)(attr))(OutOptWk1BinImg))
63  (((ipsdk)(imaproc)(attr))(OutBinLabImg)(customOutput)(outputWatershed(_pInBinImg3d, _pInWatershedSeparationMode))))
64 
65 // methods
66 public:
67 
68 protected:
69 
73 
75  void notifyLabelStepCompletion(const core::ActionPtr& pAction);
76 
78  void clearIntermediateData();
79 
80 // attributes
81 protected:
83  ipUInt32 _nbLabels;
84 
86  ipUInt32 _offset;
87 
89  attr::StatsResultPtr _pInvDistStatsResult;
90 
92  Watershed3dStackPtr _pWatershed3dStack;
93 
95  image::ImagePtr _pWatershedImg;
96 };
97 
100 
101 } // end of namespace advmorpho
102 } // end of namespace imaproc
103 } // end of namespace ipsdk
104 
105 #endif // __IPSDKIPLADVANCEDMORPHOLOGY_WATERSHEDBINARYSEPARATION3DIMGLVL1_H__
Definition of import/export macro for library.
Utility functions for watershed attribute output initialization management.
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
IPSDKIPLADVANCEDMORPHOLOGY_API CustomCheckedImagePropertyPtr allowedWk1BufferType(const boost::shared_ptr< const attr::InWatershedSeparationMode > pModeAttribute)
IPSDKIPLADVANCEDMORPHOLOGY_API CustomImageInfoPtr outputWatershed(const ImageAttributeConstPtr &pInputAttribute, const boost::shared_ptr< const attr::InWatershedOutputMode > pModeAttribute)
boost::shared_ptr< BaseImage > ImagePtr
processor::OutputInitializerPtr duplicateInOut(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const boost::weak_ptr< InputAttributeType > &pInputAttribute, const eImageInitializerStoragePolicy &storagePolicy=eImageInitializerStoragePolicy::eIISP_Inherit)
ipsdk::core::ExecResult preProcess()
method called before processing
Utility functions for watershed attribute rules management.
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type ifIsSet(const boost::shared_ptr< AttributeType > &pAttribute, const RulePtr &pRuleTrue)
boost::shared_ptr< BaseAction > ActionPtr
IPSDKIPLADVANCEDMORPHOLOGY_API CustomImageInfoPtr outputWk1Watershed(const ImageAttributeConstPtr &pInputAttribute, const boost::shared_ptr< const attr::InWatershedSeparationMode > pModeAttribute)
processor::OutputInitializerPtr customOutput(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo)
IPSDKIPLADVANCEDMORPHOLOGY_API CustomCheckedImagePropertyPtr allowedBufferType(const boost::shared_ptr< const attr::InWatershedOutputMode > pModeAttribute)
IPSDK_DECLARE_GPU_PROCESSING_ALGORITHM(IPSDKIPLFiltering, Convolution2dImg, ipsdk::imaproc::matchSize(_pInSubGpuImg, _pOutImg),(((ipsdk)(imaproc)(attr))(InSubGpuImg))(((ipsdk)(imaproc)(attr))(InKnlXY))(((ipsdk)(imaproc)(attr))(InNormalize))(((ipsdk)(imaproc)(attr))(InConvolBorder2d))(((ipsdk)(imaproc)(attr))(OutImg))) IPSDKCUDA_DECLARE_ALGORITHM_FUNCTION_SELECTOR((InSubGpuImg)(OutImg)) public void clearIntermediateData()
method called before processing
boost::shared_ptr< ipsdk::imaproc::attr::StatsResult > StatsResultPtr
shared pointer to ipsdk::imaproc::attr::StatsResult
Definition: StatsResult.h:206
uint32_t ipUInt32