IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Band-pass frequency filtering 3d

Filters a 3d image in Fourier domain by selecting a frequency range. More...

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::frequencyFiltering3dImg (const image::ImageConstPtr &pInImg3d, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev)
 wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::frequencyFiltering3dImg (const image::ImageConstPtr &pInImg3d, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev, const ipReal32 theta, const ipReal64 thetaRange, const ipReal32 phi, const ipReal64 phiRange)
 wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::frequencyFiltering3dImg (const image::ImageConstPtr &pInImg3d, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev, image::ImagePtr &pOutImg)
 wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::frequencyFiltering3dImg (const image::ImageConstPtr &pInImg3d, const attr::eFrequencyBandPassFilterType &frequencyBandPassFilterType, const ipReal64 cutoffFrequency, const ipReal32 inStdDev, const ipReal32 theta, const ipReal64 thetaRange, const ipReal32 phi, const ipReal64 phiRange, image::ImagePtr &pOutImg)
 wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range More...
 

Detailed Description

Filters a 3d image in Fourier domain by selecting a frequency range.

This algorithm applies a band-pass filter to the input image in the frequency domain. Such an approach is very powerful since a convolution in the spatial domain becomes a voxelwise multiplication in the Fourier domain. Hence, it is computationnally faster than a spatial filtering, in particular for large kernel sizes and 3d data. Moreover, it is possible to design a filter in order to fit a determined frequency range.

The steps of the algorithm are:

As for the 2d version of this algorithm, the user can specify two different band-pass filters :

where $ f = \sqrt{u^2+v^2+w^2}$, $u, v, w$ being respectively the frequencies along the image axes (see Band-pass frequency filtering 2d for more details about these filters).

In some images, it may be interesting to isolate a texture with a specific 3d orientation. For this reason, the algorithm allows to specify orientations theta and phi, as well as their ranges thetaRange and phiRange which will mask the filtered spectrum and keep only the information in the desired direction range, in degrees.

Note
We must have 0° $\leq$ theta $\leq$ 180°, -180° $\leq$ phi $\leq$ 180° and 0° < thetaRange, phiRange $\leq$ 180°. If not, the default values are theta = phi = 0° and thetaRange = phiRange = 180° (i.e. select all the orientations). Moreover, because of the the definition of theta (see Points and vectors 3d representation), only values between 0° and 180° are posible, hence the range [theta-thetaRange, theta+thetaRange] is saturated if it exceeds these limits.

See Band-pass frequency filtering 2d for a 2d example of band-pass filtering and Points and vectors 3d representation for more details about 3d trigonometry convention.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InFrequencyBandPassFilterType [Input] Indicates the band-pass filter to apply on the input image X
ipsdk::imaproc::attr::InCutoffFrequency [Input] Cutoff normalizes frequency for band-pass filtering in Fourier space (must belong to [-0.5, 0.5[) X
ipsdk::imaproc::attr::InStdDev [Input] standard deviation used for operation along all axis X
ipsdk::imaproc::attr::InOptTheta [Input Optional] 2d orientation for processing operation X
ipsdk::imaproc::attr::InOptRangeTheta [Input Optional] Orientation range in degrees X
ipsdk::imaproc::attr::InOptPhi [Input Optional] starting azimuth angle offset value X
ipsdk::imaproc::attr::InOptRangePhi [Input Optional] Orientation range in degrees X
ipsdk::imaproc::attr::OutWk1RealImg [Output] Temporary working image for algorithm duplicateInOut (_pOutWk1RealImg, _pInImg3d, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutWk2RealImg [Output] Temporary working image for algorithm duplicateInOut (_pOutWk2RealImg, _pInImg3d, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutWk3RealImg [Output] Temporary working image for algorithm duplicateInOut (_pOutWk3RealImg, _pInImg3d, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutWk4RealImg [Output] Temporary working image for algorithm duplicateInOut (_pOutWk4RealImg, _pInImg3d, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutImg [Output] image for processing operation duplicateInOut (_pOutImg, _pInImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutWk1RealImg,_pOutWk2RealImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutWk2RealImg,_pOutWk3RealImg) && 
ipsdk::imaproc::matchSizeAndType (_pOutWk3RealImg,_pOutWk4RealImg) && 
ipsdk::imaproc::matchSize (_pInImg3d,_pOutWk1RealImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# define the parameters
f0 = 0.2
sigma = 0.18
theta = 45
thetaRange = 30
phi = 0
phiRange = 20
# Gaussian Band-pass filtering
outGaussianImg = filter.frequencyFiltering3dImg(inImg, PyIPSDK.eFrequencyBandPassFilterType.eFBPFT_Gaussian, f0, sigma, theta, thetaRange, phi, phiRange)
# LogGabor Band-pass filtering
outLogGaborImg = filter.frequencyFiltering3dImg(inImg, PyIPSDK.eFrequencyBandPassFilterType.eFBPFT_LogGabor, f0, sigma, theta, thetaRange, phi, phiRange)

Example of C++ code :

Example informations

Associated library

IPSDKIPLFiltering

Header file

Code Example

// Gaussian frequency filtering
// -----------------------------------
ImagePtr pGaussOutImg = frequencyFiltering3dImg(pInImg, eFrequencyBandPassFilterType::eFBPFT_Gaussian, f0, sigma, theta, thetaRange, phi, phiRange);
// LogGabor frequency filtering
// -----------------------------------
ImagePtr pLogGaborOutImg = frequencyFiltering3dImg(pInImg, eFrequencyBandPassFilterType::eFBPFT_LogGabor, f0, sigma, theta, thetaRange, phi, phiRange);
See also
FrequencyFiltering3dImgLvl1
FrequencyFiltering3dImgLvl2

Function Documentation

◆ frequencyFiltering3dImg() [1/4]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::frequencyFiltering3dImg ( const image::ImageConstPtr pInImg3d,
const attr::eFrequencyBandPassFilterType frequencyBandPassFilterType,
const ipReal64  cutoffFrequency,
const ipReal32  inStdDev 
)

wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ frequencyFiltering3dImg() [2/4]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::frequencyFiltering3dImg ( const image::ImageConstPtr pInImg3d,
const attr::eFrequencyBandPassFilterType frequencyBandPassFilterType,
const ipReal64  cutoffFrequency,
const ipReal32  inStdDev,
const ipReal32  theta,
const ipReal64  thetaRange,
const ipReal32  phi,
const ipReal64  phiRange 
)

wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ frequencyFiltering3dImg() [3/4]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::frequencyFiltering3dImg ( const image::ImageConstPtr pInImg3d,
const attr::eFrequencyBandPassFilterType frequencyBandPassFilterType,
const ipReal64  cutoffFrequency,
const ipReal32  inStdDev,
image::ImagePtr pOutImg 
)

wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ frequencyFiltering3dImg() [4/4]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::frequencyFiltering3dImg ( const image::ImageConstPtr pInImg3d,
const attr::eFrequencyBandPassFilterType frequencyBandPassFilterType,
const ipReal64  cutoffFrequency,
const ipReal32  inStdDev,
const ipReal32  theta,
const ipReal64  thetaRange,
const ipReal32  phi,
const ipReal64  phiRange,
image::ImagePtr pOutImg 
)

wrapper function for Filters a 3d image in Fourier domain by selecting a frequency range

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure