Contents

find_well_center

This module finds the center of well based on ImageAICS of well segment by generating an ImageAICS of the whole well and convolving it with the ImageAICS of the segment.

microscope_automation.samples.find_well_center.show_hist(image)[source]

Plot histogram.

Input:

image

Output:

none

We have problems with the pyplot.hist function.

microscope_automation.samples.find_well_center.show_debug_image(image)[source]

Show ImageAICS when in debug mode.

Input:

image: ImageAICS object to display if debug mode is turned on

Return:

none

microscope_automation.samples.find_well_center.show_debug_summary(image, well_image, correlation, t_image, corr_x, corr_y)[source]

Show all images to calculate new center.

Input:

image: microscope image of well center

well_image: synthetic image of well used for alignment

correlation: image of crosscorrelation

t_image: image after thresholding used for crosscorrelation

corr_x, corr_y: correlation peak

Output:

none

microscope_automation.samples.find_well_center.create_well_image(diameter)[source]

Create mask for whole well. Using the whole well for alignment will improve accuracy on the cost of speed. We recommend to use create_edge_image if possible

Input:

diameter: well diameter in pixels

Return:

well_image: numpy array for well with well set to 1 and background set to 0

microscope_automation.samples.find_well_center.create_edge_image(diameter, length, r, phi, add_noise=False)[source]

Create ImageAICS for well edge used for alignment and test purposes.

Input:

diameter: Well diameter in pixels

length: size of image in pixels

r: distance of image from circle center in pixels.

phi: direction of image

addNoise: add noise for test purposes. Default is False.

Output:

im: well edge image to be used for alignment

microscope_automation.samples.find_well_center.find_well_center(image, well_diameter, percentage, phi)[source]

Find center of well based on edge ImageAICS.

Input:

image: image with well edge

well_diameter: diameter of well in pixels

percentage: percentage of whole well used for convolution. Large numbers increase accuracy, smaller speed. well_diameter*percentage/100 has to be larger than size of ImageAICS

phi: direction of image from center

Return:

x_center, y_center: expected center of well

microscope_automation.samples.find_well_center.find_well_center_fine(image, direction, test=False)[source]

Find edge of well in image in selected direction.

Input:

image: image with well edge

direction: direction to search for edge. String of form ‘-x’, ‘x’, ‘-y’, or ‘y’

test: returns 1 if True since test images may not have data (Default: False)

Return:

edge_pos: coordinate of well edge in selected direction in pixels with origin in center of image