IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PlanIndexedInitializerOperators.h
Go to the documentation of this file.
1 // PlanIndexedInitializerOperators.h:
3 // ----------------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_PLANINDEXEDINITIALIZEROPERATORS_H__
16 #define __IPSDKIMAGEPROCESSING_PLANINDEXEDINITIALIZEROPERATORS_H__
17 
20 #include <IPSDKImageProcessing/OutputInitializer/PlanIndexed/FromImagePlanIndexedInitializer.h>
21 #include <IPSDKImageProcessing/OutputInitializer/PlanIndexed/FromOtherPlanIndexedInitializer.h>
23 #include <boost/make_shared.hpp>
24 #include <boost/function.hpp>
25 
26 namespace ipsdk {
27 namespace imaproc {
28 
31 
36 template <typename OutputAttributeType>
38 fromImage(const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
39  const ImageAttributeConstWeakPtr& pInputImageAttribute,
40  const eFromImagePlanIndexedPolicy& fromImagePlanIndexedPolicy)
41 {
42  // retrieve initializer type
43  typedef FromImagePlanIndexedInitializer<OutputAttributeType> OutputInitializerType;
44 
45  // create initializer
46  boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
47  pInitializer->init(pOutputAttribute, pInputImageAttribute, fromImagePlanIndexedPolicy);
48 
49  return pInitializer;
50 }
51 template <typename OutputAttributeType>
53 fromImage(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
54  const ImageAttributeConstPtr& pInputAttribute,
55  const eFromImagePlanIndexedPolicy& fromImagePlanIndexedPolicy)
56 {
57  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
58  ImageAttributeConstWeakPtr(pInputAttribute),
59  fromImagePlanIndexedPolicy);
60 }
61 template <typename OutputAttributeType>
63 fromImage(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
64  const ImageAttributeConstPtr& pInputAttribute)
65 {
66  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
67  ImageAttributeConstWeakPtr(pInputAttribute),
69 }
70 template <typename OutputAttributeType>
72 fromImageButColor(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
73  const ImageAttributeConstPtr& pInputAttribute)
74 {
75  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
76  ImageAttributeConstWeakPtr(pInputAttribute),
78 }
79 template <typename OutputAttributeType>
81 fromImageButVolume(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
82  const ImageAttributeConstPtr& pInputAttribute)
83 {
84  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
85  ImageAttributeConstWeakPtr(pInputAttribute),
87 }
88 template <typename OutputAttributeType>
90 fromImage(const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
91  const ImageAttributeConstWeakPtr& pInputImageAttribute,
92  const eFromImagePlanIndexedPolicy& fromImagePlanIndexedPolicy,
93  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
94 {
95  // retrieve initializer type
96  typedef FromImagePlanIndexedInitializer<OutputAttributeType> OutputInitializerType;
97 
98  // create initializer
99  boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
100  pInitializer->init(pOutputAttribute, pInputImageAttribute, fromImagePlanIndexedPolicy, planCreator);
101 
102  return pInitializer;
103 }
104 template <typename OutputAttributeType>
106 fromImage(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
107  const ImageAttributeConstPtr& pInputAttribute,
108  const eFromImagePlanIndexedPolicy& fromImagePlanIndexedPolicy,
109  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
110 {
111  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
112  ImageAttributeConstWeakPtr(pInputAttribute),
113  fromImagePlanIndexedPolicy,
114  planCreator);
115 }
116 template <typename OutputAttributeType>
118 fromImage(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
119  const ImageAttributeConstPtr& pInputAttribute,
120  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
121 {
122  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
123  ImageAttributeConstWeakPtr(pInputAttribute),
125  planCreator);
126 }
127 template <typename OutputAttributeType>
129 fromImageButColor(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
130  const ImageAttributeConstPtr& pInputAttribute,
131  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
132 {
133  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
134  ImageAttributeConstWeakPtr(pInputAttribute),
136  planCreator);
137 }
138 template <typename OutputAttributeType>
140 fromImageButVolume(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
141  const ImageAttributeConstPtr& pInputAttribute,
142  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
143 {
144  return fromImage(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
145  ImageAttributeConstWeakPtr(pInputAttribute),
147  planCreator);
148 }
150 
155 template <typename OutputAttributeType>
157 fromOther(const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
158  const PlanIndexedAttributeConstWeakPtr& pInputAttribute)
159 {
160  // retrieve initializer type
161  typedef FromOtherPlanIndexedInitializer<OutputAttributeType> OutputInitializerType;
162 
163  // create initializer
164  boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
165  pInitializer->init(pOutputAttribute, pInputAttribute);
166 
167  return pInitializer;
168 }
169 template <typename OutputAttributeType>
171 fromOther(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
172  const PlanIndexedAttributeConstWeakPtr& pInputAttribute)
173 {
174  return fromOther(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
175  PlanIndexedAttributeConstWeakPtr(pInputAttribute));
176 }
177 
178 template <typename OutputAttributeType>
180 fromOther(const boost::weak_ptr<OutputAttributeType>& pOutputAttribute,
181  const PlanIndexedAttributeConstWeakPtr& pInputAttribute,
182  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
183 {
184  // retrieve initializer type
185  typedef FromOtherPlanIndexedInitializer<OutputAttributeType> OutputInitializerType;
186 
187  // create initializer
188  boost::shared_ptr<OutputInitializerType> pInitializer = boost::make_shared<OutputInitializerType>();
189  pInitializer->init(pOutputAttribute, pInputAttribute, planCreator);
190 
191  return pInitializer;
192 }
193 template <typename OutputAttributeType>
195 fromOther(const boost::shared_ptr<OutputAttributeType>& pOutputAttribute,
196  const PlanIndexedAttributeConstWeakPtr& pInputAttribute,
197  boost::function<typename OutputAttributeType::PlanStorageType ()> planCreator)
198 {
199  return fromOther(boost::weak_ptr<OutputAttributeType>(pOutputAttribute),
200  PlanIndexedAttributeConstWeakPtr(pInputAttribute),
201  planCreator);
202 }
204 
207 
208 } // end of namespace imaproc
209 } // end of namespace ipsdk
210 
211 #endif // __IPSDKIMAGEPROCESSING_PLANINDEXEDINITIALIZEROPERATORS_H__
boost::weak_ptr< const BasePlanIndexedAttribute > PlanIndexedAttributeConstWeakPtr
weak pointer to const plan indexed attribute
Definition: PlanIndexedAttributeTypes.h:39
Plan indexed attribute will be initialized taking into account z and t components of image...
Definition: PlanIndexedInitializerTypes.h:57
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void init(const PlanIndexedAttributeWeakPtr &pOutputAttribute, const PlanIndexedAttributeConstWeakPtr &pInputAttribute)
initialize object
Definition: FromOtherPlanIndexedInitializer.h:93
processor::OutputInitializerPtr fromImageButVolume(const boost::shared_ptr< OutputAttributeType > &pOutputAttribute, const ImageAttributeConstPtr &pInputAttribute)
function allowing to initialize a plan indexed collection with respect to a given image geometry ...
Definition: PlanIndexedInitializerOperators.h:81
boost::weak_ptr< const BaseImageAttribute > ImageAttributeConstWeakPtr
Definition: ImageAttributeTypes.h:38
Plan indexed attribute will be initialized taking into account z, c and t components of image...
Definition: PlanIndexedInitializerTypes.h:61
processor::OutputInitializerPtr fromOther(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const PlanIndexedAttributeConstWeakPtr &pInputAttribute)
function allowing to initialize a plan indexed collection with respect to a given other plan indexed ...
Definition: PlanIndexedInitializerOperators.h:157
Definition of import/export macro for library.
Plan indexed attribute will be initialized taking into account c and t components of image...
Definition: PlanIndexedInitializerTypes.h:59
boost::shared_ptr< BaseOutputInitializer > OutputInitializerPtr
shared pointer to output intializer
Definition: OutputInitializerTypes.h:51
void init(const PlanIndexedAttributeWeakPtr &pOutputAttribute, const ImageAttributeConstWeakPtr &pInputImageAttribute, const eFromImagePlanIndexedPolicy &fromImagePlanIndexedPolicy)
initialize object
Definition: FromImagePlanIndexedInitializer.h:97
boost::shared_ptr< const BaseImageAttribute > ImageAttributeConstPtr
Definition: ImageAttributeTypes.h:32
processor::OutputInitializerPtr fromImage(const boost::weak_ptr< OutputAttributeType > &pOutputAttribute, const ImageAttributeConstWeakPtr &pInputImageAttribute, const eFromImagePlanIndexedPolicy &fromImagePlanIndexedPolicy)
function allowing to initialize a plan indexed collection with respect to a given image geometry ...
Definition: PlanIndexedInitializerOperators.h:38
eFromImagePlanIndexedPolicy
enumerate describing rule behavior for image plans matching
Definition: PlanIndexedInitializerTypes.h:47
Class allowing initialization of a plan indexed collection from an other plan indexed collection...
Definition: FromOtherPlanIndexedInitializer.h:31
Predefined type for image management.
processor::OutputInitializerPtr fromImageButColor(const boost::shared_ptr< OutputAttributeType > &pOutputAttribute, const ImageAttributeConstPtr &pInputAttribute)
function allowing to initialize a plan indexed collection with respect to a given image geometry ...
Definition: PlanIndexedInitializerOperators.h:72
Class allowing to initialize a plan indexed collection from plans of an image.
Definition: FromImagePlanIndexedInitializer.h:33