IPSDK 4.1
IPSDK : Image Processing Software Development Kit
Band-pass frequency filtering 3d
imagefrequencyFiltering3dImg (inImg3d,frequencyBandPassFilterType,cutoffFrequency,inStdDev)
imagefrequencyFiltering3dImg (inImg3d,frequencyBandPassFilterType,cutoffFrequency,inStdDev,theta,thetaRange,phi,phiRange)

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.

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

Header file

#include <IPSDKIPL/IPSDKIPLFiltering/Processor/FrequencyFiltering3dImg/FrequencyFiltering3dImg.h>

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