Cytation 5#

%load_ext autoreload
%autoreload 2
import matplotlib.pyplot as plt
from pylabrobot.plate_reading import ImageReader, Cytation5Backend, ImagingMode
# for imaging, we need an environment variable to point to the Spinnaker GenTL file
import os
os.environ["SPINNAKER_GENTL64_CTI"] = "/usr/local/lib/spinnaker-gentl/Spinnaker_GenTL.cti"
import logging
logger = logging.getLogger("pylabrobot.plate_reading.biotek")
logger.setLevel(logging.DEBUG)
pr = ImageReader(name="PR", size_x=0,size_y=0,size_z=0, backend=Cytation5Backend())
await pr.setup(use_cam=True)
await pr.backend.get_firmware_version()
'1320200  Version 2.07'
await pr.backend.get_current_temperature()
23.5
await pr.open()
await pr.close()

Plate reading#

data = await pr.read_absorbance(wavelength=434)
plt.imshow(data)
<matplotlib.image.AxesImage at 0x1353cc790>
../_images/5eee8870eb453c15f3efb3faee31af79a34649e97ca88d5a88516c0e21050766.png
data = await pr.read_fluorescence(excitation_wavelength=485, emission_wavelength=528, focal_height=7.5)
plt.imshow(data)
<matplotlib.image.AxesImage at 0x16e144850>
../_images/c6bed6539984cc3e8c8ef03fb086557665c1b50f355ad89dfc39239bc993d2a1.png
data = await pr.read_luminescence(focal_height=4.5)
plt.imshow(data)
<matplotlib.image.AxesImage at 0x16e1a83d0>
../_images/e435cc3192c6734bc98ad01fc5e6fa6361820552e6d55feb97a96edcf5f3d4f7.png

Shaking#

await pr.backend.shake(shake_type=Cytation5Backend.ShakeType.LINEAR)
await pr.backend.stop_shaking()

Imaging#

Installation#

  1. Install python 3.10

  2. Download Spinnaker SDK and install (including Python) https://www.teledynevisionsolutions.com/products/spinnaker-sdk/

  3. Install numpy==1.26 (this is an older version)

im = await pr.capture(well=(1, 1), mode=ImagingMode.BRIGHTFIELD, focal_height=3, exposure_time=5, gain=10)
plt.imshow(im, cmap="gray", vmin=0, vmax=255)
<matplotlib.image.AxesImage at 0x14ac2b880>
../_images/1330156bf4044fe6ff0f48bcd237370e14611b21c66c978170e9da6569fc030a.png
im = await pr.capture(well=(1, 1), mode=ImagingMode.PHASE_CONTRAST, focal_height=3, exposure_time=12, gain=24)
plt.imshow(im, cmap="gray", vmin=0, vmax=255)
<matplotlib.image.AxesImage at 0x14c5db7c0>
../_images/a33657d3afdea17f41176b360a6b0a3fd6d95d1de8f128b5dbead42a54e05152.png
await pr.backend.set_gain(24)
im = await pr.capture(well=(1, 1), mode=ImagingMode.GFP, focal_height=3, exposure_time=1904)
plt.imshow(im, cmap="viridis", vmin=0, vmax=255)
<matplotlib.image.AxesImage at 0x14c5e0490>
../_images/462bf9dfdcd8800328c89d8ea74a5d7a41f63fe0fe376bc77806bf27fadfce45.png
im = await pr.capture(well=(1, 1), mode=ImagingMode.TEXAS_RED, focal_height=3, exposure_time=1904)
plt.imshow(im, cmap="gray", vmin=0, vmax=255)
<matplotlib.image.AxesImage at 0x14c7d7880>
../_images/cb8d2cebf05226526b38000f07dab0e8c4dff34a2f43ebfea7127ddaab00262d.png
import time
import numpy as np

exposure_time = 1904

# first time setting imaging mode is slower
_ = await pr.capture(well=(1, 1), mode=ImagingMode.BRIGHTFIELD, focal_height=3.3, exposure_time=exposure_time)

l = []
for i in range(10):
  t0 = time.monotonic_ns()
  _ = await pr.capture(well=(1, 1), mode=ImagingMode.BRIGHTFIELD, focal_height=3.3, exposure_time=exposure_time)
  t1 = time.monotonic_ns()
  l.append((t1 - t0) / 1e6)

print(f"{np.mean(l):.2f} ms ± {np.std(l):.2f} ms")
print(f"Overhead: {(np.mean(l) - exposure_time):.2f} ms")
2089.59 ms ± 15.72 ms
Overhead: 185.59 ms