Voxels3d = | extractLocalExtrema3d (inImg3d,inFeaturesDistX,inFeaturesDistY,inFeaturesDistZ) |
Voxels3d = | extractLocalExtrema3d (inImg3d,inFeaturesDistX,inFeaturesDistY,inFeaturesDistZ,localExtremaConfig) |
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 :
- for the whole grey level 3d volume,
- for each channel of a color volume,
- for each frame in a 3d sequence,
- for each channel of each volume of a 3d sequence.
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
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
halfSizeKnlX = 1
halfSizeKnlY = 1
halfSizeKnlZ = 1
threshold = -30
nbTotPoints = 2000
localExtremaConfig = PyIPSDK.createLocalExtremaConfig(PyIPSDK.eLocalExtremumType.eLET_StrictMax, threshold, nbTotPoints)
outVoxels3d = fd.extractLocalExtrema3d(inImg, halfSizeKnlX, halfSizeKnlY, halfSizeKnlZ, localExtremaConfig)
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
Voxels3dPtr pExtremaColl = extractLocalExtrema3d(pInImg, halfKnlSizeX, halfKnlSizeY, halfKnlSizeZ, pLocalExtremaConfig);
const std::vector< boost::shared_ptr<Voxel3d> > extremaColl = pExtremaColl->getNodeColl<Voxels3d::Coll>();
const ipUInt64 nbPoints = extremaColl.size();
PlanIndexedVoxels3dPtr pExtremaColl_multiSlice = multiSlice_extractLocalExtrema3d(pInImg_multiSlice, halfKnlSizeX, halfKnlSizeY, halfKnlSizeZ, pLocalExtremaConfig);
const std::vector< boost::shared_ptr<Voxel3d> > extremaColl_multiSlice = pExtremaColl_multiSlice->getValue(0, 1, 2).getNodeColl<Voxels3d::Coll>();