navigate.model.features.remove_empty_tiles.DetectTissueInStackAndRecord
- class navigate.model.features.remove_empty_tiles.DetectTissueInStackAndRecord(model, planes=1, percentage=0.75, position_records=[], detect_func=None)
Bases:
DetectTissueInStack
Detect Tissue in a Stack of Images and Record Positions.
This class extends the functionality of detecting tissue in a stack of images and also records positions where tissue was detected.
- __init__(model, planes=1, percentage=0.75, position_records=[], detect_func=None)
Initialize the DetectTissueInStackAndRecord class.
Parameters:
- modelobject
The model object representing the microscope.
- planesint, optional
The number of Z planes to capture in the stack. Default is 1.
- percentagefloat, optional
The minimum percentage of tissue required to consider a frame as having tissue. Default is 0.75 (75%).
- position_recordslist, optional
A list to record positions where tissue was detected. Default is an empty list.
- detect_funcfunction, optional
The custom tissue detection function to use. If not specified, the default detect_tissue function will be used.
Methods
__init__
(model[, planes, percentage, ...])Initialize the DetectTissueInStackAndRecord class.
Data processing function to end the data phase.
Signal processing function to end the signal phase.
in_func_data
(frame_ids)Data processing function to analyze image frames for tissue presence.
Signal processing function to move the microscope stage.
Initialization function for data processing.
Initialization function for signal processing.
Attributes
A list to record positions where tissue was detected.
- end_func_data()
Data processing function to end the data phase. Extends the base class method.
This method is called to determine whether the data phase should end. It checks if the specified number of frames have been received and updates the position record.
Returns:
- bool
True if the data phase should end, False otherwise.
- end_func_signal()
Signal processing function to end the signal phase.
This method is called to determine whether the signal phase should end. It checks if the specified number of Z planes have been scanned.
Returns:
- bool
True if the signal phase should end, False otherwise.
- in_func_data(frame_ids)
Data processing function to analyze image frames for tissue presence.
This method is called during the data processing phase to analyze image frames for tissue presence. It checks if any of the received frames contain sufficient tissue.
Parameters:
- frame_idslist
A list of frame IDs to analyze.
Returns:
- bool
True if tissue is detected, False otherwise.
- in_func_signal()
Signal processing function to move the microscope stage.
- This method is called during the signal processing phase to move the microscope
stage to the specified Z and F positions. It increments the Z and F positions for each scan.
- pre_func_data()
Initialization function for data processing. Extends the base class method.
This method is called at the beginning of the data processing phase and initializes variables for tracking received frames, tissue detection, and records the position.
- pre_func_signal()
Initialization function for signal processing.
This method is called at the beginning of the signal processing phase and initializes the necessary parameters for moving the microscope stage.
- detect_func
The tissue detection function used to analyze image frames.
- Type:
function
- model
The model object representing the microscope.
- Type:
navigate.model.Model
- planes
The number of Z planes to capture in the stack.
- Type:
int
- position_records
A list to record positions where tissue was detected.
- Type:
list