IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
IntensityMeasureSetSplit.h
1 // IntensityMeasureSetSplit.h:
3 // ---------------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_INTENSITYMEASURESETSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_INTENSITYMEASURESETSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/MeasureSet/BaseIntensityMeasureSetSplit.h>
21 
22 namespace ipsdk {
23 namespace imaproc {
24 
27 
28 template <typename TProcessor, typename InputDataType, typename TAttribute>
30 {
31 // predefined public types
32 public:
34  typedef TProcessor ProcessorType;
35 
37  typedef TAttribute AttributeType;
38 
40  typedef typename TAttribute::ValueType OutputType;
41 
42 public:
48 
49 // methods
50 public:
52  const std::string& getAttributeName() const;
53 
55  const std::string& getAttributeToolTip() const;
56 
66  void init(const boost::shared_ptr<InputDataType>& pMeasureSet,
68  const MeasureSetCollPtr& pMeasureSetColl,
69  const UInt64VectorCollPtr& pShapeIndexesColl);
70 
71 protected:
73  bool checkProcessorType(const processor::BaseProcessor& processor);
74 
79  const boost::shared_ptr<InputDataType>& pSubMeasureSet);
80 
81 // attributes
82 protected:
83 
84 };
85 
88 
89 template <typename TProcessor, typename InputDataType, typename TAttribute>
90 inline const std::string&
92 {
93  return TAttribute::getObjectNameStr();
94 }
95 
96 template <typename TProcessor, typename InputDataType, typename TAttribute>
97 inline const std::string&
99 {
100  return TAttribute::getToolTipStr();
101 }
102 
103 template <typename TProcessor, typename InputDataType, typename TAttribute>
104 inline void
105 IntensityMeasureSetSplit<TProcessor, InputDataType, TAttribute>::init(const boost::shared_ptr<InputDataType>& pMeasureSet,
107  const MeasureSetCollPtr& pMeasureSetColl,
108  const UInt64VectorCollPtr& pShapeIndexesColl)
109 {
110  // call of base class initialization method
111  this->initBase(pMeasureSet, pShape2dColl, pMeasureSetColl, pShapeIndexesColl);
112 }
113 
114 template <typename TProcessor, typename InputDataType, typename TAttribute>
115 inline bool
117 {
118  // check for consistency between processor and attribute
120  "This attribute is not part of processor class");
121 
122  return dynamic_cast<const TProcessor*>(&processor) != 0;
123 }
124 
125 template <typename TProcessor, typename InputDataType, typename TAttribute>
126 inline BoolResult
128  const boost::shared_ptr<InputDataType>& pSubMeasureSet)
129 {
130  // cast of input processor object
131  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
132 
133  // update of processor attribute value
134  tProcessor.TProcessor::template set<TAttribute>(pSubMeasureSet);
135 
136  return true;
137 }
138 
141 
142 } // end of namespace imaproc
143 } // end of namespace ipsdk
144 
145 #endif // __IPSDKIMAGEPROCESSING_INTENSITYMEASURESETSPLIT_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
BoolResult processAttribute(processor::BaseProcessor &processor, const boost::shared_ptr< InputDataType > &pSubMeasureSet)
initialize processor attribute associate to split operation for a given sub measure set ...
Definition: IntensityMeasureSetSplit.h:127
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: IntensityMeasureSetSplit.h:116
boost::shared_ptr< MeasureSetColl > MeasureSetCollPtr
shared pointer to measure set collection
Definition: MeasureSetSplitTypes.h:54
void init(const boost::shared_ptr< InputDataType > &pMeasureSet, const ipsdk::shape::segmentation::Shape2dCollConstPtr &pShape2dColl, const MeasureSetCollPtr &pMeasureSetColl, const UInt64VectorCollPtr &pShapeIndexesColl)
initialization method for splitted objects
Definition: IntensityMeasureSetSplit.h:105
TAttribute AttributeType
attribute type associated to object
Definition: IntensityMeasureSetSplit.h:37
TProcessor ProcessorType
processor type associated to object
Definition: IntensityMeasureSetSplit.h:34
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: IntensityMeasureSetSplit.h:91
Base class for processor class.
Definition: BaseProcessor.h:43
structure allowing to check whether a given attribute exists in attribute collection information ...
Definition: AttributeCollInfoCheckMacros.h:131
boost::shared_ptr< UInt64VectorColl > UInt64VectorCollPtr
shared pointer to collection of index associated to split operation coded with 64 bits ...
Definition: MeasureSetSplitTypes.h:66
Base class for intensity shape measure set split operations for data dispatch.
Definition: BaseIntensityMeasureSetSplit.h:34
boost::shared_ptr< const Shape2dColl > Shape2dCollConstPtr
shared pointer to const shape 2d collection object
Definition: Shape2dTypes.h:34
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: IntensityMeasureSetSplit.h:98
Predefined types for shape 2d management.
TAttribute::ValueType OutputType
output data type for split operation
Definition: IntensityMeasureSetSplit.h:40
Concrete class for split operation generating intensity sub measure set for data dispatch.
Definition: IntensityMeasureSetSplit.h:29