IPSDK 4.1.1.0
IPSDK : Image Processing Software Development Kit
IPSDK Interface documentation

2D Porosity analysis plugin


The 2D Porosity analysis[1] plugin is designed to detect, segment and analyze porosities of materials in 2D. It is accessible via one dedicated button, inside the menu bar of IPSDK Explorer.

Porosity2DButton.png
Porosity plugin button inside IPSDK Explorer


Input selection

The module window contains a dropdown menu at the top left corner to select an input image to process. Both grayscale and RGB formats are supported, for individual 2D images or sequences of 2D images.

InputImageList.png
2d Image selection via dropdown list


Note
Input images must be loaded inside IPSDK Explorer to be selected inside the dropdown list.



Configuration management

The second dropdown menu appearing on the right corner allows to choose and reload previously saved configurations. The special entry "..." refers to the last auto-saved configuration made during the last preview.

ModuleSettings.png
At the bottom left, the parameters savings, and at the top right corner, the parameters importation and management


Buttons Description
Validate.png
Apply the settings to the different processing sections
Delete.png
Delete the current setting selected in the list
Add_Macro.png
Import saved settings
Export_Macro.png
Export saved settings
Save.png
Save current configuration
Refresh.png
Reset all the settings to default values
Configuration buttons


The checkbox Keep images for next process is an optional setting that allows to keep processed images in memory for the next process, and therefore gain some time during computations. When this option is checked, the last previewed image will be saved in memory, reducing redundant computations.

To save the current configuration :


Module Section Structure


The core of the plugin window includes seven distinct and collapsible processing sections :


Each processing section is made up of individual functions.

Each line is described as follows :

Here is an example with the pre process section :

sectionStructure.png
Architecture of a process section



Pre Process


This section is intended to enhance image quality before the detection of the porosities.

It includes:


Here's an example of pre processing :

porosity2d_preprocess.png
Pre process of a grey level image by applying a median of size 5 and removing bright spots of size 3.


Binarization


This step converts the pre-processed image into a binary mask highlighting the porosities.

This section includes 5 thresholding methods, with 3 classical algorithms :

And also two advanced options :

Parameters vary depending on the chosen method. The documentation of each function is accessible through Explorer function sections, using the
button.

Here is an example of a binarization using the Simple threshold method :

porosity2d_binarization.png
Binarization of porosities using the simple threshold method.


The simple threshold method allows to select a threshold manually by entering a minimum and a maximum value inside the entry fields, or by clicking the
button.

After clicking the edit button, a new window opens allowing to choose a threshold using the double slider at the bottom of the window.

porosity2d_binarization_simpleThreshold.png
Simple threshold window


When using the smart segmentation method, a pre-trained model is needed. The documentation shows how to build a smart segmentation model here.

The smart segmentation option allows to select a pre-trained model and to choose the model classes to use for the binarization.

Note
The trained model relies on the pre-processed image as input; therefore, any changes to the pre-processing steps afterward may cause the model to malfunction or deliver inaccurate results.



binarization_smartSegmentation.png


The
button can be used to refresh the models list, in case the model doesn't appear in the list.


Here is an example of binarization using the smart segmentation method :

porosity2d_binarization_smartSegmentation.png
Binarization of porosities using the smart segmentation method and extracting the class 1


Besides the smart segmentation algorithm, the macro-based binarization can be usefull for very complex images binarization.


Morphological Operations


Morphological operations refine the binary image by cleaning up artifacts and enhancing the separation of porosities.

Available operations are :

Each operation is optional and configurable.

Here's an example of small objects removal using the morphological operations inside the module :

porosity2d_morphologicalOperations.png
Binary image cleaning using hole filling (size 50) and morphological opening (size 5)



Separation


A segmentation is performed here to label individual porosities for further analysis.

Three different segmentation methods are available :

Only one method can be selected at a time.

porosity2d_separation.png
Porosity segmentation using the adaptive watershed algorithm with a ratio of 0.8


Post Process


Additional cleaning of the labeled result can be performed here using a set of post-processing tools.

This section implements 4 different methods :


Here is an example of post process :

porosity2d_postProcess.png
Post process of a label image using the fill holes method, the border kill method and the remove small shapes method



Measures

This section provides quantitative analysis of the segmented porosities.

It is divided in two different parts :

Measures selection

The right pane lists all available measurements.

measuresRight.png
Measures are separated in 2 different categories and again in multiple sub-categories


The preview button gives a peak of the results inside IPSDK Explorer.

Selected Measures

Once a measure is added, they appear on the left side with the possibility to compute two histograms by clicking the checkboxes.

measuresLeft.png


Sieves can be customized under Settings → Sieves → Preferences.

sieveSelection.png
Sieves can be created and edited inside the sieves edition window


Output Images


This section defines the type of output results (label images, binary masks, overlays, etc.) to compute and save.

Output type Description Example
Label image Returns a label image of the segmented porosities
porosity2d_output_label.png
Color image Returns the label image as a RGB image
porosity2d_output_RGB.png
Merge input and color image Returns the input image blended with the label image in overlay
porosity2d_output_overlay.png
Input image with contours Returns the input image blended with the contours of the labels in overlay
porosity2d_output_contour2.png


Note
The blending ratio value of the overlay output option can be changed, as well as the contour size value of the contours image output.



Saving and Launching Analyses


At the bottom right, three buttons control the execution of the analyses :


Here's an example of display inside IPSDK Explorer when launching an analysis :

porosity2d_launch_analysis.png


The
button, at the bottom right, shows the python code for the current analysis pipeline. This code can be saved as a python script, or edited as a macro.


pythonCode.png




References


[1] https://en.wikipedia.org/wiki/Porosimetry

[2] https://en.wikipedia.org/wiki/Watershed_(image_processing)