navigate.model.devices.camera.camera_synthetic.SyntheticCamera
- class navigate.model.devices.camera.camera_synthetic.SyntheticCamera(microscope_name, device_connection, configuration)
Bases:
CameraBase
SyntheticCamera camera class.
- __init__(microscope_name, device_connection, configuration)
Initialize SyntheticCamera class.
- Parameters:
microscope_name (str) – Name of microscope in configuration
device_connection (object) – Hardware device to connect to
configuration (multiprocesing.managers.DictProxy) – Global configuration of the microscope
Methods
__init__
(microscope_name, device_connection, ...)Initialize SyntheticCamera class.
Convert normal mode exposure time to light-sheet mode exposure time.
Calculate duration of time needed to readout an image.
Close SyntheticCamera Camera
Close image series.
Generate a synthetic image.
Return stored camera line interval.
Get frame from SyntheticCamera camera.
Get offset and variance maps from file.
initialize_image_series
([data_buffer, ...])Initialize SyntheticCamera image series.
load_images
([filenames, ds])Pre-populate the buffer with images.
Print Camera Settings.
set_ROI
([roi_height, roi_width])Change the size of the active region on the camera.
set_binning
(binning_string)Set SyntheticCamera binning mode.
set_exposure_time
(exposure_time)Set SyntheticCamera exposure time.
set_line_interval
(line_interval_time)Set SyntheticCamera line interval.
set_readout_direction
(mode)Set HamamatsuOrca readout direction.
set_sensor_mode
(mode)Set SyntheticCamera sensor mode.
Attributes
Return offset map.
Return variance map.
Whether the camera is currently acquiring
current image id
data buffer
number of frames
previous image id
whether to use random image
serial number
exposure time
width
height
- calculate_light_sheet_exposure_time(full_chip_exposure_time, shutter_width)
Convert normal mode exposure time to light-sheet mode exposure time. Calculate the parameters for an acquisition
- Parameters:
full_chip_exposure_time (float) – Normal mode exposure time in seconds.
shutter_width (int) – Width of light-sheet rolling shutter.
- Returns:
exposure_time (float) – Light-sheet mode exposure time (s).
camera_line_interval (float) – HamamatsuOrca line interval duration (s).
full_chip_exposure time (float) – Full chip exposure time (s).
- calculate_readout_time()
Calculate duration of time needed to readout an image. Calculates the readout time and maximum frame rate according to the camera configuration settings.
- Returns:
readout_time – Duration of time needed to readout an image.
- Return type:
float
- close_camera()
Close SyntheticCamera Camera
- close_image_series()
Close image series.
Stops the acquisition and sets is_acquiring flag to False.
- generate_new_frame()
Generate a synthetic image.
- get_line_interval()
Return stored camera line interval.
- Returns:
line_interval – line interval duration (s).
- Return type:
float
- get_new_frame()
Get frame from SyntheticCamera camera.
- get_offset_variance_maps()
Get offset and variance maps from file.
- Returns:
offset (np.ndarray) – Offset map.
variance (np.ndarray) – Variance map.
- Raises:
FileNotFoundError – If offset or variance map is not found.
- initialize_image_series(data_buffer=None, number_of_frames=100)
Initialize SyntheticCamera image series.
- Parameters:
data_buffer (int) – Size of the data to buffer. Default is None.
number_of_frames (int) – Number of frames. Default is 100.
- load_images(filenames=None, ds=None)
Pre-populate the buffer with images. Can either come from TIFF files or Numpy stacks.
- report_settings()
Print Camera Settings.
- set_ROI(roi_height=2048, roi_width=2048)
Change the size of the active region on the camera.
- Parameters:
roi_height (int) – Height of active camera region.
roi_width (int) – Width of active camera region.
- set_binning(binning_string)
Set SyntheticCamera binning mode.
- Parameters:
binning_string (str) – Desired binning properties (e.g., ‘2x2’, ‘4x4’, ‘8x8’
- set_exposure_time(exposure_time)
Set SyntheticCamera exposure time.
All of our units are in milliseconds. Function converts to seconds.
- Parameters:
exposure_time (float) – Exposure time in seconds.
- set_line_interval(line_interval_time)
Set SyntheticCamera line interval.
- Parameters:
line_interval_time (float) – Line interval duration.
- set_readout_direction(mode)
Set HamamatsuOrca readout direction.
- Parameters:
mode (str) – ‘Top-to-Bottom’, ‘Bottom-to-Top’, ‘bytrigger’, or ‘diverge’.
- set_sensor_mode(mode)
Set SyntheticCamera sensor mode.
- Parameters:
mode (str) – ‘Normal’ or ‘Light-Sheet’
- camera_controller
Hardware device to connect to
- Type:
object
- camera_exposure_time
exposure time
- Type:
float
- camera_parameters
Camera parameters
- Type:
dict
- configuration
Global configuration of the microscope
- Type:
dict
- current_frame_idx
current image id
- Type:
int
- data_buffer
data buffer
- Type:
object
- is_acquiring
Whether the camera is currently acquiring
- Type:
bool
- min_image_height
Minimum image height
- Type:
int
- min_image_width
Minimum image width
- Type:
int
- minimum_exposure_time
minimum exposure time
- Type:
float
- num_of_frame
number of frames
- Type:
int
- property offset
Return offset map. If not present, load from file.
- Returns:
offset – Offset map.
- Return type:
np.ndarray
- pre_frame_idx
previous image id
- Type:
int
- random_image
whether to use random image
- Type:
bool
- serial_number
serial number
- Type:
int
- step_image_height
Minimum step size for image height.
- Type:
int
- step_image_width
Minimum step size for image width.
- Type:
int
- property variance
Return variance map. If not present, load from file.
- Returns:
variance – Variance map.
- Return type:
np.ndarray
- x_pixels
width
- Type:
int
- y_pixels
height
- Type:
int