Contents
find_positions¶
This module contains tools to find positions for imaging. At the moment it is only used by microscope_automation.
-
microscope_automation.orchestrator.find_positions.
copy_zero_position
(sample_object, output_class, image, z_center_background=0)[source]¶ Create new object with identical zero position.
- Input:
sampleObject: object that is searched
output_class: string with name of class of new created output object
image: image of class imageAICS searched
z_center_background: center of background in the z direction
- Output:
new_objects: list with objects of class output_class
-
microscope_automation.orchestrator.find_positions.
copy_image_position
(sample_object, output_class, image, offset=(0, 0, 0))[source]¶ Create new object with zero position relative to center of image.
- Input:
sample_object: object that is searched
output_class: string with name of class of new created output object
image: image of class imageAICS
- offset: offset in um relative to center of image as (x, y, z)
Default: (0, 0, 0) (center of image)
- Output:
new_object: object of class output_class
-
microscope_automation.orchestrator.find_positions.
convert_location_list
(location_list, image, image_type='czi')[source]¶ Function to convert the coordinates to microns and relative to the center of the image. First all the locations are converted to microns using the pixel size of the image. Then the locations are converted so that they are relative to the center of the image instead of the bottom right corner. This calculation is done using the size of image.
- Input:
location_list: list of coordinates
image: imageAICS object with all the meta data
image_type: tiff or czi: both have different units for physical pixel size
- Output:
location_list_relative_to_zero: corrected location list
-
microscope_automation.orchestrator.find_positions.
get_single_slice
(image)[source]¶ Return single image slice.
- Input:
image: image of class imageAICS
- Output:
image_data: 2D numpy array
-
microscope_automation.orchestrator.find_positions.
location_to_object
(sample_object, output_class, image, location_list)[source]¶ Convert position list to new objects.
- Input:
sample_object: object that is searched
output_class: string with name of class of new created output object
image: image of class imageAICS
location_list: list of coordinates
- Output:
[new_objects, new_objects_dict]: [list with objects of class output_class, dictionary with name and objects]
-
microscope_automation.orchestrator.find_positions.
find_interactive_position
(sample_object, output_class, image, app)[source]¶ Create new object with zero position based on interactive selection.
- Input:
sample_object: object that is searched
output_class: string with name of class of new created output object
image: image of class imageAICS
app: object of class QtGui.QApplication
- Output:
new_objects: list with objects of class output_class
-
microscope_automation.orchestrator.find_positions.
segmentation
(image_data, segmentation_type='colony', segmentation_settings=None)[source]¶ Different algorithms to segment sample.
- Input:
image_data: 2D numpy array with image data
- segmentation_type: possible values:
‘colony’: segment hiPSC colonies (default) ‘otsu’: intensity segmentation based on Ostu algorithm
segmentation_settings: settings from preferences file. Default (None) use default settings
- Output:
segmented_position_list: list with (x, y) positions
-
microscope_automation.orchestrator.find_positions.
find_interactive_distance_map
(sample_object, output_class, image, segmentation_settings=None, app=None)[source]¶ Create new object with zero position based on interactive selection.
- Input:
sampleObject: object that is searched
output_class: string with name of class of new created output object
image: image of class imageAICS
segmentation_settings: settings from preferences file
app: object of class QtGui.QApplication
- Output:
[new_objects, new_objects_dict]: [list with objects of class output_class, dictionary with name and objects]
-
microscope_automation.orchestrator.find_positions.
create_output_objects_from_parent_object
(find_type, sample_object, imaging_settings, image, output_class, app, offset=(0, 0, 0))[source]¶ This function has methods to create output objects (cells, colonies, background) from the parent object(Well, colony)
- Input:
- find_type: string with name of search algorithm. Possible values:
‘copy_zero_position’: keep position ‘copy_image_position’: use center of image as object zero position ‘CenterMassCellProfiler’ : find cells using cell profiler ‘TwofoldDistanceMap’ : find cells in a colony using two fold distance map ‘Interactive’: select position interactively ‘InteractiveDistanceMap’: shows recommended positions (by segmentation) & can select them interactively
sample_object: object that is searched
imaging_settings: settings from preferences file
image: image of class imageAICS searched
output_class: class of new created output object
app: object of class QtGui.QApplication
- offset: offset in um relative to center of image as (x, y, z)
Default: (0, 0, 0) (center of image)
- Output:
[new_objects, new_objects_dict]: [list with objects of class output_class, dictionary with name and objects]