IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ImageTile3dCollSplit.h
1 // ImageTile3dCollSplit.h:
3 // -----------------------
4 //
15 
16 #ifndef __IPSDKIMAGEPROCESSING_IMAGETILE3DCOLLSPLIT_H__
17 #define __IPSDKIMAGEPROCESSING_IMAGETILE3DCOLLSPLIT_H__
18 
19 #include <IPSDKImageProcessing/DataSplit/TileColl/BaseImageTile3dCollSplit.h>
20 #include <IPSDKImage/Fragment/Extractor/ImageTileExtractor.h>
21 
22 namespace ipsdk {
23 namespace imaproc {
24 
27 
28 template <typename TProcessor, typename TAttribute>
29 class ImageTile3dCollSplit : public BaseImageTile3dCollSplit<typename TAttribute::TileType>
30 {
31 // predefined public types
32 public:
34  typedef TProcessor ProcessorType;
35 
37  typedef TAttribute AttributeType;
38 
41 
44 
46  typedef boost::shared_ptr<InputImageType> InputImagePtrType;
47 
49  typedef typename TAttribute::TileType OutputTileType;
50 
53 
56 
57 public:
63 
64 // methods
65 public:
67  const std::string& getAttributeName() const;
68 
70  const std::string& getAttributeToolTip() const;
71 
87  void init(const boost::shared_ptr<InputImageType>& pImage,
88  const Tile3dCoordsColl& tile3dCoordsColl,
89  const ipUInt32 nbMinEltsPerSplit = 1,
90  const ipUInt32 nbMaxEltsPerSplit = NumericLimits<ipUInt32>::max());
91 
92 protected:
94  bool checkProcessorType(const processor::BaseProcessor& processor);
95 
97  Tile3dPtr extractTile3d(const Tile3dCoords& curTile3dCoords);
98 
103  const Tile3dColl& tile3dColl);
104 
105 // attributes
106 protected:
107 
108 };
109 
112 
113 template <typename TProcessor, typename TAttribute>
114 inline const std::string&
116 {
117  return TAttribute::getObjectNameStr();
118 }
119 
120 template <typename TProcessor, typename TAttribute>
121 inline const std::string&
123 {
124  return TAttribute::getToolTipStr();
125 }
126 
127 template <typename TProcessor, typename TAttribute>
128 inline void
129 ImageTile3dCollSplit<TProcessor, TAttribute>::init(const boost::shared_ptr<InputImageType>& pImage,
130  const Tile3dCoordsColl& tile3dCoordsColl,
131  const ipUInt32 nbMinEltsPerSplit,
132  const ipUInt32 nbMaxEltsPerSplit)
133 {
134  // call of base class initialization method
135  return this->initBase(pImage, tile3dCoordsColl, nbMinEltsPerSplit, nbMaxEltsPerSplit);
136 }
137 
138 template <typename TProcessor, typename TAttribute>
139 inline bool
141 {
142  // check for consistency between processor and attribute
144  "This attribute is not part of processor class");
145 
146  return dynamic_cast<const TProcessor*>(&processor) != 0;
147 }
148 
149 template <typename TProcessor, typename TAttribute>
152 {
153  Tile3dPtr pCurTile(boost::make_shared<OutputTileType>());
155  static_cast<ipUInt32>(curTile3dCoords._startOffsetX),
156  static_cast<ipUInt32>(curTile3dCoords._startOffsetY),
157  static_cast<ipUInt32>(curTile3dCoords._startOffsetZ),
158  curTile3dCoords._sizeX, curTile3dCoords._sizeY, curTile3dCoords._sizeZ,
159  *(this->getImagePtr()), *pCurTile);
160 
161  return pCurTile;
162 }
163 
164 template <typename TProcessor, typename TAttribute>
165 inline BoolResult
167  const Tile3dColl& tile3dColl)
168 {
169  // cast of input processor object
170  TProcessor& tProcessor = static_cast<TProcessor&>(processor);
171 
172  // update of processor attribute value
173  tProcessor.TProcessor::template set<TAttribute>(tile3dColl);
174 
175  return true;
176 }
177 
180 
181 } // end of namespace imaproc
182 } // end of namespace ipsdk
183 
184 #endif // __IPSDKIMAGEPROCESSING_OUTPUTIMAGETILE3DCOLLSPLIT_H__
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
BaseImageTile3dCollSplit< typename TAttribute::TileType > BaseClassType
base class type
Definition: ImageTile3dCollSplit.h:40
Concrete class for image tile 3d collection split operations for data dispatch using predefined coord...
Definition: ImageTile3dCollSplit.h:29
Base class for image tile 2d collection split operations for data dispatch.
Definition: BaseImageTile3dCollSplit.h:33
structure used to store tile 3d coordinates
Definition: ImageTileCollSplitTypes.h:65
bool checkProcessorType(const processor::BaseProcessor &processor)
check processor type in derived class
Definition: ImageTile3dCollSplit.h:140
TAttribute AttributeType
attribute type associated to object
Definition: ImageTile3dCollSplit.h:37
ipInt64 _startOffsetX
tile x start offset
Definition: ImageTileCollSplitTypes.h:68
Definition: NumericLimits.h:27
std::vector< Tile3dCoords > Tile3dCoordsColl
collection of tile 3d coordinates
Definition: ImageTileCollSplitTypes.h:87
boost::shared_ptr< OutputTileType > Tile3dPtr
shared pointer to tile
Definition: BaseImageTile3dCollSplit.h:75
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
const std::string & getAttributeName() const
retrieve attribute name associated to split operation
Definition: ImageTile3dCollSplit.h:115
void init(const boost::shared_ptr< InputImageType > &pImage, const Tile3dCoordsColl &tile3dCoordsColl, const ipUInt32 nbMinEltsPerSplit=1, const ipUInt32 nbMaxEltsPerSplit=NumericLimits< ipUInt32 >::max())
object initialization method
Definition: ImageTile3dCollSplit.h:129
BaseClassType::Tile3dColl Tile3dColl
tile 3d collection created by splitting operation
Definition: ImageTile3dCollSplit.h:55
BaseClassType::InputImageType InputImageType
input image type associated to operation
Definition: ImageTile3dCollSplit.h:43
ipInt64 _startOffsetZ
tile z start offset
Definition: ImageTileCollSplitTypes.h:74
TAttribute::TileType OutputTileType
output tile type associated to operation
Definition: ImageTile3dCollSplit.h:49
ipUInt64 _sizeY
tile y size
Definition: ImageTileCollSplitTypes.h:80
OutputTileType::ImageType InputImageType
input image type associated to operation
Definition: BaseImageTile3dCollSplit.h:38
boost::shared_ptr< InputImageType > InputImagePtrType
shared pointer to input image type associated to operation
Definition: ImageTile3dCollSplit.h:46
ipInt64 _startOffsetY
tile y start offset
Definition: ImageTileCollSplitTypes.h:71
TProcessor ProcessorType
processor type associated to object
Definition: ImageTile3dCollSplit.h:34
static void extractTile3d(const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const ipUInt64 tileStartOffsetX, const ipUInt64 tileStartOffsetY, const ipUInt64 tileStartOffsetZ, const ipUInt64 tileSizeX, const ipUInt64 tileSizeY, const ipUInt64 tileSizeZ, typename FragmentType::ImageType &inputImage, FragmentType &imageTile3d)
extraction of an image 3d tile from an image
Tile3dPtr extractTile3d(const Tile3dCoords &curTile3dCoords)
method allowing to create a new tile given its coordinates
Definition: ImageTile3dCollSplit.h:151
const std::string & getAttributeToolTip() const
retrieve attribute tooltip associated to split operation
Definition: ImageTile3dCollSplit.h:122
std::vector< Tile3dPtr > Tile3dColl
tile 3d collection created by splitting operation
Definition: BaseImageTile3dCollSplit.h:78
BoolResult processAttribute(processor::BaseProcessor &processor, const Tile3dColl &tile3dColl)
initialize processor attribute associate to split operation for a given tile 3d collection ...
Definition: ImageTile3dCollSplit.h:166
ipUInt64 _sizeZ
tile z size
Definition: ImageTileCollSplitTypes.h:83
BaseClassType::Tile3dPtr Tile3dPtr
shared pointer to tile
Definition: ImageTile3dCollSplit.h:52
ipUInt64 _sizeX
tile x size
Definition: ImageTileCollSplitTypes.h:77
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53