Image Stitching¶
Description¶
Method to stitch images of two tomo-datasets including flat-field correction.
Parameters
in_datasets:
visibility: datasets
dtype: "[list[],list[str]]"
description:
summary: A list of the dataset(s) to process.
verbose: A list of strings, where each string gives the name of a dataset that was either specified by a loader plugin or created as output to a previous plugin. The length of the list is the number of input datasets requested by the plugin. If there is only one dataset and the list is left empty it will default to that dataset.
default: "[]"
out_datasets:
visibility: datasets
dtype: "[list[],list[str]]"
description:
summary: A list of the dataset(s) to create.
verbose: A list of strings, where each string is a name to be assigned to a dataset output by the plugin. If there is only one input dataset and one output dataset and the list is left empty, the output will take the name of the input dataset. The length of the list is the number of output datasets created by the plugin.
default: "[]"
overlap:
visibility: basic
dtype: int
description: Overlap width between two images.
default: "354"
row_offset:
visibility: basic
dtype: int
description: Offset of row indices of projections in the second dataset compared to the first dataset.
default: "-1"
crop:
visibility: basic
dtype: "list[int,int,int,int]"
description: "Parameters used to crop stitched image with respect to the edges of an image. Format: [crop_top, crop_bottom, crop_left, crop_right]."
default: "[0, 0, 250, 250]"
pattern:
visibility: basic
dtype: str
description: "Data processing pattern is 'PROJECTION' or 'SINOGRAM'."
default: PROJECTION
flat_use:
visibility: basic
dtype: bool
description: Apply flat-field correction.
default: "True"
norm:
visibility: intermediate
dtype: bool
description: Apply normalization before stitching.
default: "True"
Key
visibility: The visibility level of the parameter
dtype: The type of data
description: A short explanation of the parameter
default: The default value
options: A list of permitted values
dependency: The name of the parameter and value which this parameter depends upon
range: A guide for the range of the parameter
Citations
No citations
API
-
class
ImageStitching
[source] -
make_weight_matrix
(height1, width1, height2, width2, overlap, side)[source] Generate a linear-ramp weighting matrix for image stitching.
- Parameters
height1 (int) – Size of the 1st image.
width1 (int) – Size of the 1st image.
height2 (int) – Size of the 2nd image.
width2 (int) – Size of the 2nd image.
overlap (int) – Width of the overlap area between two images.
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.
-
pre_process
()[source] This method is called immediately after base_pre_process().
-
process_frames
(data)[source] This method is called after the plugin has been created by the pipeline framework and forms the main processing step
- Parameters
data (list(np.array)) – A list of numpy arrays for each input dataset.
-
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).
-
stitch_image
(mat1, mat2, overlap, side, wei_mat1, wei_mat2, norm)[source] Stitch projection images or sinogram images using a linear ramp.
- Parameters
mat1 (array_like) – 2D array. Projection image or sinogram image.
mat2 (array_like) – 2D array. Projection image or sinogram image.
overlap (float) – Width of the overlap area between two images.
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.
wei_mat1 (array_like) – Weighting matrix used for image 1.
wei_mat2 (array_like) – Weighting matrix used for image 2.
norm (bool, optional) – Enable/disable normalization before stitching.
- Returns
Stitched image.
- Return type
array_like
-