Skip to content

Commit a01ce69

Browse files
Merge pull request #988 from TheDeanLab/docs-and-version
Docs + Version
2 parents 12b2b14 + 2eea7ed commit a01ce69

File tree

8 files changed

+175
-43
lines changed

8 files changed

+175
-43
lines changed

docs/source/user_guide/acquiring_home.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Acquiring Data
88
acquiring_guide
99
features/features
1010
features/example_feature_lists
11+
known_issues
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
============
2+
Known Issues
3+
============
4+
5+
This page lists known issues with the **navigate** software that currently do not have
6+
an obvious solution. Please report any other issues you encounter on GitHub.
7+
8+
Slow Channel Switching
9+
----------------------
10+
11+
When we operate multiple channels, there is a clear time delay between channels.
12+
This is most obvious when operating in the continuous mode, or when you are acquiring
13+
a Z-stack in the Per Z Laser Cycling mode.
14+
15+
This delay is associated with the time it takes to load the waveforms onto the DAQ
16+
card. One possible solution is to write the waveforms to different channels on the
17+
DAQ, but this would require that the analog/digital signals be combined physically.
18+
For example, if CH00 was delivered on AO0, and CH01 was delivered on AO1, but both
19+
were communicating with a single laser, then the signals could be combined and
20+
delivered to the laser. However, a more obvious solution would be to reduce the time
21+
necessary to load the waveforms onto the DAQ card. One immediate way to do this is by
22+
reducing the DAQ sampling rate, but this would reduce the resolution of the waveforms
23+
. More sophisticated DAQ systems, including an FPGA, could also be used to eliminate
24+
this delay.

src/navigate/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.7
1+
0.0.8

src/navigate/controller/controller.py

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,33 @@ def __init__(
140140
file paths or using synthetic hardware modes.
141141
"""
142142

143+
#: Tk top-level widget: Tk.tk GUI instance.
144+
self.root = root
145+
146+
#: Tk top-level widget: Tk.tk GUI instance.
147+
self.splash_screen = splash_screen
148+
149+
#: string: Path to the configuration yaml file.
150+
self.configuration_path = configuration_path
151+
152+
#: string: Path to the experiment yaml file.
153+
self.experiment_path = experiment_path
154+
155+
#: string: Path to the waveform constants yaml file.
156+
self.waveform_constants_path = waveform_constants_path
157+
158+
#: string: Path to the REST API yaml file.
159+
self.rest_api_path = rest_api_path
160+
161+
#: string: Path to the waveform templates yaml file.
162+
self.waveform_templates_path = waveform_templates_path
163+
164+
#: string: Path to the GUI configuration yaml file.
165+
self.gui_configuration_path = gui_configuration_path
166+
167+
#: iterable: Non-default command line input arguments for
168+
self.args = args
169+
143170
#: Object: Thread pool for the controller.
144171
self.threads_pool = SynchronizedThreadPool()
145172

@@ -152,34 +179,28 @@ def __init__(
152179
#: dict: Configuration dictionary
153180
self.configuration = load_configs(
154181
self.manager,
155-
configuration=configuration_path,
156-
experiment=experiment_path,
157-
waveform_constants=waveform_constants_path,
158-
rest_api_config=rest_api_path,
159-
waveform_templates=waveform_templates_path,
160-
gui=gui_configuration_path,
182+
configuration=self.configuration_path,
183+
experiment=self.experiment_path,
184+
waveform_constants=self.waveform_constants_path,
185+
rest_api_config=self.rest_api_path,
186+
waveform_templates=self.waveform_templates_path,
187+
gui=self.gui_configuration_path,
161188
)
162189

163190
verify_configuration(self.manager, self.configuration)
164191
verify_experiment_config(self.manager, self.configuration)
165192
verify_waveform_constants(self.manager, self.configuration)
166193

167-
# Initialize the Model
168194
#: ObjectInSubprocess: Model object in MVC architecture.
169195
self.model = ObjectInSubprocess(
170196
Model, args, self.configuration, event_queue=self.event_queue
171197
)
172198

173-
logger.info(f"Spec - Configuration Path: {configuration_path}")
174-
logger.info(f"Spec - Experiment Path: {experiment_path}")
175-
logger.info(f"Spec - Waveform Constants Path: {waveform_constants_path}")
176-
logger.info(f"Spec - Rest API Path: {rest_api_path}")
177-
178199
#: mp.Pipe: Pipe for sending images from model to view.
179200
self.show_img_pipe = self.model.create_pipe("show_img_pipe")
180201

181202
#: string: Path to the default experiment yaml file.
182-
self.default_experiment_file = experiment_path
203+
self.default_experiment_file = self.experiment_path
183204

184205
#: string: Path to the waveform constants yaml file.
185206
self.waveform_constants_path = waveform_constants_path
@@ -188,7 +209,7 @@ def __init__(
188209
self.configuration_controller = ConfigurationController(self.configuration)
189210

190211
#: View: View object in MVC architecture.
191-
self.view = view(root)
212+
self.view = view(self.root)
192213

193214
#: dict: Event listeners for the controller.
194215
self.event_listeners = {}
@@ -289,14 +310,25 @@ def __init__(
289310
self.initialize_cam_view()
290311

291312
# destroy splash screen and show main screen
292-
splash_screen.destroy()
293-
root.deiconify()
313+
self.splash_screen.destroy()
314+
self.root.deiconify()
294315

295316
#: int: ID for the resize event.Only works on Windows OS.
296317
self.resize_event_id = None
297318
if platform.system() == "Windows":
298319
self.view.root.bind("<Configure>", self.resize)
299320

321+
logger.info(self.__repr__())
322+
323+
def __repr__(self):
324+
return (
325+
f'Controller("{self.root}", "{self.splash_screen}", '
326+
f'"{self.configuration_path}", "{self.experiment_path}", '
327+
f'"{self.waveform_constants_path}", "{self.rest_api_path}", '
328+
f'"{self.waveform_templates_path}", "{self.gui_configuration_path}", '
329+
f'"{self.args}")'
330+
)
331+
300332
def update_buffer(self):
301333
"""Update the buffer size according to the camera
302334
dimensions listed in the experimental parameters.

src/navigate/main.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,7 @@ def main():
6969
--rest-api-file
7070
--waveform-templates-file
7171
--logging-confi
72-
73-
Returns
74-
-------
75-
None
76-
77-
Examples
78-
--------
79-
>>> python main.py --synthetic-hardware
72+
--configurator
8073
"""
8174
if platform.system() != "Windows":
8275
print(

src/navigate/model/devices/camera/hamamatsu.py

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ def __init__(self, microscope_name, device_connection, configuration):
6464
"""
6565
super().__init__(microscope_name, device_connection, configuration)
6666

67+
#: str: Name of the microscope
68+
self.microscope_name = microscope_name
69+
70+
#: object: Device connection
71+
self.device_connection = device_connection
72+
73+
#: dict: Configuration settings
74+
self.configuration = configuration
75+
6776
#: dict: Camera parameters
6877
self.camera_parameters["x_pixels"] = self.camera_controller.max_image_width
6978
self.camera_parameters["y_pixels"] = self.camera_controller.max_image_height
@@ -114,11 +123,9 @@ def __init__(self, microscope_name, device_connection, configuration):
114123
"trigger_source", self.camera_parameters["trigger_source"]
115124
)
116125

