Skip to main content

Multiscale BM3D filter for streak noise / ring artifact attenuation

This package contains the full pipeline for multiscale BM3D streak noise reduction in sinogram data as described in

Mäkinen, Y., Marchesini, S., Foi, A., 2021,
"Ring artifact reduction via multiscale nonlocal collaborative filtering of spatially correlated noise"
J. Synchrotron Rad. 28(3). DOI: http://doi.org/10.1107/S1600577521001910

Usage:

The denoising is applied to sinogram data.

NOTE: Input data streaks should be along the first axis: (theta, y, x) or (theta, x)

from bm3d_streak_removal import *

For the full pipeline as described in the paper:

data_denoised = full_streak_pipeline(data, brightfield, darkfield)

For extreme streak attenuation and multiscale denoising without normalizations (input is presumed to be in log-scale):

data_norm = extreme_streak_attenuation(data_norm)
data_denoised = multiscale_streak_removal(data_norm)

For a demo example, see the "demo" folder inside the package or download the demo files from https://webpages.tuni.fi/foi/streak/bm3d_streak_removal_demo.zip.

Adjusting the filter:

All algorithm parameters are automatically calculated based on the input data.

The main extra parameter is the horizontal binning count ("K"). The automatic value is based solely on axis size; while the usually a good guess, it may be possible to improve denoising quality by adjusting it. To reduce the number of scales (the denoising result was oversmooth in low frequencies):

# Bin count when max_bin_iter_horizontal='auto' (default)
default_bin_count = default_horizontal_bins(data_norm)

# Use one scale less
data_denoised = multiscale_streak_removal(data_norm, max_bin_iter_horizontal=default_bin_count-1)

Likewise, if the widest streaks were not denoised:

# Use one scale more
data_denoised = multiscale_streak_removal(data_norm, max_bin_iter_horizontal=default_bin_count+1)

For simple overall BM3D filtering strength adjustment, use the filter_strength parameter (default is 1):

# Increase filtering strength slightly
data_denoised = multiscale_streak_removal(data_norm, filter_strength=1.1)

For other possible inputs, see the respective function comments in the Python file.

License

The package is available for non-commercial use only. For details, see LICENSE.

Authors:

Ymir Mäkinen (ymir.makinen@tuni.fi)
Stefano Marchesini
Alessandro Foi

Release files for bm3d-streak-removal 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bm3d-streak-removal 0.2.0
File Size Uploaded
bm3d_streak_removal-0.2.0.tar.gz 39.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for bm3d-streak-removal 0.2.0
File Interpreter ABI Platform
bm3d_streak_removal-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.7 MB

Release files / bm3d_streak_removal-0.2.0.tar.gz

Download URL bm3d_streak_removal-0.2.0.tar.gz
Size 39.7 MB
Tags Source
SHA-256 checksum
How to use checksums
55ad39887b429697a647318d65d09565b18d86e22a00c942fac4392859eb5370
BLAKE2b-256 checksum
How to use checksums
6908c6353bb9c5ca602c6be25e7807784361df3aee6bb135064a81808f6dd725
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.2

Release files / bm3d_streak_removal-0.2.0-py3-none-any.whl

Download URL bm3d_streak_removal-0.2.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bcd5372369c3de63baf46df5815bcd8c2a9b6627e4b6bf3c4e6643762b5e9fa4
BLAKE2b-256 checksum
How to use checksums
9b01907bd81c49be4fe40719149dceeb79467fa39b75bfac103e40670606be90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page