IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PlanIndexedInitializerUtils.h
Go to the documentation of this file.
1 // PlanIndexedInitializerUtils.h:
3 // ------------------------------
4 //
14 
15 #ifndef __IPSDKIMAGEPROCESSING_PLANINDEXEDINITIALIZERUTILS_H__
16 #define __IPSDKIMAGEPROCESSING_PLANINDEXEDINITIALIZERUTILS_H__
17 
18 #include <IPSDKBaseData/PlanIndex/PlanIndex.h>
19 #include <IPSDKBaseData/PlanIndex/BasePlanIndexedColl.h>
20 #include <IPSDKImage/Image/BaseImage.h>
21 #include <boost/function.hpp>
22 
23 namespace ipsdk {
24 namespace imaproc {
25 
28 
32 template <typename T>
33 void
34 initPlanIndexed(const ipUInt64 sizeZ, const ipUInt64 sizeC,
35  const ipUInt64 sizeT, T& coll,
36  boost::function<typename T::StorageType ()> planCreator)
37 {
38  // clear of input collection
39  coll.clear();
40 
41  // insert new elements into collection
42  for (ipUInt64 t=0; t<sizeT; ++t) {
43 
44  for (ipUInt64 c=0; c<sizeC; ++c) {
45 
46  for (ipUInt64 z=0; z<sizeZ; ++z) {
47 
48  // retrieve current plan index
49  PlanIndex curPlanIndex(z, c, t);
50 
51  // create a new plan storage type
52  typedef typename T::ValueType ValueType;
53  typedef typename T::StorageType StorageType;
54  StorageType pCurStorage(planCreator());
55 
56  // insert it into collection
57  coll.insert(curPlanIndex, pCurStorage);
58  }
59  }
60  }
61 }
62 
65 
66 } // end of namespace imaproc
67 } // end of namespace ipsdk
68 
69 #endif // __IPSDKIMAGEPROCESSING_PLANINDEXEDINITIALIZERUTILS_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
void initPlanIndexed(const ipUInt64 sizeZ, const ipUInt64 sizeC, const ipUInt64 sizeT, T &coll, boost::function< typename T::StorageType()> planCreator)
function allowing to initialize a plan indexed collection with respect to given components sizes ...
Definition: PlanIndexedInitializerUtils.h:34
Class used to store image plan index.
Definition: PlanIndex.h:26