117-
logger.info("HamamatsuOrca Initialized")
118-
119126
def __del__(self):
120127
"""Delete HamamatsuOrca class."""
121-
logger.info("HamamatsuOrca Shutdown")
128+
pass
122129

123130
@property
124131
def serial_number(self):
@@ -205,7 +212,7 @@ def set_sensor_mode(self, mode):
205212
] = self.camera_controller.step_image_height
206213
else:
207214
print("Camera mode not supported")
208-
logger.info("Camera mode not supported")
215+
logger.debug("Camera mode not supported")
209216

210217
def set_readout_direction(self, mode):
211218
"""Set HamamatsuOrca readout direction.
@@ -230,7 +237,7 @@ def set_readout_direction(self, mode):
230237
)
231238
else:
232239
print("Camera readout direction not supported")
233-
logger.info("Camera readout direction not supported")
240+
logger.debug("Camera readout direction not supported")
234241

235242
def calculate_readout_time(self):
236243
"""Calculate duration of time needed to readout an image.
@@ -444,7 +451,15 @@ def __init__(self, microscope_name, device_connection, configuration):
444451

445452
# self.minimum_exposure_time = 6.304 * 10 ** -6
446453

447-
logger.info("HamamatsuOrcaLightning Initialized")
454+
logger.info(self.__repr__())
455+
456+
def __repr__(self):
457+
return (
458+
f"HamamatsuOrcaLightning("
459+
f"{self.microscope_name}, "
460+
f"{self.device_connection}, "
461+
f"{self.configuration})"
462+
)
448463

449464
def calculate_light_sheet_exposure_time(
450465
self, full_chip_exposure_time, shutter_width
@@ -515,7 +530,15 @@ def __init__(self, microscope_name, device_connection, configuration):
515530
"image_height"
516531
)
517532

518-
logger.info("HamamatsuOrcaFire Initialized")
533+
logger.info(self.__repr__())
534+
535+
def __repr__(self):
536+
return (
537+
f"HamamatsuOrcaFire("
538+
f"{self.microscope_name}, "
539+
f"{self.device_connection}, "
540+
f"{self.configuration})"
541+
)
519542

