ImageDev

RingArtifactRemoval3d

Removes ring artifacts from a Computed Tomography volume.

Access to parameter description

This algorithm removes rings from CT images by comparing the means of voxel values in each ring and the mean value of the whole sample. Adjustments are then made to all voxel values.

First, an average cylindrical intensity profile $P$ is computed around the Z axis.
Then, this profile is subtracted from each intensity of the input image $I$. To preserve the initial data range, the mean value of the processed area is added.

The corrected value $O$ of a voxel $v$ of the input image $I$ is given by: $$ O(v) = I(v) - P(r) + \mu_e$$ where $P$ is the cylindrical profile intensity, $r$ is the distance from the ring center to $v$, and $\mu_e$ is the sample mean.

To focus the correction on phases of interest, two thresholds are proposed to The rings to remove must be in the XY plane of the volume. The CT volume is supposed to have been acquired along the Z rotation axis. If not, the volume must be rotated beforehand in order to align the rotation axis with the volume Z axis.

<b> (a) </b>
(a)
<b> (b) </b>
(b)
Figure 1. (a) Original CT image with ring artifacts. (b) Corrected image with ring artifact removal filter


See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
ringArtifactRemoval3d( std::shared_ptr< iolink::ImageView > inputImage,
                       RingArtifactRemoval3d::CenterMode centerMode,
                       iolink::Vector2u32 center,
                       iolink::Vector2d thresholdRange,
                       iolink::Vector2u32 radiusRange,
                       bool ignoreThresholdsForRings,
                       double coverPercentage,
                       bool singleRingMode,
                       iolink::Vector2u32 singleRingRadiusRange,
                       iolink::Vector2u32 singleRingSliceRange,
                       std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
ring_artifact_removal_3d( input_image,
                          center_mode = RingArtifactRemoval3d.CenterMode.IMAGE_CENTER,
                          center = [0, 0],
                          threshold_range = [0, 65535],
                          radius_range = [0, 255],
                          ignore_thresholds_for_rings = False,
                          cover_percentage = 0,
                          single_ring_mode = False,
                          single_ring_radius_range = [0, 255],
                          single_ring_slice_range = [0, 255],
                          output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
RingArtifactRemoval3d( IOLink.ImageView inputImage,
                       RingArtifactRemoval3d.CenterMode centerMode = ImageDev.RingArtifactRemoval3d.CenterMode.IMAGE_CENTER,
                       uint[] center = null,
                       double[] thresholdRange = null,
                       uint[] radiusRange = null,
                       bool ignoreThresholdsForRings = false,
                       double coverPercentage = 0,
                       bool singleRingMode = false,
                       uint[] singleRingRadiusRange = null,
                       uint[] singleRingSliceRange = null,
                       IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name RingArtifactRemoval3d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The 3D input image to correct. Image Grayscale or Multispectral nullptr
input
centerMode
The way to define the center of the cylindrical sample.
IMAGE_CENTER The center of the rings is the center of the input image.
OTHER The center of the rings is user-defined.
Enumeration IMAGE_CENTER
input
center
The X and Y coordinates center, defined in voxel units, for each volume slice of the concentric rings to remove. This parameter is ignored if the center mode is set to IMAGE_CENTER. Vector2u32 Any value {0, 0}
input
thresholdRange
Only voxel intensities inside this range are considered to compute the mean values used by the correction. Other values are processed anyway by the algorithm. Vector2d Any value {0.f, 65535.f}
input
radiusRange
The minimum and maximum radius, in voxel units, defining a hollow cylinder along the Z axis, which is used to compute the whole sample mean value. Vector2u32 Any value {0, 255}
input
ignoreThresholdsForRings
Enable or disable the coverPercentage parameter. Bool false
input
coverPercentage
If the percentage of voxels between the thresholds in any one ring is less than this value, then all the voxels in the ring are used in the calculation. This parameter is ignored if ignoreThresholdsForRings is disabled. Float64 [0, 100] 0
input
singleRingMode
Option to remove only one user-defined ring. Bool false
input
singleRingRadiusRange
The minimum and maximum radius, in voxel units, of the ring to remove. This parameter is ignored if the single ring mode is disabled. Vector2u32 Any value {0, 255}
input
singleRingSliceRange
The first and last slice index where the ring to remove is visible. This parameter is ignored if the single ring mode is disabled. Vector2u32 Any value {0, 255}
output
outputImage
The corrected image. Image nullptr

Object Examples

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

RingArtifactRemoval3d ringArtifactRemoval3dAlgo;
ringArtifactRemoval3dAlgo.setInputImage( foam );
ringArtifactRemoval3dAlgo.setCenterMode( RingArtifactRemoval3d::CenterMode::OTHER );
ringArtifactRemoval3dAlgo.setCenter( {40, 50} );
ringArtifactRemoval3dAlgo.setThresholdRange( {0, 255} );
ringArtifactRemoval3dAlgo.setRadiusRange( {0, 80} );
ringArtifactRemoval3dAlgo.setIgnoreThresholdsForRings( true );
ringArtifactRemoval3dAlgo.setCoverPercentage( 70.0 );
ringArtifactRemoval3dAlgo.setSingleRingMode( true );
ringArtifactRemoval3dAlgo.setSingleRingRadiusRange( {30, 70} );
ringArtifactRemoval3dAlgo.setSingleRingSliceRange( {1, 8} );
ringArtifactRemoval3dAlgo.execute();

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

ring_artifact_removal_3d_algo = imagedev.RingArtifactRemoval3d()
ring_artifact_removal_3d_algo.input_image = foam
ring_artifact_removal_3d_algo.center_mode = imagedev.RingArtifactRemoval3d.OTHER
ring_artifact_removal_3d_algo.center = [40, 50]
ring_artifact_removal_3d_algo.threshold_range = [0, 255]
ring_artifact_removal_3d_algo.radius_range = [0, 80]
ring_artifact_removal_3d_algo.ignore_thresholds_for_rings = True
ring_artifact_removal_3d_algo.cover_percentage = 70.0
ring_artifact_removal_3d_algo.single_ring_mode = True
ring_artifact_removal_3d_algo.single_ring_radius_range = [30, 70]
ring_artifact_removal_3d_algo.single_ring_slice_range = [1, 8]
ring_artifact_removal_3d_algo.execute()

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

RingArtifactRemoval3d ringArtifactRemoval3dAlgo = new RingArtifactRemoval3d
{
    inputImage = foam,
    centerMode = RingArtifactRemoval3d.CenterMode.OTHER,
    center = new uint[]{40, 50},
    thresholdRange = new double[]{0, 255},
    radiusRange = new uint[]{0, 80},
    ignoreThresholdsForRings = true,
    coverPercentage = 70.0,
    singleRingMode = true,
    singleRingRadiusRange = new uint[]{30, 70},
    singleRingSliceRange = new uint[]{1, 8}
};
ringArtifactRemoval3dAlgo.Execute();

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

Function Examples

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

auto result = ringArtifactRemoval3d( foam, RingArtifactRemoval3d::CenterMode::OTHER, {40, 50}, {0, 255}, {0, 80}, true, 70.0, true, {30, 70}, {1, 8} );

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

result = imagedev.ring_artifact_removal_3d( foam, imagedev.RingArtifactRemoval3d.OTHER, [40, 50], [0, 255], [0, 80], True, 70.0, True, [30, 70], [1, 8] )

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

IOLink.ImageView result = Processing.RingArtifactRemoval3d( foam, RingArtifactRemoval3d.CenterMode.OTHER, new uint[]{40, 50}, new double[]{0, 255}, new uint[]{0, 80}, true, 70.0, true, new uint[]{30, 70}, new uint[]{1, 8} );

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