ImageDev

RichardsonLucyDeconvolution3d

Restores a microscopy three-dimensional image with the Richardson-Lucy deconvolution.

Access to parameter description

This algorithm performs a fixed number of deconvolution steps using the Richardson Lucy deconvolution method which aims to remove the blur induced by the optical system, modelized by a Point Spread Function (PSF).

The process begins with an initial estimate of the output image, which is iteratively refined. At each iteration, the algorithm compares the convolution of the current estimate with the input PSF and updates the estimate accordingly.

Defining tiling mode and tile sizes can help manage memory usage efficiently, enabling the processing of large images that might otherwise exceed available memory.

Deconvolution algorithms can be memory-intensive because they operate in the Fourier domain and therefore require computing FFTs on both the input image and the point spread function (PSF). Although the PSF is initially much smaller than the input, it must be padded to the full image size before the FFT so that the convolution can be performed correctly. This padding, combined with the complex-valued intermediate buffers needed by the FFT, can lead to very high memory consumption on large images. Tiling helps reduce this footprint by performing the FFTs on smaller subregions, making it feasible to process datasets that would otherwise exceed the available system memory.

The deconvolution can be performed on spectal images but need a spectral PSF to work properly.

<b> Figure 1.</b> Evolution of the computation time relatively to the tile size. (Experimentations done a 1128x1128x80 data set with a 51x51x15 PSF and an Intel(R) Core(TM) i7-10850H CPU, 2.70 GHz, 12 logical processors))
Figure 1. Evolution of the computation time relatively to the tile size. (Experimentations done a 1128x1128x80 data set with a 51x51x15 PSF and an Intel(R) Core(TM) i7-10850H CPU, 2.70 GHz, 12 logical processors))


<b> Figure 2.</b> Evolution of the memory consumption relatively to the tile size. (Experimentations done a 1128x1128x80 data set with a 51x51x15 PSF and an Intel(R) Core(TM) i7-10850H CPU, 2.70 GHz, 12 logical processors)
Figure 2. Evolution of the memory consumption relatively to the tile size. (Experimentations done a 1128x1128x80 data set with a 51x51x15 PSF and an Intel(R) Core(TM) i7-10850H CPU, 2.70 GHz, 12 logical processors)


References

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > richardsonLucyDeconvolution3d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputPsfImage, uint32_t numberOfIterations, RichardsonLucyDeconvolution3d::InitialEstimate initialEstimate, RichardsonLucyDeconvolution3d::TilingMode tilingMode, const iolink::Vector3u32& tileSize, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
richardson_lucy_deconvolution_3d(input_image: idt.ImageType,
                                 input_psf_image: idt.ImageType,
                                 number_of_iterations: int = 10,
                                 initial_estimate: Union[Literal["CONSTANT"],Literal["INPUT_IMAGE"],RichardsonLucyDeconvolution3d.InitialEstimate] = RichardsonLucyDeconvolution3d.InitialEstimate.CONSTANT,
                                 tiling_mode: Union[Literal["NONE"],Literal["USER_DEFINED"],Literal["USER_DEFINED_LOW_MEMORY"],RichardsonLucyDeconvolution3d.TilingMode] = RichardsonLucyDeconvolution3d.TilingMode.NONE,
                                 tile_size: Iterable[int] = [256, 256, 256],
                                 output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
RichardsonLucyDeconvolution3d( IOLink.ImageView inputImage,
                               IOLink.ImageView inputPsfImage,
                               UInt32 numberOfIterations = 10,
                               RichardsonLucyDeconvolution3d.InitialEstimate initialEstimate = ImageDev.RichardsonLucyDeconvolution3d.InitialEstimate.CONSTANT,
                               RichardsonLucyDeconvolution3d.TilingMode tilingMode = ImageDev.RichardsonLucyDeconvolution3d.TilingMode.NONE,
                               uint[] tileSize = null,
                               IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Grayscale or Multispectral nullptr
input
inputPsfImage
The point spread function (PSF) that models the degradation filter. The PSF is passed as an image. It is recommended to use a PSF with an odd size. Image Grayscale or Multispectral nullptr
input
numberOfIterations
The number of iterations performed. UInt32 [1, 1000] 10
input
initialEstimate
The initial estimate of the deconvolution algorithm. If CONSTANT is chosen, a constant image is used initially. Often, this yields smoother results than the second option, namely input data.
Value Description
CONSTANT Use a constant image as the initial estimate.
INPUT_IMAGE Use the input image as the initial estimate.
Enumeration CONSTANT
input
tilingMode
The way to manage the memory.
Value Description
NONE The entire input image is processed as a single block. If the input image, intermediate images, and output image do not fit in memory, the computation will fail.
USER_DEFINED The input image is processed by tiles of a predefined size.
USER_DEFINED_LOW_MEMORY The input image is processed by tiles of a predefined size with additional low memory constraints. This option reduces memory consumption of the algorithm but can lead to smoother (less precise) results in homogeneous areas.
Enumeration NONE
input
tileSize
The tile width and height in pixels. This parameter is used only in USER_DEFINED tiling mode. Vector3u32 Any value {256, 256, 256}
output
outputImage
The output image. The output image characteristics are forced to the same as the input image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Grayscale or Multispectral None
input
input_psf_image
The point spread function (PSF) that models the degradation filter. The PSF is passed as an image. It is recommended to use a PSF with an odd size. image Grayscale or Multispectral None
input
number_of_iterations
The number of iterations performed. uint32 [1, 1000] 10
input
initial_estimate
The initial estimate of the deconvolution algorithm. If CONSTANT is chosen, a constant image is used initially. Often, this yields smoother results than the second option, namely input data.
Value Description
CONSTANT Use a constant image as the initial estimate.
INPUT_IMAGE Use the input image as the initial estimate.
enumeration CONSTANT
input
tiling_mode
The way to manage the memory.
Value Description
NONE The entire input image is processed as a single block. If the input image, intermediate images, and output image do not fit in memory, the computation will fail.
USER_DEFINED The input image is processed by tiles of a predefined size.
USER_DEFINED_LOW_MEMORY The input image is processed by tiles of a predefined size with additional low memory constraints. This option reduces memory consumption of the algorithm but can lead to smoother (less precise) results in homogeneous areas.
enumeration NONE
input
tile_size
The tile width and height in pixels. This parameter is used only in USER_DEFINED tiling mode. vector3u32 Any value [256, 256, 256]
output
output_image
The output image. The output image characteristics are forced to the same as the input image. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Grayscale or Multispectral null
input
inputPsfImage
The point spread function (PSF) that models the degradation filter. The PSF is passed as an image. It is recommended to use a PSF with an odd size. Image Grayscale or Multispectral null
input
numberOfIterations
The number of iterations performed. UInt32 [1, 1000] 10
input
initialEstimate
The initial estimate of the deconvolution algorithm. If CONSTANT is chosen, a constant image is used initially. Often, this yields smoother results than the second option, namely input data.
Value Description
CONSTANT Use a constant image as the initial estimate.
INPUT_IMAGE Use the input image as the initial estimate.
Enumeration CONSTANT
input
tilingMode
The way to manage the memory.
Value Description
NONE The entire input image is processed as a single block. If the input image, intermediate images, and output image do not fit in memory, the computation will fail.
USER_DEFINED The input image is processed by tiles of a predefined size.
USER_DEFINED_LOW_MEMORY The input image is processed by tiles of a predefined size with additional low memory constraints. This option reduces memory consumption of the algorithm but can lead to smoother (less precise) results in homogeneous areas.
Enumeration NONE
input
tileSize
The tile width and height in pixels. This parameter is used only in USER_DEFINED tiling mode. Vector3u32 Any value {256, 256, 256}
output
outputImage
The output image. The output image characteristics are forced to the same as the input image. Image null

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );
auto kernel_2d = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "kernel_2d.vip" );

