IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::HistogramDataPtr ipsdk::imaproc::glbmsr::histogramMaskMsr3d (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInMaskImg)
 wrapper function for calculates the histogram for each 3d data of an input image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::HistogramDataPtr ipsdk::imaproc::glbmsr::histogramMaskMsr3d (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInMaskImg, const ipsdk::imaproc::attr::HistoMsrParamsConstPtr &pHistoPrms)
 wrapper function for calculates the histogram for each 3d data of an input image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedHistogramDataPtr ipsdk::imaproc::glbmsr::multiSlice_histogramMaskMsr3d (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInMaskImg)
 wrapper function for calculates the histogram for each 3d data of an input image intersected with a mask More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedHistogramDataPtr ipsdk::imaproc::glbmsr::multiSlice_histogramMaskMsr3d (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInMaskImg, const ipsdk::imaproc::attr::HistoMsrParamsConstPtr &pHistoPrms)
 wrapper function for calculates the histogram for each 3d data of an input image intersected with a mask More...
 

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).

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InMaskImg [Input] Binary image for masking operation X
ipsdk::imaproc::attr::InOptHistoMsrParams [Input Optional] histogram measure parameters X
ipsdk::imaproc::attr::OutPIHistogram [Output] Plan indexed collection of histogram properties ipsdk::imaproc::fromImageButVolume (_pOutPIHistogram, _pInImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d,_pInMaskImg) && 
ipsdk::imaproc::matchImagePlans (_pOutPIHistogram,_pInImg3d,eImagePlansMatchPolicy::eIPMP_CT) && 
(ipsdk::processor::If (
  ipsdk::processor::isSet (_pInOptHistoMsrParams), ipsdk::imaproc::matchImageRange<ipsdk::imaproc::attr::HistoMsrParams::Min>(_pInImg3d,_pInOptHistoMsrParams) && ipsdk::imaproc::matchImageRange<ipsdk::imaproc::attr::HistoMsrParams::Max>(_pInImg3d,_pInOptHistoMsrParams) && ipsdk::processor::isGreater<ipsdk::imaproc::attr::HistoMsrParams::BinWidth>(_pInOptHistoMsrParams,0),
  ipsdk::processor::none ()))

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

Associated library

IPSDKIPLGlobalMeasure

Header file

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);
See also
HistogramMaskMsr3dLvl1
HistogramMaskMsr3dLvl2
HistogramMaskMsr3dLvl3

Function Documentation

◆ histogramMaskMsr3d() [1/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::HistogramDataPtr ipsdk::imaproc::glbmsr::histogramMaskMsr3d ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInMaskImg 
)

wrapper function for calculates the histogram for each 3d data of an input image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_histogramMaskMsr3d() [1/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedHistogramDataPtr ipsdk::imaproc::glbmsr::multiSlice_histogramMaskMsr3d ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInMaskImg 
)

wrapper function for calculates the histogram for each 3d data of an input image intersected with a mask

Note
This wrapper can be used with multi slice input images to retrieve by slice results
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ histogramMaskMsr3d() [2/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::HistogramDataPtr ipsdk::imaproc::glbmsr::histogramMaskMsr3d ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInMaskImg,
const ipsdk::imaproc::attr::HistoMsrParamsConstPtr pHistoPrms 
)

wrapper function for calculates the histogram for each 3d data of an input image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_histogramMaskMsr3d() [2/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedHistogramDataPtr ipsdk::imaproc::glbmsr::multiSlice_histogramMaskMsr3d ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInMaskImg,
const ipsdk::imaproc::attr::HistoMsrParamsConstPtr pHistoPrms 
)

wrapper function for calculates the histogram for each 3d data of an input image intersected with a mask

Note
This wrapper can be used with multi slice input images to retrieve by slice results
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure