IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Python user interface functionalities

Python user interface functionalities. More...

Python user interface functionalities.

This group aggregates all PyIPSDK user interface functionalities

Note
To use this module, PyQt5 is recquired.

Displaying an image in an IPSDK python script

The function displayImg allows you to visualize a Python image in a script.
Here are the function parameters :

If the image is 3d, you can change the current plan with a slider, and also change between XY, XZ and YZ plans.
If there is an image in overlay, you can modify the opacity with a slider.
If the image type is Label16 or Label32, each label will have a different color.
If the image type is binary, pixels at True will be display in blue.

Note
The last call to displayImg must have its pause parameter set to True. Otherwise the process will finish and the windows will be closed automatically.

In this case we have a 3d image with a labeled image in overlay :

displayImg.png

Here is some code examples :

import PyIPSDK
import PyIPSDK.IPSDKUI as ui
#Create the QApplication
app = ui.getQApplication()
#Launch images
inImg = PyIPSDK.loadTiffImageFile(imagePath)
inImgOverlay = PyIPSDK.loadTiffImageFile(imagePathOverlay)
#Display image only
ui.displayImg(inImg)
#Display image with title and overlay
ui.displayImg(inImg,title = "Image1", overlayImg = inImgOverlay, pause = True)

Interactive image thresholding during an IPSDK python script

The function interactiveThreshold allows you to choose manualy threshold values during a python script.
Here are the function parameters :

If the image is 3d, you can change the current plan with a slider, and also change between XY, XZ and YZ plans.
If thresholdImg is not define, the image used to compute the threshold is inImg.
If the image to threshold is in color, the threshold will be apply on the lightness image.
You can display the mask of the threshold or the contour of this mask.
In this case we have a 2d image :

interactiveThreshold.png

Here is some code examples :

import PyIPSDK
import PyIPSDK.IPSDKUI as ui
#Create the QApplication
app = ui.getQApplication()
#Lauch images
inImg = PyIPSDK.loadTiffImageFile(imagePath)
thresholdImg = PyIPSDK.loadTiffImageFile(imagePathThreshold)
#Threshold image (inImg is the image displayed and the image used to compute the threshold)
res = ui.interactiveThreshold(inImg)
#Threshold image with thresholdImg (inImg is displayed and thresholdImg is used to compute the threshold)
res = ui.interactiveThreshold(inImg, title = "Image1, thresholdImg = thresholdImg)
#Get the outputs results
print (res.thresholdMin,res.thresholdMax,res.bValidated,res.thresholdedImg)