ethoscope.utils package¶
Module contents¶
ethoscope.utils.debug module¶
-
exception
ethoscope.utils.debug.
EthoscopeException
(value, img=None)[source]¶ Bases:
exceptions.Exception
A custom exception. It can store an image
Parameters: - value – A value passed to the exception, generally a text message
- img (
ndarray
) – an image
Returns:
ethoscope.utils.description module¶
-
class
ethoscope.utils.description.
DescribedObject
[source]¶ Bases:
object
An object that contains a
description
attribute. This is used to parse user option for the web interface. This way, users can send option to the different objects used.description
is a dictionary with the fields “overview” and “arguments”. “overview” is simply a string. “arguments” is a list of dictionaries. Each has the field:- name: The name of the argument as it is in “__init__”
- description: “A user friendly description of the argument”
- type: “number”, “datetime”, “daterange” and “string”.
- min, max and step: only for type “number”, defines the accepted limits of the arguments as well as the increment in the user interface
- default: the default value
Each argument must match a argument in __init__.
-
description
¶
ethoscope.utils.img_proc module¶
-
ethoscope.utils.img_proc.
merge_blobs
(contours, prop=0.5)[source]¶ Merge together contour according to their position and size. If the distance between two blobs is smaller than the longest axis of, at least, one of them, then they get merged. This algorithm is aimed at merging together part of the same physical object without morphological operations.
Parameters: contours – list of contours Returns: the convex hulls of the merged contours, list of contourss
ethoscope.utils.io module¶
-
class
ethoscope.utils.io.
AsyncMySQLWriter
(db_credentials, queue, erase_old_db=True)[source]¶ Bases:
multiprocessing.process.Process
-
class
ethoscope.utils.io.
AsyncSQLiteWriter
(db_name, queue, erase_old_db=True)[source]¶ Bases:
multiprocessing.process.Process
-
class
ethoscope.utils.io.
ImgToMySQLHelper
(period=300.0)[source]¶ Bases:
object
Parameters: period – how often snapshots are saved, in seconds Returns:
-
class
ethoscope.utils.io.
ResultWriter
(db_credentials, rois, metadata=None, make_dam_like_table=True, take_frame_shots=False, erase_old_db=True, *args, **kwargs)[source]¶ Bases:
object
-
metadata
¶
-