neurotorchmz.utils.synapse_detection_integration#

While synapse_detection.py provides detection algorithms, this file contains the actual implementation into Neurotorch GUI

Classes

HysteresisTh_Integration(session)

IDetectionAlgorithmIntegration(session)

GUI integration of a synapse detection algorithm.

LocalMax_Integration(session)

Thresholding_Integration(session)

class neurotorchmz.utils.synapse_detection_integration.HysteresisTh_Integration(session: Session)#

Bases: HysteresisTh, IDetectionAlgorithmIntegration

Img_DetectionOverlay() tuple[tuple[ndarray] | None, list[Patch] | None]#
_update_lbl_minarea()#
detect_auto_params() list[ISynapseROI]#

This function must be overwritten by subclasses and should implement calling the underlying IDetectionAlgorithm with parameters choosen in the settings frame.

estimate_params()#

Estimate some parameters based on the provided image.

get_options_frame(master) LabelFrame#

Creates an tkinter widget for the algorithms settings in the provided master.

update(image_prop: ImageProperties | None)#

This function is called by the GUI to notify the detection algorithm integration object about a change in either the image object or the image input

class neurotorchmz.utils.synapse_detection_integration.IDetectionAlgorithmIntegration(session: Session)#

Bases: object

GUI integration of a synapse detection algorithm. Provides an option frame for setting information about an image

detect_auto_params() list[ISynapseROI]#

This function must be overwritten by subclasses and should implement calling the underlying IDetectionAlgorithm with parameters choosen in the settings frame.

filter_rois(rois: list[ISynapseROI], sort: None | Literal['Strength', 'Location'] = None, min_signal: float | None = None, max_peaks: int | None = None) list[ISynapseROI]#

Filter the rois and add adds the signal strength to the ROI

Parameters:
  • sort – If not None, sort the ROIs based on theire location (top to down first)

  • min_signal – If not None, return only peaks exceeding the given signal strength

  • max_peaks – If not None, return only the n strongest peaks

get_options_frame(master) LabelFrame#

Creates an tkinter widget for the algorithms settings in the provided master.

get_rawdata_overlay() tuple[tuple[ndarray, ...] | None, list[Patch] | None]#

An Integration may choose to provide an custom overlay image, usually the raw data obtained in one of the first steps. Also it may provide a list of matplotlib patches for this overlay

Return None to not plot anything

image_obj: ImageObject | None#

The current image object. Is for example used by some integrations to calculate the signal

image_prop: ImageProperties#

The ImageProperties object should contain a 2D image and is used as input for the algorithm

provides_rawPlot: bool#

If set to true, the GUI knows that this algorithms provides raw information from the detection

update(image_prop: ImageProperties | None)#

This function is called by the GUI to notify the detection algorithm integration object about a change in either the image object or the image input

class neurotorchmz.utils.synapse_detection_integration.LocalMax_Integration(session: Session)#

Bases: LocalMax, IDetectionAlgorithmIntegration

_update_lbl_minarea()#
detect_auto_params() list[ISynapseROI]#

This function must be overwritten by subclasses and should implement calling the underlying IDetectionAlgorithm with parameters choosen in the settings frame.

estimate_params()#

Estimate some parameters based on the provided image.

get_options_frame(master) LabelFrame#

Creates an tkinter widget for the algorithms settings in the provided master.

get_rawdata_overlay() tuple[tuple[ndarray, ndarray] | None, list[Patch] | None]#

An Integration may choose to provide an custom overlay image, usually the raw data obtained in one of the first steps. Also it may provide a list of matplotlib patches for this overlay

Return None to not plot anything

update(image_prop: ImageProperties | None)#

This function is called by the GUI to notify the detection algorithm integration object about a change in either the image object or the image input

class neurotorchmz.utils.synapse_detection_integration.Thresholding_Integration(session: Session)#

Bases: Thresholding, IDetectionAlgorithmIntegration

_update_lbl_minarea()#

Internal function. Called to print in a label the equivalent radius of the min_area parameter

detect_auto_params(**kwargs) list[ISynapseROI]#

This function must be overwritten by subclasses and should implement calling the underlying IDetectionAlgorithm with parameters choosen in the settings frame.

get_options_frame(master) LabelFrame#

Creates an tkinter widget for the algorithms settings in the provided master.

get_rawdata_overlay() tuple[tuple[ndarray] | None, list[Patch] | None]#

An Integration may choose to provide an custom overlay image, usually the raw data obtained in one of the first steps. Also it may provide a list of matplotlib patches for this overlay

Return None to not plot anything