IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Classes | Typedefs | Enumerations | Functions
ipsdk::image::tools Namespace Reference

Namespace aggregating basic image tools components. More...

Classes

class  IPSDKBaseImageToolsException
 Exception class for library IPSDKBaseImageTools. More...
 

Typedefs

typedef std::set< eFormulaImageIdFormulaImageIdSet
 collection of image identifiers
 
typedef boost::shared_ptr< ImageFormulaManager > ImageFormulaManagerPtr
 
typedef boost::shared_ptr< const ImageFormulaManager > ImageFormulaManagerConstPtr
 

Enumerations

enum  eImageFormulaResultType { eIFRT_Logic, eIFRT_Arithmetic }
 Enumerate describing image formula result type. More...
 
enum  eImageFormulaImageType { eIFIT_Image2d, eIFIT_Image3d }
 Enumerate describing image formula image type. More...
 
enum  eImageFormulaOperatorType {
  eIFOT_UnaryPlus, eIFOT_UnaryMinus, eIFOT_Not, eIFOT_Plus,
  eIFOT_Minus, eIFOT_Multiply, eIFOT_Divide, eIFOT_Power,
  eIFOT_And, eIFOT_Or, eIFOT_Equal, eIFOT_NotEqual,
  eIFOT_Greater, eIFOT_GreaterOrEqual, eIFOT_Lower, eIFOT_LowerOrEqual
}
 Enumerate describing image formula operation type. More...
 
enum  eImageFormulaUnaryArithmeticFunctionType {
  eIFUAFT_Abs, eIFUAFT_Sqrt, eIFUAFT_Exp, eIFUAFT_Log,
  eIFUAFT_Cos, eIFUAFT_Sin, eIFUAFT_Tan, eIFUAFT_ACos,
  eIFUAFT_ASin, eIFUAFT_ATan
}
 Enumerate describing image formula unary arithmetical function type. More...
 
enum  eImageFormulaBinaryArithmeticFunctionType { eIFBAFT_ATan2 }
 Enumerate describing image formula binary arithmetical function type. More...
 
enum  eImageFormulaGenericArithmeticFunctionType {
  eIFGAFT_Min, eIFGAFT_Max, eIFGAFT_Sum, eIFGAFT_Mean,
  eIFGAFT_Median, eIFGAFT_StdDev, eIFGAFT_Variance, eIFGAFT_NormL1,
  eIFGAFT_NormL2
}
 Enumerate describing image formula generic arithmetical function type. More...
 
enum  eImageFormulaCoupledArithmeticFunctionType { eIFCAFT_Distance }
 Enumerate describing image formula coupled arithmetical function type. More...
 
enum  eImageFormulaTernaryLogicFunctionType { eIFTLFT_If }
 Enumerate describing image formula ternary logical function type. More...
 
enum  eImageFormulaMapFunctionType { eIFMFT_Lut }
 Enumerate describing image formula map function type. More...
 
enum  eImageFormulaStaticBoolean { eIFSB_True, eIFSB_False }
 enumerate describing formula static boolean More...
 
enum  eImageFormulaStaticConstant { eIFSC_Pi, eIFSC_E }
 enumerate describing formula static constants More...
 
enum  eImageFormulaDynamicConstant {
  eIFDC_PointXCoord, eIFDC_PointYCoord, eIFDC_PointZCoord, eIFDC_ImageSizeX,
  eIFDC_ImageSizeY, eIFDC_ImageSizeZ, eIFDC_ImageCenterX, eIFDC_ImageCenterY,
  eIFDC_ImageCenterZ
}
 enumerate describing formula dynamic constants More...
 
enum  eFormulaImageId {
  eFII_GreyLevelImage1, eFII_GreyLevelImage2, eFII_GreyLevelImage3, eFII_BinaryImage1,
  eFII_BinaryImage2, eFII_BinaryImage3, eFII_LabelImage1, eFII_LabelImage2,
  eFII_LabelImage3
}
 enumerate allowing to identify an image More...
 
