{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# ImageXpress Pico\n", "\n", "The [Molecular Devices ImageXpress Pico](https://www.moleculardevices.com/products/cellular-imaging-systems/high-content-imaging/imagexpress-pico) is an automated cell imaging system. PyLabRobot communicates with it over SiLA 2 / gRPC.\n", "\n", "## Requirements\n", "\n", "- The Pico must be running the SiLA 2 server (default port 8091).\n", "- `pip install grpcio numpy Pillow`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pylabrobot.plate_reading import Imager, ImagingMode, Objective\n", "from pylabrobot.microscopes.molecular_devices.pico.backend import ExperimentalPicoBackend" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create the backend, specifying which objectives and filter cubes are physically installed on your instrument. The keys are 0-indexed turret / filter-wheel positions." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "backend = ExperimentalPicoBackend(\n", " host=\"192.168.1.100\",\n", " objectives={0: Objective.O_4X_PL_FL},\n", " filter_cubes={0: ImagingMode.DAPI, 1: ImagingMode.BRIGHTFIELD},\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pico = Imager(name=\"pico\", size_x=0, size_y=0, size_z=0, backend=backend)\n", "await pico.setup()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Assign a plate\n", "\n", "The plate geometry is used to derive the labware parameters sent to the Pico. Any PLR `Plate` definition works." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pylabrobot.resources import CellVis_96_wellplate_350uL_Fb\n", "\n", "plate = CellVis_96_wellplate_350uL_Fb(name=\"plate\")\n", "pico.assign_child_resource(plate)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading a plate\n", "\n", "Open the plate drawer, place the plate, and close it." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "await pico.backend.open_door()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Place the plate in the drawer, then close it.\n", "await pico.backend.close_door()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Capture an image\n", "\n", "Supported objectives:\n", "\n", "- `O_2_5X_N_PLAN` — N PLAN 2.5x/0.07\n", "- `O_4X_PL_FL` — PL FLUOTAR 4x/0.13\n", "- `O_10X_PL_FL` — PL FLUOTAR 10x/0.30\n", "- `O_20X_PL_FL` — PL FLUOTAR 20x/0.40\n", "- `O_40X_PL_FL` — PL FLUOTAR 40x/0.60\n", "\n", "Supported imaging modes:\n", "\n", "- `BRIGHTFIELD`\n", "- `DAPI`\n", "- `GFP`\n", "- `RFP`\n", "- `TEXAS_RED`\n", "- `CY5`" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "res = await pico.capture(\n", " well=(0, 0), # A1\n", " mode=ImagingMode.BRIGHTFIELD,\n", " objective=Objective.O_4X_PL_FL,\n", " exposure_time=10.0, # ms\n", " focal_height=1.0, # mm\n", " gain=0,\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "plt.imshow(res.images[0], cmap=\"gray\")\n", "plt.title(f\"Exposure: {res.exposure_time:.1f} ms\")\n", "plt.axis(\"off\")\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also pass a `Well` object directly:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "res = await pico.capture(\n", " well=plate.get_well(\"B3\"),\n", " mode=ImagingMode.DAPI,\n", " objective=Objective.O_4X_PL_FL,\n", " exposure_time=15.0,\n", " focal_height=1.0,\n", " gain=0,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Cleanup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "await pico.stop()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "name": "python", "version": "3.10.0" } }, "nbformat": 4, "nbformat_minor": 4 }