IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Masked histogram measurement 3dSee full documentation
HistogramDatahistogramMaskMsr3d (inImg,inMaskImg)
HistogramDatahistogramMaskMsr3d (inImg,inMaskImg,histoPrms)

Detailed Description

calculates the histogram for each 3d volume of the portion of an input image

This algorithm computes the histogram on a subset of voxels for each 3d volume of a given input image. The subsets of voxels to consider are defined by the set of voxels whose values is different from 0 in the associated mask image.

The mask image is binary, and must have the same sizes as the input image.

See also
Histogram measurement 3d and Histogram measurement 2d for details about the definition of the histogram.
Note
Calling this algorithm with a mask image with all voxels set to 1 is equivalent to call Histogram measurement 3d algorithm.

Two wrappers can be called : the histogramMaskMsr3d wrapper is only used to compute the histogram measurements on a grey level 3d image, whereas the multiSlice_histogramMaskMsr3d wrapper must be used for more complex data (volume, sequence and/or color).

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# assuming we have declared variable associate to input images paths
# and we have initialized them...
# load input images from files
inImg = PyIPSDK.loadTiffImageFile(inImgFilePath, PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
inMaskImg = PyIPSDK.loadTiffImageFile(inMaskImgFilePath, PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
# compute histogram on expected portion of input image (portion defined by set of voxels different from 0 in binary image pInMaskImg)
outHisto = glbmsr.histogramMaskMsr3d(inImg, inMaskImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLGlobalMeasure/Processor/HistogramMaskMsr3d/HistogramMaskMsr3d.h>

Code Example

// assuming we have declared variable associate to input images paths
// and we have initialized them...
// load input images from files
ImagePtr pInImg = loadTiffImageFile(inImgFilePath, eTiffDirectoryMode::eTDM_Volume);
ImagePtr pInMaskImg = loadTiffImageFile(inMaskImgFilePath, eTiffDirectoryMode::eTDM_Volume);
// compute histogram on expected portion of input image (portion defined by set of voxels different from 0 in binary image pInMaskImg)
HistogramDataPtr pOutHisto = histogramMaskMsr3d(pInImg, pInMaskImg);