![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
tutorial for basic 2d quantification process More...
tutorial for basic 2d quantification process
This script introduces basics for 2d quantification problems resolution using the IPSDK library. The following figure presents such problems :
It presents some classical processing steps used during 2d quantification :
The application can be called through a command line as follows:
<application_script_filename> [--inputImgFilePath <input_image_file_path>] [--outputReportPath <output_report_file_path>] [--inHalfKnlSize <half_kernel_size>] [--inSpaceSigma <space_sigma_value>] [--inDilateFactor <dilate_factor>]
Arguments:
--inputImgFilePath optional; specifies the name of the TIFF file, from
which the input grey level image will be loaded; if not
specified by the user, the input image is loaded from file
<DEV_ROOT>/data/Sample/images/blobs_483x348_UInt8.tif
--outputReportPath optional; specifies the name of the CSV file, in
which the output quantification will be saved; if not
specified by the user, the output results file is saved to
file <TEMPORARY_IPSDK_DIR>/Sample/quantification2d.csv
--inHalfKnlSize optional; specifies the value of half kernel size along each axis,
used while applying the mean smoothing filter; if not
specified by the user, equals to 3 by default
--inSpaceSigma optional; specifies the value of the spatial Gaussian standard deviation,
used while applying the 2d separated bilateral filter; if not
specified by the user, equals to 8 by default
--inDilateFactor optional; specifies the value of the dilatation factor
used while applying the 2d watershed-based binary separation; if not
specified by the user, equals to 5 by defaultWe start by importing all necessary libraries:
Then we define the input parameters.
We load the input image from the associated TIFF file, by calling the function ipsdk::image::file::loadTiffImageFile.
The first step consists in input image filtering to remove noise. In this tutorial we use Separated bilateral smoothing 2d filter. The good choice of used filter is a quite difficult task since it is dependent on input image type and on searched shapes.
At this step, the user will have to make a choice which is generally the result of successive try. See Filtering image operations for a list of available filters. There is no universal solution for that step, the user could nevertheless be interested in following questions :
Once the input image is filtered, we process to an automatic image binarization. In this tutorial we use Otsu Threshold binarization filter.
Please note in the previous image the connected area enhanced by red circles. During the next step, we will automatically separate these areae using a binary separation technic based on watershed algorithm (Watershed Binary Separation 2d).
Once all the shapes are separated, we can proceed to a connected components analysis (Connected Component 2d) :
And then to the extraction of associated shapes (Label shape extraction 2d) :
We can now define :
And finally compute these measures :
Lastly, we save the measurement report into a csv format.
Data can also be directly accessed through python using the following syntax :
Or plotted using histogram measure feature (requests matplotlib to be installed):
See the full source listing
1.8.14