KipTool manual: ImagingModules - neutronimaging/imagingsuite GitHub Wiki

ImagingModules

Return to Image Processing modules

Return to TOC

The ImagingModules library implements the most used image denoising algorithms. From the Image processing tab click the Add button and select the libImagingModules libraries, the following modules are available:

BBLogNorm

Implements the image referencing with the black body approach: reference normalization with scattering and systematic bias correction by processing dedicated images obtained with interposed grid of "blak bodies", i.e. neutron absorbers. Please refer to Boillat et al. and Carminati et al. for a full detailed description of the algorithm.

Briefly, the full normalization operation is computed using:

where background images (BG) are computed from BB images (background image computed from open beam images with BBs: , background image computed from sample image with BBs: ) and compensate for scattered neutrons from the sample and the experimental setup. BB images are expected to be acquired without the sample (open beam images with BB) and with the sample (sample images with BB). Several options for this module are available and can be configured through the module dialog.

The module dialog guides the user in the tuning of the parameters. In the first tab of the module dialog Module Settings do the following:

  1. Choose the Averaging method from the pull-down menu. This will be applied every time an averaging operation has to be applied to a stack of images (e.g. to the stack of open beam and dark current images). Options: ImageWeightedAverage, ImageAverage, ImageMedian, ImageMax, ImageMin, ImageSum. Default: ImageWeightedAverage.
  2. Choose the Referencing method from the pull-down menu. This allows to choose between the options Norm and LogNorm. The difference between the two options is the computation of the -log to the referenced images, this happens only in the LogNorm option. Default: LogNorm.
  3. Select the BB options from the pull-down menu. Options:
    • noBB: in absence of BB image to be processed. In this case, the usual flat field correction with dose normalization is applied.
    • Interpolate: in case a sparse set of BB images is acquired and the background for missing measurements is computed by linear interpolation. This is common for tomography, where a sparse tomography with BB is acquired and possibly time series, if BB images are acquired at different time step of the process.
    • Average: a stack of BB images is acquired. In this case the stack is averaged according to the Average method, and the same background is corrected for each input.
    • OneToOne: in this case each projection input data has an individual BB measure, with one to one correspondence
    • ExternalBB: backgrounds are computed in this case elsewhere and can be loaded as Pre-processed BB images in the bottom part of this dialog. This option might be useful when the same BB measurements are used for several datasets, so that the backgrounds are computed once and then re-used for other datasets

Default: Interpolate.

  1. In case your raw data are tomographic projections, select the first and last angle of the tomographic position.

  2. Load the Reference images: open beam and dark current datasets.

In the second tab BB images:

  1. Load the open beam with BB image. Check the displayed image in the bottom left panel. On this image select a region including all BBs to be used for background interpolation. To do so, click on the the green Get roi button before selecting the region. The green ROI will appear on the panel. Here avoid BBs which are only partially in the FOV and eventually the beam limiter.
  2. Load the sample images with BB. Here select an open beam region (red roi). Be sure to avoid the BB grid. In case the BB sample images are taken with a sparse tomography, type the first Scan angle and last scan Angle corresponding
  3. Click on the Compute error button to compute the BB mask and the interpolation error that is obtained by using the Interpolation method under the points defined by the BB mask.

Other hints: in most cases the default parameters for the BB mask segmentation and interpolation scheme are valid. However, should the BB mask segmentation fails, try to change the segmentation method to Manual threshold. There the input is a normalized threshold value, between 0 and 1, below which the points the BB open beam images are considered BBs. Try different threshold until a correct BB mask appears in the right bottom image panel. Should the Error appear somewhat "big" (tentatively above 0.3), then try to change the radius size, which defines the area within each BB to be used for computation and/or the interpolation method and order.

In the Output tab, there is the option to save the computed backgrounds to a user defined destination. One image will be saved for the instrumental background (computed from the the OB image with BB) and a stack of images for the sample scattering, with a number of images equal to number of input projection images. These type of images could then possibly used as ExternalBB (see the first tab description) to process other datasets with similar experimental setup.

