From 46b35f19b26cafec6b9d7d93cfe5dc373b67eb92 Mon Sep 17 00:00:00 2001 From: Annie Wang Date: Fri, 6 Sep 2024 17:53:19 -0700 Subject: [PATCH] add saving option to the feature Snap --- src/navigate/model/features/common_features.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/navigate/model/features/common_features.py b/src/navigate/model/features/common_features.py index ca8aa3454..97de16078 100644 --- a/src/navigate/model/features/common_features.py +++ b/src/navigate/model/features/common_features.py @@ -162,7 +162,7 @@ class Snap: data capture process, specifically the main data capture function. """ - def __init__(self, model): + def __init__(self, model, saving_flag=False): """Initialize the Snap class. Parameters: @@ -173,6 +173,9 @@ def __init__(self, model): #: MicroscopeModel: The microscope model associated with the data capture. self.model = model + #: bool: Saving each frames + self.saving_flag = saving_flag + #: dict: A dictionary defining the configuration for the data capture process. self.config_table = {"data": {"main": self.data_func}} @@ -192,6 +195,8 @@ def data_func(self, frame_ids): bool A boolean value indicating the success of the data capture process. """ + if self.saving_flag: + self.model.mark_saving_flags(frame_ids) self.model.logger.info( f"the camera is:{self.model.active_microscope_name}, {frame_ids}" )