IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Local Extrema Extraction 3dSee full documentation
Voxels3dextractLocalExtrema3d (inImg3d,inFeaturesDistX,inFeaturesDistY,inFeaturesDistZ)
Voxels3dextractLocalExtrema3d (inImg3d,inFeaturesDistX,inFeaturesDistY,inFeaturesDistZ,localExtremaConfig)

Detailed Description

extraction of local extrema (minima or maxima) in a 3d image

This algorithm computes the local extrema (minimum or maximum, strict or not) for each 3d data of the input image.

In other words, the results will be computed :

Two wrappers can be called : the extractLocalExtrema3d wrapper is only used to compute the extrema extraction on a grey level 3d volume, whereas the multiSlice_extractLocalExtrema3d wrapper must be used for more complex data (sequence and/or color).

See Local Extrema Extraction 2d for more details about the algorithm parameters.

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFeatureDetection as fd

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# half size neighbourhood definition
halfSizeKnlX = 1
halfSizeKnlY = 1
halfSizeKnlZ = 1
# local extrema configuration definition
threshold = -30
nbTotPoints = 2000
localExtremaConfig = PyIPSDK.createLocalExtremaConfig(PyIPSDK.eLocalExtremumType.eLET_StrictMax, threshold, nbTotPoints)
# local extrema computation
outVoxels3d = fd.extractLocalExtrema3d(inImg, halfSizeKnlX, halfSizeKnlY, halfSizeKnlZ, localExtremaConfig)
# retrieve coordinates of maximum detected extrema
maxVoxel3d = PyIPSDK.toPyDict(outVoxels3d)['Coll'][0]
print("Maximum extrema value " + str(maxVoxel3d['Intensity'] ) + " found on coordinates x=" + str(maxVoxel3d['X'] ) + ", y=" + str(maxVoxel3d['Y'] ) + " and z=" + str(maxVoxel3d['Z'] ))

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLFeatureDetection/Processor/ExtractLocalExtrema3d/ExtractLocalExtrema3d.h>

Code Example

// ------------ Calculation on a mono-slice grey level image ------------ //
// Create the local extrema configuration instance, specifying the local extremum type,
// the threshold and the number of total points. All these parameters are optional
LocalExtremaConfigPtr pLocalExtremaConfig = createLocalExtremaConfig(localExtremumType, threshold, nbTotPoints);
// Define the image geometry
ImageGeometryPtr pInputImageGeometry = geometry3d(type, sizeX, sizeY, sizeZ);
// Load the input image
ImagePtr pInImg = loadRawImageFile(inImgFilePath, *pInputImageGeometry);
// Extrcat the local extrema, in a given neighbourhood
Voxels3dPtr pExtremaColl = extractLocalExtrema3d(pInImg, halfKnlSizeX, halfKnlSizeY, halfKnlSizeZ, pLocalExtremaConfig);
// Retrieve the extrema collection
const std::vector< boost::shared_ptr<Voxel3d> > extremaColl = pExtremaColl->getNodeColl<Voxels3d::Coll>();
const ipUInt64 nbPoints = extremaColl.size();
// ------------ Calculation on a multi-slice grey level image ------------ //
// Extrcat the local extrema, in a given neighbourhood
PlanIndexedVoxels3dPtr pExtremaColl_multiSlice = multiSlice_extractLocalExtrema3d(pInImg_multiSlice, halfKnlSizeX, halfKnlSizeY, halfKnlSizeZ, pLocalExtremaConfig);
// Retrieve the extrema collection for the frame 2, the channel 1
const std::vector< boost::shared_ptr<Voxel3d> > extremaColl_multiSlice = pExtremaColl_multiSlice->getValue(0, 1, 2).getNodeColl<Voxels3d::Coll>();