The effect of the BB correction is a higher density in corrected projections, compared to the non-corrected ones, as a results of the compensation of the erroneous increase of transmission due to neutron scattering. Picture is reproduced from Carminati et al.

Go back up

MorphSpotCleaning

Implements a morphological filter combined with a smooth threshold to remove outliers, which may appear both as bright or dark spots in the images.

Morph spot clean uses the gray scale morphological algorithms find hole and find peak to detect the spots. It has the characteristic that also low intensity and wide spots can be corrected. I mostly run this module after normalization but it can also be used on the raw data. This is a snap shot of an algorithm under development that already performs well. It is rather slow and may sometimes detect and correct larger regions.

The algorithm uses the difference between the original and the filled image to detect the spots and mixes the original with the filled using a sigmoid weight with a user defined threshold and width. These parameters are found with the help of the cumulative histogram of the detection image as shown in the figure below.

Figure: Cumulative histograms of the detection images for fill hole and fill peak. The threshold functions defines how much the original image shall be corrected.
The module allows using the fill hole and fill peak separately or in a sequence. The following figure shows how the algorithm performs when the two detection methods are combined.

Figure: An example showing how the spot cleaning module processes an image with dark and bright spots.
The difference image shows the absolute difference between the original and processed image. Clearly, the spots are removed (with exception for the one connected with the image border). There is also some noise reduction effect of the filter. This means that also Poisson noise outliers are cleaned by the method.

  • cleanmethod - There are different ways to replace the outliers. The default morphcleanreplace replaces with the value from a smoothed projection.
  • connectivity - The morphological processing operates on pixel neighborhoods. The default value is conn4.
  • threshold - The threshold is used to discriminate the outliers from real image data. In the dialog a cumulative histogram helps you to find a suitable threshold 0.006
  • detectionmethod - You can select to clean positive, negative, or both types of outliers. Negative (holes) are mostly caused by outliers in the projections while positive (peaks) origniate in the reference data.
  • edgesmooth - An initialization parameter for the edge processing. It can be left at the default value 5
  • maxarea - Regions with more pixels than this value will be rejected from the spot list. Default value 30.
  • maxlevel - Data clamping for gray levels greater than this value. Default value is 12
  • minlevel - -0.1
  • sigma - Width of the mixing function, the value is mostly about 10% of the threshold. Default value is 0.01.

Go back up

StripeFilter

in this module vertical stripe mitigation is implemented with a combined wavelet and Fourier filtering as described in Muench et al.. A typical use case is the application of such a filter to compensate for vertical lines in the sinogram domain, which in turn result in ring artifact in the reconstructed computed tomography. However, it can be used for mitigating vertical lines that can occur in general during image acquisition.

Filter parameters are:

  • Wavelet name: The name of the wavelet base. Default value: daub15.
  • Decomposition level: Number of levels for the wavelet decomposition. Default value: 3.
  • Filter cut-off: Width of the Gaussian that forms the stop band (high pass cut-off frequency). Default value 0.05.
  • Filter method: In the default case (Vertical FFT), it applies the Fourier filter on the vertical component of the wavelet transform. Another option is available, called Vertical zero, which instead of filtering set the vertical component of the Wavelet transform to zero. This has the same effect of putting the filter cut-off to zero, with a faster implementation in terms of computation, as the Fourier filter is not computed. Default value: Vertical FFT.

Click on the Apply button to observe the effect of the stripe cleaning with the given parameters. On the difference image, only vertical stripes should be visible. Should you see any image characteristics in the image difference, tune the parameter again in order to avoid over filtering.

Hints: My experience is that shorter wavelets produce better results and mostly three or less levels. Typical effects of over filtering are wide ripples (rings). If you have very wide lines it can be beneficial to increase the number of levels.

Go back up

Return to Image Processing modules

Return to TOC

⚠️ **GitHub.com Fallback** ⚠️