cleanArtifacts
- xripl.clean.cleanArtifacts(image, diskSize=5, plots=False, vmin=0, vmax=1, flip=False)[source]
Applies morphological opening to clean bright streaks and spots from radiographs, and then applies a morphological closing to remove dark artifacts.
- Parameters
image (numpy.ndarray) – Image containing artifacts to be cleaned.
diskSize (int) – Size of disk to be used as convolving element for removing artifcats.
plots (bool) – Flag for displaying plots of processed images.
vmin (float) – Value between 0 and 1 for setting minimum threshold in plotting image. See matplotlib.pyplot.imshow().
vmax (float) – Value between 0 and 1 for setting maximum threshold in plotting image. See matplotlib.pyplot.imshow().
flip (bool) – Flips order of opening and closing operations. When False, opening is applied first, then closing. When True, closing is applied first, then opening. False is used by default for radiographs, and True is used for inverted radiographs