IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
SubImageSplitOperators.h
Go to the documentation of this file.
1 // SubImageSplitOperators.h:
3 // -------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_SUBIMAGESPLITOPERATORS_H__
16 #define __IPSDKIMAGEPROCESSING_SUBIMAGESPLITOPERATORS_H__
17 
19 #include <IPSDKImageProcessing/DataSplit/SubImage/SubImageSplit.h>
20 #include <IPSDKImage/Image/BaseImage.h>
22 #include <boost/make_shared.hpp>
23 #include <boost/utility/enable_if.hpp>
24 #include <boost/mpl/equal_to.hpp>
25 #include <boost/mpl/not_equal_to.hpp>
26 
27 namespace ipsdk {
28 namespace imaproc {
29 
32 
36 template <typename TProcessor, typename TAttribute>
37 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
38 split2d(const image::ImagePtr& pImage)
39 {
40  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
41  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
46  pImage);
47 
48  return pDataSplit;
49 }
50 template <typename TProcessor, typename TAttribute>
51 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
53 {
54  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
55  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
60  pImage);
61 
62  return pDataSplit;
63 }
64 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
65 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
66 split2d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
67 {
68  return split2d<TProcessor, TAttribute>(pInputAttribute->getStorage());
69 }
71 
77 template <typename TProcessor, typename TAttribute>
78 boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
80 {
81  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
82  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
83  if ((pImage->getVolumeGeometryType() != image::eVolumeGeometryType::eVGT_2d) ||
84  (pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey) ||
85  (pImage->getTemporalGeometryType() != image::eTemporalGeometryType::eTGT_Single)) {
86 
91  pImage);
92  }
93  else
94  pDataSplit->init(eSubImageSplitType::eSIST_Grey2d,
95  pImage);
96 
97  return pDataSplit;
98 }
99 template <typename TProcessor, typename TAttribute>
100 boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
102 {
103  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
104  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
105  if ((pImage->getVolumeGeometryType() != image::eVolumeGeometryType::eVGT_2d) ||
106  (pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey) ||
107  (pImage->getTemporalGeometryType() != image::eTemporalGeometryType::eTGT_Single)) {
108 
113  pImage);
114  }
115  else
116  pDataSplit->init(eSubImageSplitType::eSIST_Grey2d,
117  pImage);
118 
119  return pDataSplit;
120 }
121 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
122 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
123 split2dOrSingle(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
124 {
125  return split2dOrSingle<TProcessor, TAttribute>(pInputAttribute->getStorage());
126 }
128 
132 template <typename TProcessor, typename TAttribute>
133 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
135 {
136  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
137  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
142  pImage);
143 
144  return pDataSplit;
145 }
146 template <typename TProcessor, typename TAttribute>
147 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
149 {
150  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
151  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
156  pImage);
157 
158  return pDataSplit;
159 }
160 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
161 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
162 splitColor2d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
163 {
164  return splitColor2d<TProcessor, TAttribute>(pInputAttribute->getStorage());
165 }
167 
173 template <typename TProcessor, typename TAttribute>
174 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
176 {
177  if (pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey)
178  return splitColor2d<TProcessor, TAttribute>(pImage);
179  else
180  return split2d<TProcessor, TAttribute>(pImage);
181 }
182 template <typename TProcessor, typename TAttribute>
183 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
185 {
186  if (pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey)
187  return splitColor2d<TProcessor, TAttribute>(pImage);
188  else
189  return split2d<TProcessor, TAttribute>(pImage);
190 }
191 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
192 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
193 splitColorOrGrey2d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
194 {
195  return splitColorOrGrey2d<TProcessor, TAttribute>(pInputAttribute->getStorage());
196 }
198 
202 template <typename TProcessor, typename TAttribute>
203 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
205 {
206  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
207  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
212  pImage);
213 
214  return pDataSplit;
215 }
216 template <typename TProcessor, typename TAttribute>
217 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
219 {
220  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
221  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
226  pImage);
227 
228  return pDataSplit;
229 }
230 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
231 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
232 splitSequence2d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
233 {
234  return splitSequence2d<TProcessor, TAttribute>(pInputAttribute->getStorage());
235 }
237 
241 template <typename TProcessor, typename TAttribute>
242 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
243 split3d(const image::ImagePtr& pImage)
244 {
245  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
246  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
251  pImage);
252 
253  return pDataSplit;
254 }
255 template <typename TProcessor, typename TAttribute>
256 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
258 {
259  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
260  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
265  pImage);
266 
267  return pDataSplit;
268 }
269 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
270 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
271 split3d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
272 {
273  return split3d<TProcessor, TAttribute>(pInputAttribute->getStorage());
274 }
276 
282 template <typename TProcessor, typename TAttribute>
283 boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
285 {
286  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
287  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
288  if ((pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey) ||
289  (pImage->getTemporalGeometryType() != image::eTemporalGeometryType::eTGT_Single)) {
290 
295  pImage);
296  }
297  else
298  pDataSplit->init(eSubImageSplitType::eSIST_Grey3d,
299  pImage);
300 
301  return pDataSplit;
302 }
303 template <typename TProcessor, typename TAttribute>
304 boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
306 {
307  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
308  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
309  if ((pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey) ||
310  (pImage->getTemporalGeometryType() != image::eTemporalGeometryType::eTGT_Single)) {
311 
316  pImage);
317  }
318  else
319  pDataSplit->init(eSubImageSplitType::eSIST_Grey3d,
320  pImage);
321 
322  return pDataSplit;
323 }
324 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
325 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
326 split3dOrSingle(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
327 {
328  return split3dOrSingle<TProcessor, TAttribute>(pInputAttribute->getStorage());
329 }
331 
335 template <typename TProcessor, typename TAttribute>
336 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
338 {
339  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
340  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
345  pImage);
346 
347  return pDataSplit;
348 }
349 template <typename TProcessor, typename TAttribute>
350 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
352 {
353  typedef SubImageSplit<TProcessor, TAttribute> DataSplit;
354  boost::shared_ptr<DataSplit> pDataSplit = boost::make_shared<DataSplit>();
359  pImage);
360 
361  return pDataSplit;
362 }
363 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
364 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
365 splitColor3d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
366 {
367  return splitColor3d<TProcessor, TAttribute>(pInputAttribute->getStorage());
368 }
370 
376 template <typename TProcessor, typename TAttribute>
377 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
379 {
380  if (pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey)
381  return splitColor3d<TProcessor, TAttribute>(pImage);
382  else
383  return split3d<TProcessor, TAttribute>(pImage);
384 }
385 template <typename TProcessor, typename TAttribute>
386 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
388 {
389  if (pImage->getColorGeometryType() != image::eColorGeometryType::eCGT_Grey)
390  return splitColor3d<TProcessor, TAttribute>(pImage);
391  else
392  return split3d<TProcessor, TAttribute>(pImage);
393 }
394 template <typename TProcessor, typename TAttribute, typename TInputAttribute>
395 inline boost::shared_ptr<SubImageSplit<TProcessor, TAttribute> >
396 splitColorOrGrey3d(const boost::shared_ptr<TInputAttribute>& pInputAttribute)
397 {
398  return splitColorOrGrey3d<TProcessor, TAttribute>(pInputAttribute->getStorage());
399 }
401 
404 
405 } // end of namespace imaproc
406 } // end of namespace ipsdk
407 
408 #endif // __IPSDKIMAGEPROCESSING_SUBIMAGESPLITOPERATORS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
No color(c) parsing will be done for image split.
Definition: SubImageSplitTypes.h:76
Image will be parsed through its volume(z) component for split.
Definition: SubImageSplitTypes.h:60
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > splitColorOrGrey3d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 3d color plans of image are consid...
Definition: SubImageSplitOperators.h:378
No volume(z) parsing will be done for image split.
Definition: SubImageSplitTypes.h:62
Image splitted in grey 3d sub images.
Definition: SubImageSplitTypes.h:36
2d geometry
Definition: GeometryComponentTypes.h:34
boost::shared_ptr< BaseImage > ImagePtr
Definition: ImageTypes.h:139
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > splitColorOrGrey2d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 2d color plans of image are consid...
Definition: SubImageSplitOperators.h:175
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > split3dOrSingle(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 3d volumes of image are considered...
Definition: SubImageSplitOperators.h:284
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > split2d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 2d plans of image are considered a...
Definition: SubImageSplitOperators.h:38
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > split2dOrSingle(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 2d plans of image are considered a...
Definition: SubImageSplitOperators.h:79
single element temporal geometry
Definition: GeometryComponentTypes.h:78
Image will be parsed through its color(c) component for split.
Definition: SubImageSplitTypes.h:74
Template class used to split image into sub images for data dispatch.
Definition: SubImageSplit.h:28
grey level geometry
Definition: GeometryComponentTypes.h:47
Image splitted in grey 2d sub images.
Definition: SubImageSplitTypes.h:34
No temporal(t) parsing will be done for image split.
Definition: SubImageSplitTypes.h:90
boost::shared_ptr< const BaseImage > ImageConstPtr
Definition: ImageTypes.h:140
Image splitted in color 3d sub images.
Definition: SubImageSplitTypes.h:40
void init(const eSubImageSplitType &subImageSplitType, const eVolumeParsingType &volumeParsingType, const eColorParsingType &colorParsingType, const eTemporalParsingType &temporalParsingType, const InputStorageType &pImage)
initialization method for splitted objects
Definition: SubImageSplit.h:113
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > splitColor3d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 3d color images are considered as ...
Definition: SubImageSplitOperators.h:337
Image splitted in color 2d sub images.
Definition: SubImageSplitTypes.h:38
Image will be parsed through its temporal(t) component for split.
Definition: SubImageSplitTypes.h:88
Image splitted in sequence 2d sub images.
Definition: SubImageSplitTypes.h:42
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > splitColor2d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 2d color plans of image are consid...
Definition: SubImageSplitOperators.h:134
Predefined operators for static data split used for data dispatch.
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > splitSequence2d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 2d sequence plans of image are con...
Definition: SubImageSplitOperators.h:204
boost::shared_ptr< SubImageSplit< TProcessor, TAttribute > > split3d(const image::ImagePtr &pImage)
create a splitted image operation used for data dispatch where all 3d volumes of image are considered...
Definition: SubImageSplitOperators.h:243