IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
PythonImageUtils.h
Go to the documentation of this file.
1 // PythonImageUtils.h:
3 // -------------------
4 //
14 
15 #ifndef __PYIPSDKBASE_PYTHONIMAGEUTILS_H__
16 #define __PYIPSDKBASE_PYTHONIMAGEUTILS_H__
17 
18 // suppression warnings
19 // warning C4244: 'return' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data
20 #pragma warning (push)
21 #pragma warning (disable : 4244)
22 
27 #include <boost/python/numpy.hpp>
28 
29 namespace ipsdk {
30 namespace python {
31 
34 
39 createImage(const image::eImageBufferType& imageBufferType,
40  const ipUInt64 sizeX, const ipUInt64 sizeY);
41 
46 createImageRgb(const image::eImageBufferType& imageBufferType,
47  const ipUInt64 sizeX, const ipUInt64 sizeY);
48 
53 createImageSeq(const image::eImageBufferType& imageBufferType,
54  const ipUInt64 sizeX, const ipUInt64 sizeY, const ipUInt64 sizeT);
55 
60 createImage(const image::eImageBufferType& imageBufferType,
61  const ipUInt64 sizeX, const ipUInt64 sizeY, const ipUInt64 sizeZ);
62 
68 createImage(const image::BaseImageGeometry& geometry);
69 
74 createDistributedImage(const image::BaseImageGeometry& geometry);
75 
80 createGpuImage(const image::BaseImageGeometry& geometry);
81 
84 
91 fromArray(boost::python::numpy::ndarray& pythonArray);
92 
98 fromRgbArray(boost::python::numpy::ndarray& pythonArray);
99 
106 fromBinaryArray(boost::python::numpy::ndarray& pythonArray);
107 
114 fromLabelArray(boost::python::numpy::ndarray& pythonArray);
115 
121 fromArray(boost::python::numpy::ndarray& pythonArray,
122  const image::BaseImageGeometry& geometry);
123 
126 
138 extractPlan(const ipUInt64 zPlanIdx,
139  const ipUInt64 cPlanIdx,
140  const ipUInt64 tPlanIdx,
141  const image::BaseImage& inputImage);
143 extractPlan(const ipUInt64 zPlanIdx,
144  const ipUInt64 cPlanIdx,
145  const ipUInt64 tPlanIdx,
146  image::BaseImage& inputImage);
148 
160 extractPlan(const PlanIndex& planIdx,
161  const image::BaseImage& inputImage);
163 extractPlan(const PlanIndex& planIdx,
164  image::BaseImage& inputImage);
166 
177 extractPlan(const ipUInt64& planIdx,
178  const image::BaseImage& inputImage);
180 extractPlan(const ipUInt64& planIdx,
181  image::BaseImage& inputImage);
183 
195 extractVolume(const ipUInt64 cPlanIdx,
196  const ipUInt64 tPlanIdx,
197  const image::BaseImage& inputImage);
199 extractVolume(const ipUInt64 cPlanIdx,
200  const ipUInt64 tPlanIdx,
201  image::BaseImage& inputImage);
203 
215 extractColor(const ipUInt64 zPlanIdx,
216  const ipUInt64 tPlanIdx,
217  const image::BaseImage& inputImage);
219 extractColor(const ipUInt64 zPlanIdx,
220  const ipUInt64 tPlanIdx,
221  image::BaseImage& inputImage);
223 
235 extractTemporal(const ipUInt64 zPlanIdx,
236  const ipUInt64 cPlanIdx,
237  const image::BaseImage& inputImage);
239 extractTemporal(const ipUInt64 zPlanIdx,
240  const ipUInt64 cPlanIdx,
241  image::BaseImage& inputImage);
243 
255 extractColorVolume(const ipUInt64 tPlanIdx,
256  const image::BaseImage& inputImage);
258 extractColorVolume(const ipUInt64 tPlanIdx,
259  image::BaseImage& inputImage);
261 
273 extractTemporalVolume(const ipUInt64 cPlanIdx,
274  const image::BaseImage& inputImage);
276 extractTemporalVolume(const ipUInt64 cPlanIdx,
277  image::BaseImage& inputImage);
279 
291 extractTemporalColor(const ipUInt64 zPlanIdx,
292  const image::BaseImage& inputImage);
294 extractTemporalColor(const ipUInt64 zPlanIdx,
295  image::BaseImage& inputImage);
297 
309 extractSubSequence(const ipUInt64 temporalStartOffset,
310  const ipUInt64 temporalSize,
311  const image::BaseImage& inputImage);
313 extractSubSequence(const ipUInt64 temporalStartOffset,
314  const ipUInt64 temporalSize,
315  image::BaseImage& inputImage);
317 
329 extractSubVolume(const ipUInt64 volStartOffset,
330  const ipUInt64 volSize,
331  const image::BaseImage& inputImage);
333 extractSubVolume(const ipUInt64 volStartOffset,
334  const ipUInt64 volSize,
335  image::BaseImage& inputImage);
337 
348 concatenateSequences(const image::ImageConstPtr& pInputImage1,
349  const image::ImageConstPtr& pInputImage2);
351 concatenateSequences(const image::ImagePtr& pInputImage1,
352  const image::ImagePtr& pInputImage2);
354 
365 concatenateVolumes(const image::ImageConstPtr& pInputImage1,
366  const image::ImageConstPtr& inputImage2);
368 concatenateVolumes(const image::ImagePtr& pInputImage1,
369  const image::ImagePtr& pInputImage2);
370 
373 
374 } // end of namespace python
375 } // end of namespace ipsdk
376 
377 #pragma warning (pop)
378 
379 #endif // __PYIPSDKBASE_PYTHONIMAGEUTILS_H__
PYIPSDKBASE_API image::ImageConstPtr extractColor(const ipUInt64 zPlanIdx, const ipUInt64 tPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of color plans from an other image
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
PYIPSDKBASE_API image::ImageConstPtr extractPlan(const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of a single plan from an other image
PYIPSDKBASE_API image::ImageConstPtr extractTemporalVolume(const ipUInt64 cPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of a sequence 3d volume from an other image
PYIPSDKBASE_API PythonImagePtr createImageRgb(const image::eImageBufferType &imageBufferType, const ipUInt64 sizeX, const ipUInt64 sizeY)
function allowing to create a new python rgb 2d image
PYIPSDKBASE_API image::ImageConstPtr extractVolume(const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of a 3d volume from an other image
PYIPSDKBASE_API image::ImageConstPtr extractTemporalColor(const ipUInt64 zPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of sequence color plans from an other image
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
PYIPSDKBASE_API image::ImageConstPtr extractSubVolume(const ipUInt64 volStartOffset, const ipUInt64 volSize, const image::BaseImage &inputImage)
extraction of a sub image composed of a sub volume from an other image
PYIPSDKBASE_API PythonImagePtr fromBinaryArray(boost::python::numpy::ndarray &pythonArray)
function allowing to create a python binary image view from an existing array
boost::shared_ptr< BaseImage > ImagePtr
Definition: ImageTypes.h:139
PYIPSDKBASE_API PythonImagePtr createImage(const image::eImageBufferType &imageBufferType, const ipUInt64 sizeX, const ipUInt64 sizeY)
function allowing to create a new python 2d image
Predefined types for python image management.
#define PYIPSDKBASE_API
Import/Export macro for library PyIPSDKBase.
Definition: PyIPSDKBaseExports.h:25
PYIPSDKBASE_API PythonImagePtr fromArray(boost::python::numpy::ndarray &pythonArray)
function allowing to create python image view from an existing array
PYIPSDKBASE_API image::ImageConstPtr extractColorVolume(const ipUInt64 tPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of a color 3d volume from an other image
boost::shared_ptr< PythonCudaImage > PythonCudaImagePtr
Definition: PythonImageTypes.h:44
PYIPSDKBASE_API python::PythonCudaImagePtr createGpuImage(const image::BaseImageGeometry &geometry)
function allowing to create a new gpu image from an existing geometry
PYIPSDKBASE_API image::DistributedImagePtr createDistributedImage(const image::BaseImageGeometry &geometry)
function allowing to create a new distributed image from an existing geometry
boost::shared_ptr< PythonImage > PythonImagePtr
Definition: PythonImageTypes.h:25
IPSDKIMAGE_API ImageGeometryPtr geometry(const eImageBufferType &imageBufferType, const ipUInt64 sizeX, const ipUInt64 sizeY, const VolumeGeometry &volumeGeometry, const ColorGeometry &colorGeometry, const TemporalGeometry &temporalGeometry)
create an image geometry
PYIPSDKBASE_API image::ImageConstPtr concatenateVolumes(const image::ImageConstPtr &pInputImage1, const image::ImageConstPtr &inputImage2)
generation of a sub image composed of the volume concatenation of two 3d images
PYIPSDKBASE_API image::ImageConstPtr extractSubSequence(const ipUInt64 temporalStartOffset, const ipUInt64 temporalSize, const image::BaseImage &inputImage)
extraction of a sub image composed of a sub sequence from an other image
Utility functions for image management.
Predefined types for image geometry management.
PYIPSDKBASE_API PythonImagePtr fromRgbArray(boost::python::numpy::ndarray &pythonArray)
function allowing to create a rgb python 2d image view from an existing array
boost::shared_ptr< const BaseImage > ImageConstPtr
Definition: ImageTypes.h:140
PYIPSDKBASE_API PythonImagePtr fromLabelArray(boost::python::numpy::ndarray &pythonArray)
function allowing to create a python label image view from an existing array
boost::shared_ptr< DistributedImage > DistributedImagePtr
Definition: DistributedImageTypes.h:38
Definition of import/export macro for library.
PYIPSDKBASE_API image::ImageConstPtr extractTemporal(const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const image::BaseImage &inputImage)
extraction of a sub image composed of sequence plans from an other image
PYIPSDKBASE_API PythonImagePtr createImageSeq(const image::eImageBufferType &imageBufferType, const ipUInt64 sizeX, const ipUInt64 sizeY, const ipUInt64 sizeT)
function allowing to create a new python sequence 2d image
PYIPSDKBASE_API image::ImageConstPtr concatenateSequences(const image::ImageConstPtr &pInputImage1, const image::ImageConstPtr &pInputImage2)
generation of a sub image composed of the concatenation of two sequence images
eImageBufferType
types associated to image buffers
Definition: ImageTypes.h:78