src.camera package

Submodules

src.camera.Photometrics_camera module

class src.camera.Photometrics_camera.Photo_Camera(camera_name)

Bases: object

This is the main class to control the Photometrics camera and call functions from the pyvcam / PyVCAM-master Python wrapper.

Note: For the Photometrics camera to work, please go first to the PyVCAM-master folder and run: python setup.py install

__init__(camera_name)

Initialize Photometrics camera class.

Parameters:

camera_name – name of the camera. If you don’t know it, PVCamTest displays it when running it.

close()

Close the camera and un-initializes the PVCAM library.

end_preview()

Finish preview imaging.

get_imageroi()

Return the current region of interest / image shape of it.

Returns:

shape of ROI of camera.

init_previewbuffer(dimension1, dimension2)

Initialize a buffer to write images from the low-resolution preview function to.

Parameters:
  • dimension1 – dimension 1 of preview buffer (self.current_lowresROI_height)

  • dimension2 – dimension 2 of preview buffer (self.current_lowresROI_width)

prepare_ASLM_acquisition(exposure_time, scandelay)

Changes the settings of the high-resolution camera to start preview or stack acquisitions using axially-swept light-sheet microscopy.

Parameters:
  • exposure_time – Exposure time for the current acquisition.

  • scandelay – scan delay for ASLM.

prepare_stack_acquisition_highres(exposure_time=20)

Changes the settings of the high-resolution camera to start stack acquisitions using static light-sheet imaging (SPIM).

Parameters:

exposure_time – Exposure time for the current acquisition.

prepare_stack_acquisition_lowres(exposure_time=20)

Changes the settings of the low-resolution camera to start stack acquisitions.

Parameters:

exposure_time – Exposure time for the current acquisition.

run_preview_highres(out, flipimage=True)

Acquire and return a buffer image for the high-resolution preview (SPIM and ASLM). Update buffer out

Parameters:
  • out – buffer to update with acquired image

  • flipimage – do you want to change the orientation of the image to display.

run_preview_lowres()

Acquire and return a buffer image for the low-resolution preview.

Returns:

acquired image

run_stack_acquisition_buffer_fast(nb_planes, buffer, flipimage=False)

Run a stack acquisition of low- or high-res imaging.

Parameters:
  • nb_planes – how many planes to acquire

  • buffer – the buffer to save the acquired planes to

  • flipimage – (optional) True/False. If TRUE flip image

set_imageroi(s1, p1, w, h)

Configures and set a ROI on the camera. s2 = s1 + w - 1 p2 = p1 + h - 1

Parameters:
  • s1 – starting point x (width)

  • p1 – starting point y (height)

  • w – width of selected image ROI (how many columns)

  • h – height of selected image ROI (how many rows)

set_up_highrespreview(exposure=20)

Changes the settings of the high-resolution camera to start a high-resolution static (SPIM) preview.

Parameters:

exposure_time – Exposure time for the current acquisition.

set_up_lowres_preview(exposure=20)

Changes the settings of the low-resolution camera to start a preview.

Parameters:

exposure_time – Exposure time for the current acquisition.

src.camera.Synthetic_camera module

class src.camera.Synthetic_camera.Synthentic_cam_object(camera_name)

Bases: object

The API of a synthetic camera object that returns random pictures around a median value.

__init__(camera_name)

Initialize synthetic camera object

Parameters:

camera_name – Determines initial “Chip size” (lowres_synthetic: (2960, 5056); else (2048, 2048)).

close()

Close the synthetic camera.

finish()

Finish acquisition of synthetic camera object

open()

Open a synthetic camera object

poll_frame()

Generate random frame and return it.

Returns:

frame, fps, frame_count.

reset_rois()

Reset the ROIs of the synthetic camera object.

set_roi(s1, p1, w, h)

Set the ROIs of the synthetic camera object.

Parameters:
  • s1 – starting point x (width)

  • p1 – starting point y (height)

  • w – width of selected image ROI (how many columns)

  • h – height of selected image ROI (how many rows)

shape()

Return the shape of the ROI

Returns:

shape_roi

start_live(exp_time)

Set the synthetic camera object into acquisition mode (adjust mean value).

Parameters:

exp_time – Exposure time - affects median value

class src.camera.Synthetic_camera.Synthetic_Photo_Camera(camera_name)

Bases: object

This is the main class to control a synthetic camera object.

__init__(camera_name)

Initialize synthetic camera class.

Parameters:

camera_name – name of the camera.

close()

Close the synthetic camera.

end_preview()

Finish preview imaging.

get_imageroi()

Return the current region of interest / image shape of it.

Returns:

shape of ROI of camera.

init_previewbuffer(dimension1, dimension2)

Initialize a buffer to write images from the low-resolution preview function to.

Parameters:
  • dimension1 – dimension 1 of preview buffer (self.current_lowresROI_height)

  • dimension2 – dimension 2 of preview buffer (self.current_lowresROI_width)

prepare_ASLM_acquisition(exposure_time, scandelay)

Prepare the settings of the high-resolution camera to start preview or stack acquisitions using axially-swept light-sheet microscopy.

Parameters:
  • exposure_time – Exposure time for the current acquisition.

  • scandelay – scan delay for ASLM.

prepare_stack_acquisition_highres(exposure_time=20)

Prepare the settings of the high-resolution camera to start stack acquisitions using static light-sheet imaging (SPIM).

Parameters:

exposure_time – Exposure time for the current acquisition.

prepare_stack_acquisition_lowres(exposure_time=20)

Prepare the settings of the low-resolution camera to start low-resolution stack acquisitions.

Parameters:

exposure_time – Exposure time for the current acquisition.

run_preview_highres(out, flipimage=True)

Acquire and return a buffer image for the synthetic high-resolution preview (SPIM and ASLM). Update buffer out.

Parameters:
  • out – buffer to update with acquired image

  • flipimage – do you want to change the orientation of the image to display.

run_preview_lowres()

Acquire and return a buffer image for the low-resolution preview.

Returns:

acquired image

run_stack_acquisition_buffer_fast(nb_planes, buffer, flipimage=False)

Run a stack acquisition of low- or high-res imaging.

Parameters:
  • nb_planes – how many planes to acquire

  • buffer – the buffer to save the acquired planes to

  • flipimage – True/False. if TRUE flip image

set_imageroi(s1, p1, w, h)

Configures and set a ROI on the synthetic camera.

Parameters:
  • s1 – starting point x (width)

  • p1 – starting point y (height)

  • w – width of selected image ROI (how many columns)

  • h – height of selected image ROI (how many rows)

set_up_highrespreview(exposure=20)

Prepare a high-resolution static (SPIM) preview of the synthetic camera.

Parameters:

exposure_time – Exposure time for the current acquisition.

set_up_lowres_preview(exposure=20)

Prepare a low-resolution preview of the synthetic camera.

Parameters:

exposure_time – Exposure time for the current acquisition.

Module contents