Measure of common statistics indicators in the image (mean, max, etc.) algorithm.
This algorithm computes statistic measurements 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 statsMsr3d wrapper is only used to compute the statistic measurements on a grey level 3d volume, whereas the multiSlice_statsMsr3d wrapper must be used for more complex data (sequence and/or color).
See ipsdk::imaproc::attr::StatsResult for a complete list of image statistic measurements processed by this algorithm.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
statsMsrResult = glbmsr.statsMsr3d(inImg)
mean = statsMsrResult.mean
print("Mean value for image is " + str(mean))
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLGlobalMeasure/Processor/StatsMsr3d/StatsMsr3d.h>
Code Example
const ipUInt64 uPixCount = pStatsRes->getValue<StatsResult::PixCount>();
const ipReal64 fSum = pStatsRes->getValue<StatsResult::Sum>();
const ipReal64 fMean = pStatsRes->getValue<StatsResult::Mean>();
const ipReal64 fStdDev = pStatsRes->getValue<StatsResult::StdDev>();
const ipReal64 fMin = pStatsRes->getValue<StatsResult::Min>();
const ipReal64 fMax = pStatsRes->getValue<StatsResult::Max>();
ImagePtr pInImg_multiSlice =
loadTiffImageFile(inImgPath_multiSlice, eTiffDirectoryMode::eTDM_Volume);
PlanIndexedStatsResultPtr pStatsRes_multiSlice = multiSlice_statsMsr3d(pInImg_multiSlice);
const ipUInt64 c = 1;
const ipUInt64 uPixCount_multiSlice = pStatsRes_multiSlice->getValue(0, c, 0).getNode<StatsResult::PixCount>().getValue();
const ipReal64 fSum_multiSlice = pStatsRes_multiSlice->getValue(0, c, 0).getNode<StatsResult::Sum>().getValue();
const ipReal64 fMean_multiSlice = pStatsRes_multiSlice->getValue(0, c, 0).getNode<StatsResult::Mean>().getValue();
const ipReal64 fStdDev_multiSlice = pStatsRes_multiSlice->getValue(0, c, 0).getNode<StatsResult::StdDev>().getValue();
const ipReal64 fMin_multiSlice = pStatsRes_multiSlice->getValue(0, c, 0).getNode<StatsResult::Min>().getValue();
const ipReal64 fMax_multiSlice = pStatsRes_multiSlice->getValue(0, c, 0).getNode<StatsResult::Max>().getValue();