enum  eImageFormulaImageConstant {
  eIFIC_GLMin, eIFIC_GLMax, eIFIC_GLMean, eIFIC_GLStdDev,
  eIFIC_GLVariance
}
 enumerate describing formula image constants More...
 
enum  eImageFormulaStructuringElement {
  eIFSE_Square, eIFSE_Cube, eIFSE_Rectangle, eIFSE_Circle,
  eIFSE_Sphere, eIFSE_Linear, eIFSE_HalfLinear
}
 enumerate describing formula structuring elements More...
 
enum  eIPSDKBaseImageToolsMessage
 Enumerate describing messages. More...
 

Functions

template<typename T >
IPSDKBASEIMAGETOOLS_API const T * extractBufferData (const CudaImage &cudaImg, const ipUInt64 deviceIdx)
 Extracts a buffer data from a CudaImage as a const T* data.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API T * extractBufferData (CudaImage &cudaImg, ipUInt64 deviceIdx)
 Extracts a buffer data from a CudaImage as a T* data.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API const T * extractBufferData (const CudaImage &cudaImg, const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx)
 Extracts a buffer data from a CudaImage as a const T* data.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API T * extractBufferData (CudaImage &cudaImg, const ipUInt64 zPlanIdx, const ipUInt64 cPlanIdx, const ipUInt64 tPlanIdx)
 Extracts a buffer data from a CudaImage as a T* data.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API const std::vector< const T * > extractBufferDataColl (const CudaImage &cudaImg)
 Creates a std::vector containing the buffers of all the plan of an image.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API const std::vector< T * > extractBufferDataColl (CudaImage &cudaImg)
 Creates a std::vector containing the buffers of all the plan of an image.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API const T ** extractBufferDataCollToGpu (const CudaImage &cudaImg)
 Exports the std::vector created by extractBufferDataColl to gpu.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API T ** extractBufferDataCollToGpu (CudaImage &cudaImg)
 Exports the std::vector created by extractBufferDataColl to gpu.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API void freeBufferDataColl (const T **pDeviceData)
 Free the vector allocated by extractBufferDataColl.
 
template<typename T >
IPSDKBASEIMAGETOOLS_API void freeBufferDataColl (T **pDeviceData)
 
IPSDKBASEIMAGETOOLS_API std::string implementGetPixel2d (const eImageBufferType &bufType)
 Function implementing in a std::string the access to a pixel in a buffer. The output contains the function that can be called inside a GPU kernel: T1 getPixel2d(__global const T1* in, const unsigned long sizeX, const unsigned long sizeY, const int x, const int y, const int z, const int borderPolicyType, const T1 outOfImageValue) "T1" is replaced by the standard type associated to bufType borderPolicyType describes the border policy and can equal: More...
 
IPSDKBASEIMAGETOOLS_API std::string implementCopyDataToLocalMemory2d (const eImageBufferType &bufTypeIn, const eImageBufferType &bufTypeOut, const int groupSizeX, const int groupSizeY, const int localSizeX, const int localSizeY)
 Function implementing in a std::string the copy of a part of an input buffer into a local buffer. The output contains the function that can be called inside a GPU kernel: void copyDataToLocalMemory2d(__global const T1* in, const ulong sizeX, const ulong sizeY, const ulong localSizeX, const ulong localSizeY, const int paddingX, const int paddingY, const int borderPolicyType, const T1 outOfImageValue, __local T2* localImage) "T1" and "T2" are replaced by the standard type associated to bufType borderPolicyType describes the border policy and can equal: More...
 
IPSDKBASEIMAGETOOLS_API std::string implementConvert (const eImageBufferType &bufTypeIn, const eImageBufferType &bufTypeOut)
 Function implementing in a std::string the type conversion of the input value. The output contains the function that can be called inside a GPU kernel: T2 cast_T1_to_T2(const T1 in) "T1" and "T2" are replaced by the standard type associated to bufType, e.g. uint cast_short_to_uint(const short in)
 