RichardsonLucyDeconvolution3d richardsonLucyDeconvolution3dAlgo;
richardsonLucyDeconvolution3dAlgo.setInputImage( foam );
richardsonLucyDeconvolution3dAlgo.setInputPsfImage( kernel_2d );
richardsonLucyDeconvolution3dAlgo.setNumberOfIterations( 5 );
richardsonLucyDeconvolution3dAlgo.setInitialEstimate( RichardsonLucyDeconvolution3d::InitialEstimate::CONSTANT );
richardsonLucyDeconvolution3dAlgo.setTilingMode( RichardsonLucyDeconvolution3d::TilingMode::USER_DEFINED );
richardsonLucyDeconvolution3dAlgo.setTileSize( {32, 32, 32} );
richardsonLucyDeconvolution3dAlgo.execute();

std::cout << "outputImage:" << richardsonLucyDeconvolution3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))
kernel_2d = imagedev.read_vip_image(imagedev_data.get_image_path("kernel_2d.vip"))

richardson_lucy_deconvolution_3d_algo = imagedev.RichardsonLucyDeconvolution3d()
richardson_lucy_deconvolution_3d_algo.input_image = foam
richardson_lucy_deconvolution_3d_algo.input_psf_image = kernel_2d
richardson_lucy_deconvolution_3d_algo.number_of_iterations = 5
richardson_lucy_deconvolution_3d_algo.initial_estimate = imagedev.RichardsonLucyDeconvolution3d.CONSTANT
richardson_lucy_deconvolution_3d_algo.tiling_mode = imagedev.RichardsonLucyDeconvolution3d.USER_DEFINED
richardson_lucy_deconvolution_3d_algo.tile_size = [32, 32, 32]
richardson_lucy_deconvolution_3d_algo.execute()

print("output_image:", str(richardson_lucy_deconvolution_3d_algo.output_image))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );
ImageView kernel_2d = Data.ReadVipImage( @"Data/images/kernel_2d.vip" );

RichardsonLucyDeconvolution3d richardsonLucyDeconvolution3dAlgo = new RichardsonLucyDeconvolution3d
{
    inputImage = foam,
    inputPsfImage = kernel_2d,
    numberOfIterations = 5,
    initialEstimate = RichardsonLucyDeconvolution3d.InitialEstimate.CONSTANT,
    tilingMode = RichardsonLucyDeconvolution3d.TilingMode.USER_DEFINED,
    tileSize = new uint[]{32, 32, 32}
};
richardsonLucyDeconvolution3dAlgo.Execute();

Console.WriteLine( "outputImage:" + richardsonLucyDeconvolution3dAlgo.outputImage.ToString() );

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );
auto kernel_2d = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "kernel_2d.vip" );

auto result = richardsonLucyDeconvolution3d( foam, kernel_2d, 5, RichardsonLucyDeconvolution3d::InitialEstimate::CONSTANT, RichardsonLucyDeconvolution3d::TilingMode::USER_DEFINED, {32, 32, 32} );

std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))
kernel_2d = imagedev.read_vip_image(imagedev_data.get_image_path("kernel_2d.vip"))

result = imagedev.richardson_lucy_deconvolution_3d(foam, kernel_2d, 5, imagedev.RichardsonLucyDeconvolution3d.CONSTANT, imagedev.RichardsonLucyDeconvolution3d.USER_DEFINED, [32, 32, 32])

print("output_image:", str(result))
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );
ImageView kernel_2d = Data.ReadVipImage( @"Data/images/kernel_2d.vip" );

IOLink.ImageView result = Processing.RichardsonLucyDeconvolution3d( foam, kernel_2d, 5, RichardsonLucyDeconvolution3d.InitialEstimate.CONSTANT, RichardsonLucyDeconvolution3d.TilingMode.USER_DEFINED, new uint[]{32, 32, 32} );

Console.WriteLine( "outputImage:" + result.ToString() );



© 2026 Thermo Fisher Scientific Inc. All rights reserved.