|
317 | 317 | }, |
318 | 318 | { |
319 | 319 | "cell_type": "code", |
320 | | - "execution_count": 10, |
| 320 | + "execution_count": null, |
321 | 321 | "metadata": {}, |
322 | 322 | "outputs": [ |
323 | 323 | { |
|
342 | 342 | } |
343 | 343 | ], |
344 | 344 | "source": [ |
345 | | - "ims = await pr.capture(\n", |
| 345 | + "res = await pr.capture(\n", |
346 | 346 | " well=(1, 2),\n", |
347 | 347 | " mode=ImagingMode.BRIGHTFIELD,\n", |
348 | 348 | " objective=Objective.O_4x_PL_FL_PHASE,\n", |
|
351 | 351 | " gain=16,\n", |
352 | 352 | " led_intensity=10,\n", |
353 | 353 | ")\n", |
354 | | - "plt.imshow(ims[0], cmap=\"gray\", vmin=0, vmax=255)" |
| 354 | + "plt.imshow(res.images[0], cmap=\"gray\", vmin=0, vmax=255)" |
355 | 355 | ] |
356 | 356 | }, |
357 | 357 | { |
|
374 | 374 | }, |
375 | 375 | { |
376 | 376 | "cell_type": "code", |
377 | | - "execution_count": 41, |
| 377 | + "execution_count": null, |
378 | 378 | "metadata": {}, |
379 | 379 | "outputs": [ |
380 | 380 | { |
|
399 | 399 | } |
400 | 400 | ], |
401 | 401 | "source": [ |
402 | | - "ims = await pr.capture(\n", |
| 402 | + "res = await pr.capture(\n", |
403 | 403 | " well=(1, 2),\n", |
404 | 404 | " mode=ImagingMode.BRIGHTFIELD,\n", |
405 | 405 | " objective=Objective.O_4x_PL_FL_PHASE,\n", |
|
408 | 408 | " gain=16,\n", |
409 | 409 | " led_intensity=10\n", |
410 | 410 | ")\n", |
411 | | - "plt.imshow(ims[0], cmap=\"gray\", vmin=0, vmax=255)" |
| 411 | + "plt.imshow(res.images[0], cmap=\"gray\", vmin=0, vmax=255)" |
412 | 412 | ] |
413 | 413 | }, |
414 | 414 | { |
|
440 | 440 | "from pylabrobot.plate_reading.imager import Imager, max_pixel_at_fraction, fraction_overexposed\n", |
441 | 441 | "from pylabrobot.plate_reading.standard import AutoExposure\n", |
442 | 442 | "\n", |
443 | | - "ims = await pr.capture(\n", |
| 443 | + "res = await pr.capture(\n", |
444 | 444 | " exposure_time=AutoExposure(\n", |
445 | 445 | " # evaluate_exposure=fraction_overexposed(fraction=0.005, margin=0.005/10),\n", |
446 | 446 | " evaluate_exposure=max_pixel_at_fraction(fraction=0.90, margin=0.05),\n", |
|
467 | 467 | }, |
468 | 468 | { |
469 | 469 | "cell_type": "code", |
470 | | - "execution_count": 13, |
| 470 | + "execution_count": null, |
471 | 471 | "metadata": {}, |
472 | 472 | "outputs": [], |
473 | 473 | "source": [ |
474 | 474 | "from PIL import Image\n", |
475 | 475 | "import numpy as np\n", |
476 | 476 | "\n", |
477 | | - "array = np.array(ims[0], dtype=np.float32)\n", |
| 477 | + "array = np.array(res.images[0], dtype=np.float32)\n", |
478 | 478 | "array_uint16 = (array * (65535 / 255)).astype(np.uint16)\n", |
479 | 479 | "Image.fromarray(array_uint16).save(\"test.tiff\")" |
480 | 480 | ] |
|
492 | 492 | }, |
493 | 493 | { |
494 | 494 | "cell_type": "code", |
495 | | - "execution_count": 31, |
| 495 | + "execution_count": null, |
496 | 496 | "metadata": {}, |
497 | 497 | "outputs": [ |
498 | 498 | { |
|
510 | 510 | "num_rows = 4\n", |
511 | 511 | "num_cols = 4\n", |
512 | 512 | "\n", |
513 | | - "ims = await pr.capture(\n", |
| 513 | + "res = await pr.capture(\n", |
514 | 514 | " well=(1, 2),\n", |
515 | 515 | " mode=ImagingMode.BRIGHTFIELD,\n", |
516 | 516 | " objective=Objective.O_4x_PL_FL_PHASE,\n", |
|
520 | 520 | " coverage=(num_rows, num_cols),\n", |
521 | 521 | " center_position=(-6, 0),\n", |
522 | 522 | ")\n", |
523 | | - "len(ims)" |
| 523 | + "len(res.images)" |
524 | 524 | ] |
525 | 525 | }, |
526 | 526 | { |
527 | 527 | "cell_type": "code", |
528 | | - "execution_count": 30, |
| 528 | + "execution_count": null, |
529 | 529 | "metadata": {}, |
530 | 530 | "outputs": [ |
531 | 531 | { |
|
544 | 544 | "for row in range(num_rows):\n", |
545 | 545 | " for col in range(num_cols):\n", |
546 | 546 | " plt.subplot(num_rows, num_cols, row * num_cols + col + 1)\n", |
547 | | - " plt.imshow(ims[row * num_cols + col], cmap=\"gray\", vmin=0, vmax=255)\n", |
| 547 | + " plt.imshow(res.images[row * num_cols + col], cmap=\"gray\", vmin=0, vmax=255)\n", |
548 | 548 | " plt.axis(\"off\")" |
549 | 549 | ] |
550 | 550 | }, |
|
0 commit comments