IPSDKBASEIMAGETOOLS_API std::string generateConvertType (const ipsdk::image::eImageBufferType &bufType)
 According to an image buffer type, the functions returns a string of the standard type (e.g. eImageBufferType::eIBT_Int8 -> "char", eImageBufferType::eIBT_UInt32 -> "uint")
 
IPSDKBASEIMAGETOOLS_API void replaceAllOccurrences (const std::string &templateStr, const std::string &newStr, std::string &srcStr)
 Replaces all occurrences of a template templateStr in srcStr by another string newStr. srcStr is overwritten. Example: srcStr = "T1 x;", templateStr = "T1", newStr = "int" -> srcStr becomes "int x;".
 
IPSDKBASEIMAGETOOLS_API const std::string & getIPSDKBaseImageToolsLoggerName ()
 Recovery of logger name associated to library.
 
IPSDKBASEIMAGETOOLS_API log4cplus::Logger & getIPSDKBaseImageToolsLogger ()
 Recovery of logger associated to library.
 
IPSDKBASEIMAGETOOLS_API const ipsdk::LogMessageManagergetIPSDKBaseImageToolsLogMessageManager ()
 Recovery of message manager associated to library.
 

Detailed Description

Namespace aggregating basic image tools components.

Typedef Documentation

◆ ImageFormulaManagerPtr

typedef boost::shared_ptr<ImageFormulaManager> ipsdk::image::tools::ImageFormulaManagerPtr

shared pointer to ImageFormulaManager object

◆ ImageFormulaManagerConstPtr

typedef boost::shared_ptr<const ImageFormulaManager> ipsdk::image::tools::ImageFormulaManagerConstPtr

shared pointer to ImageFormulaManager object

Enumeration Type Documentation

◆ eIPSDKBaseImageToolsMessage

Enumerate describing messages.

Note
This enumerate is associated to a message map
See also
IPSDK_Message_Map

Function Documentation

◆ implementGetPixel2d()

IPSDKBASEIMAGETOOLS_API std::string ipsdk::image::tools::implementGetPixel2d ( const eImageBufferType bufType)

Function implementing in a std::string the access to a pixel in a buffer. The output contains the function that can be called inside a GPU kernel: T1 getPixel2d(__global const T1* in, const unsigned long sizeX, const unsigned long sizeY, const int x, const int y, const int z, const int borderPolicyType, const T1 outOfImageValue) "T1" is replaced by the standard type associated to bufType borderPolicyType describes the border policy and can equal:

  • 0 (equivalent to eBorder2dType::eB2DT_Valued, data outside the image are set to outOfImageValue),
  • 1 (equivalent to eBorder2dType::eB2DT_Continue),
  • 2 (equivalent to eBorder2dType::eB2DT_Miror)
    Note
    even if we process 2D data, we need to specify a z-index to manage all the buffer plans

◆ implementCopyDataToLocalMemory2d()

IPSDKBASEIMAGETOOLS_API std::string ipsdk::image::tools::implementCopyDataToLocalMemory2d ( const eImageBufferType bufTypeIn,
const eImageBufferType bufTypeOut,
const int  groupSizeX,
const int  groupSizeY,
const int  localSizeX,
const int  localSizeY 
)

Function implementing in a std::string the copy of a part of an input buffer into a local buffer. The output contains the function that can be called inside a GPU kernel: void copyDataToLocalMemory2d(__global const T1* in, const ulong sizeX, const ulong sizeY, const ulong localSizeX, const ulong localSizeY, const int paddingX, const int paddingY, const int borderPolicyType, const T1 outOfImageValue, __local T2* localImage) "T1" and "T2" are replaced by the standard type associated to bufType borderPolicyType describes the border policy and can equal:

  • 0 (equivalent to eBorder2dType::eB2DT_Valued, data outside the image are set to outOfImageValue),
  • 1 (equivalent to eBorder2dType::eB2DT_Continue),
  • 2 (equivalent to eBorder2dType::eB2DT_Miror) The local image buffer size is (groupSizeX+2*paddingX)x(groupSizeY+2*paddingY), where groupSizeX = get_local_size(0) and groupSizeY = get_local_size(1)