520543
def calculate_light_sheet_exposure_time(
521544
self, full_chip_exposure_time, shutter_width
@@ -582,7 +605,15 @@ def __init__(self, microscope_name, device_connection, configuration):
582605

583606
# self.minimum_exposure_time = 9.74436 * 10 ** -6
584607

585-
logger.info("HamamatsuOrca Initialized")
608+
logger.info(self.__repr__())
609+
610+
def __repr__(self):
611+
return (
612+
f"HamamatsuOrca("
613+
f"{self.microscope_name}, "
614+
f"{self.device_connection}, "
615+
f"{self.configuration})"
616+
)
586617

587618
def calculate_light_sheet_exposure_time(
588619
self, full_chip_exposure_time, shutter_width
@@ -646,7 +677,15 @@ def __init__(self, microscope_name, device_connection, configuration):
646677
"Bottom-to-Top",
647678
]
648679

649-
logger.info("HamamatsuOrcaFusion Initialized")
680+
logger.info(self.__repr__())
681+
682+
def __repr__(self):
683+
return (
684+
f"HamamatsuOrcaFusion("
685+
f"{self.microscope_name}, "
686+
f"{self.device_connection}, "
687+
f"{self.configuration})"
688+
)
650689

651690
def calculate_light_sheet_exposure_time(
652691
self, full_chip_exposure_time, shutter_width

src/navigate/model/devices/camera/photometrics.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, microscope_name, device_connection, configuration):
9898
Name of microscope in configuration
9999
device_connection : object
100100
Hardware device to connect to. will be saved in camera_controller
101-
configuration : multiprocesing.managers.DictProxy
101+
configuration : multiprocessing.managers.DictProxy
102102
Global configuration of the microscope
103103
-------
104104
@@ -110,6 +110,15 @@ def __init__(self, microscope_name, device_connection, configuration):
110110
"Bottom-to-Top",
111111
]
112112

113+
#: str: Name of the microscope
114+
self.microscope_name = microscope_name
115+
116+
#: obj: Camera Controller
117+
self.device_connection = device_connection
118+
119+
#: dict: Configuration of the microscope
120+
self.configuration = configuration
121+
113122
#: int: Exposure Time in milliseconds
114123
self._exposuretime = 20
115124

@@ -148,13 +157,20 @@ def __init__(self, microscope_name, device_connection, configuration):
148157
]
149158
self.camera_controller.gain = self.camera_parameters["gain"]
150159

151-
logger.info("Photometrics Initialized")
160+
logger.info(self.__repr__())
161+
162+
def __repr__(self):
163+
return (
164+
f"PhotometricsBase("
165+
f"{self.microscope_name}, "
166+
f"{self.device_connection}, "
167+
f"{self.configuration})"
168+
)
152169

153170
def __del__(self):
154171
"""Delete PhotometricsBase object."""
155172
if hasattr(self, "camera_controller"):
156173
self.camera_controller.close()
157-
logger.info("PhotometricsBase Shutdown")
158174

159175
@property
160176
def serial_number(self):
@@ -202,7 +218,7 @@ def set_sensor_mode(self, mode):
202218
self._scanmode = modes_dict[mode]
203219
else:
204220
print("Camera mode not supported" + str(modes_dict[mode]))
205-
logger.info("Camera mode not supported" + str(modes_dict[mode]))
221+
logger.debug("Camera mode not supported" + str(modes_dict[mode]))
206222

207223
def set_readout_direction(self, mode):
208224
"""Set Photometrics readout direction.
@@ -223,7 +239,7 @@ def set_readout_direction(self, mode):
223239
elif mode == "Alternate":
224240
self.camera_controller.prog_scan_dir = 2
225241
else:
226-
logger.info("Camera readout direction not supported")
242+
logger.debug("Camera readout direction not supported")
227243

228244
def calculate_readout_time(self):
229245
"""Calculate duration of time needed to readout an image.
@@ -409,9 +425,9 @@ def set_ROI(self, roi_width=3200, roi_height=3200, center_x=1600, center_y=1600)
409425
return False
410426

411427
# Calculate Location of Image Edges
412-
roi_top = center_y - roi_height//2
428+
roi_top = center_y - roi_height // 2
413429
roi_bottom = roi_top + roi_height - 1
414-
roi_left = center_x - roi_width//2
430+
roi_left = center_x - roi_width // 2
415431

416432
if roi_top % 2 != 0 or roi_bottom % 2 == 0:
417433
logger.debug(f"can't set ROI to {roi_width} and {roi_height}")
@@ -420,7 +436,6 @@ def set_ROI(self, roi_width=3200, roi_height=3200, center_x=1600, center_y=1600)
420436
# Set ROI
421437
self.camera_controller.set_roi(roi_left, roi_top, roi_width, roi_height)
422438
self.x_pixels, self.y_pixels = self.camera_controller.shape()
423-
logger.info(f"Photometrics ROI shape, {self.camera_controller.shape()}")
424439
return self.x_pixels == roi_width and self.y_pixels == roi_height
425440

426441
def initialize_image_series(self, data_buffer=None, number_of_frames=100):

0 commit comments

Comments
 (0)