class Centering360[source]
calculate_curvature(list_metric)[source]

Calculate the curvature of a fitted curve going through the minimum value of a metric list.

Parameters

list_metric (array_like) – 1D array. List of metrics.

Returns

  • curvature (float) – Quadratic coefficient of the parabola fitting.

  • min_pos (float) – Position of the minimum value with sub-pixel accuracy.

correlation_metric(mat1, mat2)[source]

Calculate the correlation metric. Smaller metric corresponds to better correlation.

Parameters
  • mat1 (array_like) –

  • mat2 (array_like) –

Returns

Correlation metric.

Return type

float

executive_summary()[source]

Provide a summary to the user for the result of the plugin.

e.g.
  • Warning, the sample may have shifted during data collection

  • Filter operated normally

Returns

A list of string summaries

find_overlap(mat1, mat2, win_width, side=None, denoise=True, norm=False, use_overlap=False)[source]

Find the overlap area and overlap side between two images (Ref. [1]) where the overlap side referring to the first image.

Parameters
  • mat1 (array_like) – 2D array. Projection image or sinogram image.

  • mat2 (array_like) – 2D array. Projection image or sinogram image.

  • win_width (int) – Width of the searching window.

  • side ({None, 0, 1}, optional) – Only there options: None, 0, or 1. “None” corresponding to fully automated determination. “0” corresponding to the left side. “1” corresponding to the right side.

  • denoise (bool, optional) – Apply the Gaussian filter if True.

  • norm (bool, optional) – Apply the normalization if True.

  • use_overlap (bool, optional) – Use the combination of images in the overlap area for calculating correlation coefficients if True.

Returns

  • overlap (float) – Width of the overlap area between two images.

  • side (int) – Overlap side between two images.

  • overlap_position (float) – Position of the window in the first image giving the best correlation metric.

References

1

https://doi.org/10.1364/OE.418448

fix_transport()[source]
get_max_frames()[source]
nOutput_datasets()[source]

The number of datasets created by the plugin

Returns

Number of output datasets

populate_meta_data(key, value)[source]
post_process()[source]

This method is called after the process function in the pipeline framework as a post-processing step. All processes will have finished performing the main processing at this stage.

Parameters

exp (experiment class instance) – An experiment object, holding input and output datasets

pre_process()[source]

This method is called immediately after base_pre_process().

process_frames(data)[source]

Find the center-of-rotation (COR) in a 360-degree scan with offset COR use the method presented in Ref. [1].

Parameters

data (array_like) – 2D array. 360-degree sinogram.

Returns

cor – Center-of-rotation.

Return type

float

References

1

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/savu/checkouts/latest/savu/plugins/centering/centering360.py:docstring of plugins.centering.centering360.Centering360.process_frames, line 12); backlink

Duplicate explicit target name: “1”.

https://doi.org/10.1364/OE.418448

search_overlap(mat1, mat2, win_width, side, denoise=True, norm=False, use_overlap=False)[source]

Calculate the correlation metrics between a rectangular region, defined by the window width, on the utmost left/right side of image 2 and the same size region in image 1 where the region is slided across image 1.

Parameters
  • mat1 (array_like) – 2D array. Projection image or sinogram image.

  • mat2 (array_like) – 2D array. Projection image or sinogram image.

  • win_width (int) – Width of the searching window.

  • side ({0, 1}) – Only two options: 0 or 1. It is used to indicate the overlap side respects to image 1. “0” corresponds to the left side. “1” corresponds to the right side.

  • denoise (bool, optional) – Apply the Gaussian filter if True.

  • norm (bool, optional) – Apply the normalization if True.

  • use_overlap (bool, optional) – Use the combination of images in the overlap area for calculating correlation coefficients if True.

Returns

  • list_metric (array_like) – 1D array. List of the correlation metrics.

  • offset (int) – Initial position of the searching window where the position corresponds to the center of the window.

setup()[source]

This method is first to be called after the plugin has been created. It determines input/output datasets and plugin specific dataset information such as the pattern (e.g. sinogram/projection).