IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Module demonstrating basics of PyIPSDK libraries. More...

Module demonstrating basics of PyIPSDK libraries.

Prerequisite

A minimal knowledge of python language is necessary to manipulate PyIPSDK Python binding.

Some python tutorials can be found at python official web site.

Overview

This scripts introduce IPSDK python wrappers basic manipulations.

Step by step tutorial

Used library imports

We start by importing all necessary libraries:

# import of standard python os library which allows basic interactions with operating system
import os
# import of PyIPSDK which is the core module for IPSDK library python wrapping
import PyIPSDK
# import of PyIPSDK.IPSDKIPLBasicMorphology sub module which allows to use morphological algorithm familly included in IPSDK
import PyIPSDK.IPSDKIPLBasicMorphology as morpho
Note
See Image processing algorithms for a complete list of IPSDK image processing algorithm family.

Handle image creation

New images can be created using following :

# creation of a 2d image with size 487x532 and with unsigned short data type
img2d1 = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_UInt16, 487, 532)
# once image define, user can query for image complete geometry
geometry2d1 = img2d1.getGeometry()
# or to basic image informations
sizeX2d1 = img2d1.getSizeX()
sizeY2d1 = img2d1.getSizeY()
bufferType2d1 = img2d1.getBufferType()
# creation of a 3d image with size 150x125x97 and with binary data type
img3d1 = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_Binary, 150, 125, 97)
sizeZ3d1 = img3d1.getSizeZ()
# creation of a RGB image with size 512x480 and with unsigned char data type
imgRgb1 = PyIPSDK.createImageRgb(PyIPSDK.eImageBufferType.eIBT_UInt8, 512, 480)
sizeCRgb1 = imgRgb1.getSizeC()
# creation of a sequence image with size 100x120x150 and with floating point data type
imgSeq1 = PyIPSDK.createImageSeq(PyIPSDK.eImageBufferType.eIBT_Real32, 100, 120, 150)
sizeTSeq1 = imgSeq1.getSizeT()
# previous images can also be created using a predefined geometry
geometry2d2 = PyIPSDK.geometry2d(PyIPSDK.eImageBufferType.eIBT_UInt16, 487, 532)
img2d2 = PyIPSDK.createImage(geometry2d2)
geometry3d2 = PyIPSDK.geometry3d(PyIPSDK.eImageBufferType.eIBT_Binary, 150, 125, 97)
img3d2 = PyIPSDK.createImage(geometry3d2)
geometryRgb2 = PyIPSDK.geometryRgb2d(PyIPSDK.eImageBufferType.eIBT_UInt8, 512, 480)
imgRgb2 = PyIPSDK.createImage(geometryRgb2)
geometrySeq2 = PyIPSDK.geometrySeq2d(PyIPSDK.eImageBufferType.eIBT_Binary, 100, 120, 150)
imgSeq2 = PyIPSDK.createImage(geometrySeq2)
Note
See ipsdk::image::eImageBufferType for a complete list of supported image buffer types.

Handle image files

Once imported PyIPSDK, user can start using library to :

Call of image processing algorithm

Once an input image loaded, user can apply processing algorithm on it :

# definition of used circular structuring element
inSE = PyIPSDK.circularSEXYInfo(8)
# erosion 2d image computation
outImg1 = morpho.erode2dImg(tiffImg2d1, inSE)

A detail description of each algorithm can be found in section Image processing algorithms.

For instance, used algorithm morpho.erode2dImg is described here : Erosion 2d.