IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AdaptiveBinaryWatershed3dImgLvl1.h
1 // AdaptiveBinaryWatershed3dImgLvl1.h:
3 // -----------------------------------
4 //
14 
15 #ifndef __IPSDKIPLADVANCEDMORPHOLOGY_ADAPTIVEBINARYWATERSHED3DIMGLVL1_H__
16 #define __IPSDKIPLADVANCEDMORPHOLOGY_ADAPTIVEBINARYWATERSHED3DIMGLVL1_H__
17 
22 
23 // Attributes headers
24 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Enumerate/InWatershedSeparationMode.h>
25 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Enumerate/InOptWatershedProcMode.h>
26 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Input/3d/InBinImg3d.h>
27 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/OutBinLabImg.h>
28 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1BinImg.h>
29 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1Img.h>
30 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/Optional/OutOptWk1LabelImg.h>
31 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk1BinImg.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/OutWk1LabelImg.h>
35 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk2LabelImg.h>
36 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk1RealImg.h>
37 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk2BinImg.h>
38 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Image/Output/Working/OutWk2RealImg.h>
39 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InArithmeticVal.h>
40 #include <IPSDKIPL/IPSDKIPLAttributes/Attribute/Value/InOptNbMinDataByThread.h>
41 
42 namespace ipsdk {
43 namespace imaproc {
44 namespace advmorpho {
45 
48 
49 // declare processor class
50 IPSDK_DECLARE_LVL1_PROCESSOR(REP_ASYNC1, IPSDKIPLAdvancedMorphology, AdaptiveBinaryWatershed3dImg,
51  ipsdk::imaproc::matchSizeAndType(_pInBinImg3d, _pOutWk1BinImg) &&
52  ipsdk::imaproc::matchSizeAndType(_pInBinImg3d, _pOutWk2BinImg) &&
53  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutWk1DistImg) &&
54  ipsdk::imaproc::matchSizeAndType(_pOutWk1DistImg, _pOutWk1Img) &&
55  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutWk1RealImg) &&
56  ipsdk::imaproc::matchSizeAndType(_pOutWk1LabelImg, _pOutWk2LabelImg) &&
57  ipsdk::imaproc::matchSizeAndType(_pOutWk1RealImg, _pOutWk2RealImg) &&
58  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutWk1LabelImg) &&
59  ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutBinLabImg) &&
60  ipsdk::processor::ifIsSet(_pOutOptWk1Img, ipsdk::imaproc::matchSizeAndType(_pOutWk1DistImg, _pOutOptWk1Img)) &&
61  ipsdk::processor::ifIsSet(_pOutOptWk1Img, ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutOptWk1BinImg)) &&
62  ipsdk::processor::ifIsSet(_pOutOptWk1Img, ipsdk::imaproc::matchSize(_pInBinImg3d, _pOutOptWk1LabelImg)),
63  (((ipsdk)(imaproc)(attr))(InBinImg3d))
64  (((ipsdk)(imaproc)(attr))(InArithmeticVal))
65  (((ipsdk)(imaproc)(attr))(InWatershedSeparationMode))
66  (((ipsdk)(imaproc)(attr))(InOptWatershedProcMode))
67  (((ipsdk)(imaproc)(attr))(InOptNbMinDataByThread))
68  (((ipsdk)(imaproc)(attr))(OutOptWk1Img))
69  (((ipsdk)(imaproc)(attr))(OutOptWk1BinImg))
70  (((ipsdk)(imaproc)(attr))(OutOptWk1LabelImg))
71  (((ipsdk)(imaproc)(attr))(OutWk1BinImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d))
72  (((ipsdk)(imaproc)(attr))(OutWk2BinImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d))
73  (((ipsdk)(imaproc)(attr))(OutWk1DistImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_UInt16))
74  (((ipsdk)(imaproc)(attr))(OutWk1Img)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_UInt16))
75  (((ipsdk)(imaproc)(attr))(OutWk1RealImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_Real32))
76  (((ipsdk)(imaproc)(attr))(OutWk2RealImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_Real32))
77  (((ipsdk)(imaproc)(attr))(OutWk1LabelImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_Label16))
78  (((ipsdk)(imaproc)(attr))(OutWk2LabelImg)(ipsdk::imaproc::duplicateInOut)(_pInBinImg3d)(ipsdk::image::eImageBufferType::eIBT_Label16))
79  (((ipsdk)(imaproc)(attr))(OutBinLabImg)(customOutput)(outputWatershed(_pInBinImg3d, _pInWatershedSeparationMode))))
80 
81 // methods
82 public:
83 
84 protected:
85 
86  processor::RetrievalResult provideProcessor(const boost::shared_ptr<core::BaseAction>& pProcessor,
87  const core::BasePriority& priority,
88  core::ActionProviderPtr& pProvider);
89 
90  processor::RetrievalResult distanceMap(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
91  processor::RetrievalResult dilateLocalMaxima(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
92  processor::RetrievalResult logicalNot(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
93  const ipsdk::image::ImageConstPtr& pInImg, const ipsdk::image::ImagePtr& pOutImg);
94  processor::RetrievalResult erode(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
95  processor::RetrievalResult bitwiseOr(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
96  processor::RetrievalResult labelize(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
97  const ipsdk::image::ImageConstPtr& pInImg, const ipsdk::image::ImagePtr& pOutImg);
98  processor::RetrievalResult invert(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
99  processor::RetrievalResult seededWatershed(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
100  const ipsdk::image::ImageConstPtr& pInGreyImg,
101  const ipsdk::image::ImageConstPtr& pInLabelImg,
102  const ipsdk::imaproc::attr::eWatershedOutputMode& watershedOutputMode,
103  const ipsdk::image::ImagePtr& pOutImg);
104  processor::RetrievalResult mask(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
105  const ipsdk::image::ImageConstPtr& pInImg,
106  const ipsdk::image::ImageConstPtr& pInMaskImg,
107  const ipsdk::image::ImagePtr& pOutImg);
108  processor::RetrievalResult multiplyScalar(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
109  const ipsdk::image::ImageConstPtr& pInImg,
110  const ipsdk::ipReal64 param,
111  const ipsdk::image::ImagePtr& pOutImg);
112  processor::RetrievalResult subtract(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
113  const ipsdk::image::ImageConstPtr& pInImg1,
114  const ipsdk::image::ImageConstPtr& pInImg2,
115  const ipsdk::image::ImagePtr& pOutImg);
116  processor::RetrievalResult threshold(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
117  const ipsdk::image::ImageConstPtr& pInImg,
118  const ipsdk::ipReal64 threshMin,
119  const ipsdk::ipReal64 threshMax,
120  const ipsdk::image::ImagePtr& pOutImg);
121  processor::RetrievalResult convert(const core::BasePriority& priority, core::ActionProviderPtr& pProvider,
122  const ipsdk::image::ImageConstPtr& pInImg,
123  const ipsdk::image::ImagePtr& pOutImg);
124  processor::RetrievalResult max(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
125  processor::RetrievalResult maxPropagation(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
126  processor::RetrievalResult dilate(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
127  processor::RetrievalResult bitwiseAnd(const core::BasePriority& priority, core::ActionProviderPtr& pProvider);
128  processor::RetrievalResult bitwiseXOr(const core::BasePriority& priority, core::ActionProviderPtr& pProvider, const ipsdk::image::ImagePtr& pOutImg);
129 
130 // attributes
131 protected:
132 
133 };
134 
137 
138 } // end of namespace advmorpho
139 } // end of namespace imaproc
140 } // end of namespace ipsdk
141 
142 #endif // __IPSDKIPLADVANCEDMORPHOLOGY_ADAPTIVEBINARYWATERSHED3DIMGLVL1_H__
Definition of import/export macro for library.
ProcessingResult< eRetrievalResultType > RetrievalResult
Utility functions for watershed attribute output initialization management.
#define IPSDK_DECLARE_LVL1_PROCESSOR(ProcType, libraryName, algoName, RuleString, attributeSeq)
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)
double ipReal64
boost::enable_if_c< AttributeType::g_bOptional, RulePtr >::type ifIsSet(const boost::shared_ptr< AttributeType > &pAttribute, const RulePtr &pRuleTrue)
IPSDK_FORCEINLINE PackT max(const PackT &in1, const PackT &in2)
processor::OutputInitializerPtr customOutput(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const CustomImageInfoPtr &pCustomImageInfo)
eWatershedOutputMode
Enumerate describing watershed output mode.
Definition: WatershedTypes.h:31
IPSDKGEOMETRY_API Vector2d convert(const Point2d< T > &pt)
boost::shared_ptr< const BaseImage > ImageConstPtr
boost::shared_ptr< BaseActionProvider > ActionProviderPtr
IPSDK_FORCEINLINE PackT bitwiseXOr(const PackT &in1, const PackT &in2)
IPSDK_FORCEINLINE PackT bitwiseOr(const PackT &in1, const PackT &in2)