microglia_analyzer.ma_worker module
- class microglia_analyzer.ma_worker.MicrogliaAnalyzer(logging_f=None)[source]
Bases:
object
- set_calibration(pixel_size, unit)[source]
Setter of the calibration. Before editing the internal state, checks that the pixel size is a float and Pint is used to check the unit.
- set_classification_model(path, use='best', reload=False)[source]
Checks that the path corresponds to a folder. This folder must contain a “confusion_matrix.png” file to verify that the training is complete. In there, there must be a “weights” folder, containing either ‘best.pt’ or ‘last.pt’.
- Parameters:
path (-) – Path of the model’s folder (containing ‘results.csv’ and ‘weights’).
use (-) – Either ‘best’ or ‘last’, to use either ‘best.pt’ or ‘last.pt’.
reload (-) – Whether to force the reload of the model from the online repo.
- set_input_image(image)[source]
Setter of the input image. Checks that the image is 2D before using it.