![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
tutorial for basic 3d quantification process More...
tutorial for basic 3d quantification process
This script introduces basics for 3d quantification problems resolution using the IPSDK library.
It presents some classical processing steps used during 3d quantification :
The application can be called through a command line as follows:
<application_script_filename> [--inputImg3dFilePath <input_3d_image_file_path>] [--outputReportPath <output_report_file_path>] [--inHalfKnlSize <half_kernel_size>] [--inSpaceSigma <space_sigma_value>] [--inDilateFactor <dilate_factor>]
Arguments:
--inputImg3dFilePath 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/blobs3d_483x348x31_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/quantification3d.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 3d 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 3d 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 3d 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.
During the next step, we will automatically separate these particles using a binary separation technic based on watershed algorithm (Watershed Binary Separation 3d).
Once all the shapes are separated, we can proceed to a connected components analysis (Connected Component 3d) :
We can directly define a collection of measures that should be computed on the extracted shapes (see Shape Analysis and Measurement for a complete list of available measures) :
We can now compute these measures :
We note that unlike the 2d quantification sample, the shapes are not explicitly extracted from the labelled image. Instead, a smart version of the Shape Analysis 3d function is used. It extracts only the usefull shape information to compute the measures. Even if it is possible to explicitly extract the shapes from the labelled image, this approach is preferable since the shapes polyhedral approximation is computed only if it is required to compute a measure.
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