ai_ct_scans.phase_correlation_image_processing module

ai_ct_scans.phase_correlation_image_processing.circle(array_size, radius)

Get a solid circle of True on a False background, centred at [0, 0]

Parameters
  • array_size (list of ints) – The [number of rows, number of columns] to generate the circle on

  • radius (float) – The radius of the circle

Returns

A boolean solid circle of True on a False background centred at [0, 0]

Return type

(ndarray)

ai_ct_scans.phase_correlation_image_processing.convolve(image_1, image_2)

Perform a convolution of two 2D images of equal shape via convolution theorem

Parameters
  • image_1 (ndarray) – An image

  • image_2 (ndarray) – An image

Returns

An image

Return type

(ndarray)

ai_ct_scans.phase_correlation_image_processing.generate_overlay_2d(images, normalize=True)

Take two grayscale images and overlay them in R and G channels of an output image, where output image is large enough to fit all data from both images

Parameters
  • images (list of ndarrays) – list of 2D images

  • normalize (bool) – whether to divide by max of each image while assigning to a layer of output array

Returns

3D array, [rows, cols, channels], first two channels filled by input images

Return type

(ndarray)

ai_ct_scans.phase_correlation_image_processing.lmr(image, filter_type=None, radius=None)

Perform local mean removal. Default to using a circle of radius radius, otherwise use the kernel provided in filter. The kernel must be the same shape as image if not None.

Parameters
  • image (ndarray) – A 2D image

  • filter_type (None or ndarray) – The filter to apply to find the local mean, typically a shape centred at [0, 0]

  • ndarray (in an) –

  • radius (float) – The radius of a circle to use as default filter if filter is None

Returns

A 2D image

Return type

(ndarray)

ai_ct_scans.phase_correlation_image_processing.max_shape_from_image_list(images)

Get the maximum size in each dimension from a list of images, useful for defining an empty image that can be used to overlay every image

Parameters

images (list of ndarrays) – list of images, all of same dimensionality

Returns

The maximum shape element along each dimension across all images

Return type

(tuple of ints)

ai_ct_scans.phase_correlation_image_processing.pad_nd(image, shape)

Pad an image up to shape with its mean value, where padding is added at end of each axis

Parameters
  • image (ndarray) – An n-dimensional image

  • shape (list of ints) – expected output shape, must but greater than image.shape in each dimension

Returns

Padded image

Return type

(ndarray)

ai_ct_scans.phase_correlation_image_processing.sphere(array_size, radius)

Get a solid circle of True on a False background, centred at [0, 0]

Parameters
  • array_size (list of ints) – The [number of layers, number of rows, number of columns] to generate the sphere on

  • radius (float) – The radius of the sphere

Returns

A boolean solid circle of True on a False background centred at [0, 0]

Return type

(ndarray)

ai_ct_scans.phase_correlation_image_processing.zero_crossings(image, thresh=0)

Get a binary array the shape of image, with True where zero crossing points occur

Parameters
  • image (ndarray) – A 2D image

  • thresh (float or 'auto') – The amount by which adjacent pixel values must differ while crossing 0 to be counted

  • 'auto' (as a crossing point. If) –

  • histogram (chooses the bin edge value prior to the maximum counts in the smoothed) –

  • values (of pixel) –

Returns

Binary array the shape of image, with True where zero crossing points occur

Return type

(ndarray)