{ "cells": [ { "cell_type": "markdown", "id": "5b631045-a739-4722-82eb-2af8cee4500f", "metadata": {}, "source": [ "# Reading Microscopy Data in Python\n", "\n", "Choosing the right Python library for microscopy data analysis is crucial for optimizing workflow efficiency and gaining valuable insights. This guide offers a comprehensive overview of available libraries, helping you make informed decisions based on your priorities, whether it's speed, versatility, or integration with other tools. Empower your microscopy data analysis by exploring the options tailored to meet your specific requirements.\n", "\n", "For opening microscopy data files in Python, you have several options, each with its own advantages. Here's a breakdown of the options and some considerations:\n", "\n", "1. scikit-image (skimage.io.imread and skimage.io.imread_collection):\n", "- Used for reading standard image formats.\n", "- Provides simple and efficient functions for reading individual images or collections of images.\n", "\n", "2. tifffile (tifffile.TiffFile and tifffile.TiffSequence):\n", " \n", "- Specialized for working with TIFF files, including multi-dimensional arrays.\n", "- TiffSequence is useful for handling sequences of TIFF files.\n", "\n", "3. bioformats (bioformats.ImageReader):\n", "- Supports a variety of microscopy formats, especially those using the OME data model.\n", "- Handles multi-dimensional data and can read metadata.\n", "\n", "Regarding ImageJ hyperstack organization (TZCYXS):\n", "\n", " T: Time\n", " Z: Z-stack (slices)\n", " C: Channels\n", " Y: Height\n", " X: Width\n", " S: Series (used for distinguishing multiple acquisitions)\n", "\n", "For Holoviews:\n", "\n", "- It's used for interactive visualization but doesn't directly handle file reading. Check for memmap support and disk reading capabilities.\n", "\n", "Regarding Bioformats standard:\n", "\n", "- Bioformats follows the OME (Open Microscopy Environment) standard, where each channel and time point is stored in a separate TIFF file. An OME.tif typically contains a single plane or a Z-stack.\n", "\n", "About tiles and 5D in Bioformats:\n", "\n", "- In the context of Bioformats, 5D typically refers to a dataset with dimensions T-Z-C-Y-X, where T is time, Z is the z-stack, C is the channel, and Y and X are spatial dimensions. Tiles may refer to sub-images or chunks of the larger image, which can be useful for efficiently working with large datasets.\n", "\n", "The 6D, 7D, and 8D configurations in Bioformats likely involve additional dimensions or parameters specific to certain types of microscopy data.\n", "\n", "To understand the exact definition of 5D in Bioformats, you should refer to the Bioformats documentation or OME data model specifications for detailed information on how these dimensions are interpreted and utilized in the context of microscopy data.\n", "\n", "## Data Path Assignment and Imports\n", "\n", "To begin our analysis, we first need to import the necessary libraries and assign the path to our data files. This step ensures that we have access to the tools and resources required for the subsequent tasks.\n", "\n", "Let's get started by executing the following code:" ] }, { "cell_type": "code", "execution_count": null, "id": "5a23c9e2-cb1e-4518-9ca1-d12e03722461", "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2\n", "\n", "from pathlib import Path\n", "\n", "import skimage.io\n", "import tifffile\n", "\n", "import nima_io.read as ir\n", "\n", "tdata = Path(\"../../tests/data/\")\n", "lif = tdata / \"2015Aug28_TransHXB2_50min+DMSO.lif\"\n", "img_tile = tdata / \"t4_1.tif\" # C=3 T=4 S=15\n", "img_void_tile = tdata / \"tile6_1.tif\" # C=4 T=3 S=14 scattered\n", "# imgsingle = tdata / \"exp2_2.tif\" # C=2 T=81\n", "# mcts = tdata / \"multi-channel-time-series.ome.tif\" # C=3 T=7\n", "# bigtiff = tdata / \"LC26GFP_1.tf8\" # bigtiff\n", "\n", "slif = str(lif)\n", "simg_tile = str(img_tile)\n", "simg_void_tile = str(img_void_tile)\n", "# simgsingle = str(imgsingle)\n", "# smcts = str(mcts)\n", "# sbigtiff = str(bigtiff)" ] }, { "cell_type": "markdown", "id": "cd09e9ee-e0a4-46ae-b04e-3411cc356dc8", "metadata": {}, "source": [ "## Skimage and Tifffile\n", "\n", "`scikit-image` serves as a versatile option for general image reading, encompassing various formats, including TIFF.\n", "Meanwhile `tifffile` stands out for its capabilities in managing sequences, OME metadata, memory mapping, and Zarr arrays specifically for TIFF data files.\n", "\n", "- Memory mapping `memmap` enables efficient work with large files by mapping portions into memory as needed, without loading the entire file.\n", "\n", "- `Zarr` storage format, known for its handling of chunked, compressed, and n-dimensional arrays. This provides flexibility in reading and writing Zarr arrays, contributing to the library's versatility in managing microscopy datasets, especially those with large or complex structures." ] }, { "cell_type": "code", "execution_count": null, "id": "3d1b7d1a-27b9-417e-b974-dfed3dff625d", "metadata": {}, "outputs": [], "source": [ "t1 = skimage.io.imread(img_tile, plugin=\"tifffile\")\n", "t2 = skimage.io.imread(img_void_tile, plugin=\"tifffile\")\n", "t1.shape, t2.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "1ca4cfa8-8e52-4e23-9924-db71af66b75f", "metadata": {}, "outputs": [], "source": [ "tf1 = tifffile.imread(img_tile)\n", "tf2 = tifffile.imread(img_void_tile)\n", "tf1.shape, tf2.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "1b11f1b2-cb32-4e05-aedf-706fbccf9fbe", "metadata": {}, "outputs": [], "source": [ "fp1glob = str(tdata / \"im1s1z3c5t_?.ome.tif\")\n", "\n", "tifs = tifffile.TiffSequence(fp1glob)\n", "d = tifs.asarray()\n", "print(d.shape)\n", "print(tifs.shape)" ] }, { "cell_type": "code", "execution_count": null, "id": "05781629-a043-4ce5-990c-06c0f4a10aac", "metadata": {}, "outputs": [], "source": [ "with tifffile.TiffFile(img_tile) as tif:\n", " tag = tif.pages[0].tags[\"ImageDescription\"]\n", "\n", "tag.value[:1000]" ] }, { "attachments": {}, "cell_type": "markdown", "id": "720634ea-3ffb-4003-b64c-a5fac69419d2", "metadata": {}, "source": [ "## nima_io\n", "### read" ] }, { "cell_type": "code", "execution_count": null, "id": "c3ab9203-0e9e-4f05-9eb1-3349c7c06d6d", "metadata": {}, "outputs": [], "source": [ "md, wr = ir.read(simg_void_tile)\n", "md.core, wr" ] }, { "cell_type": "code", "execution_count": null, "id": "58058be6-31f7-43cc-a744-4612a7c1ca5b", "metadata": {}, "outputs": [], "source": [ "md.core.voxel_size" ] }, { "cell_type": "code", "execution_count": null, "id": "f68a3d3f-e1d5-4b71-9f6c-41d6267ce4a6", "metadata": {}, "outputs": [], "source": [ "root = wr.rdr.getMetadataStoreRoot()" ] }, { "cell_type": "code", "execution_count": null, "id": "61fdbfb6-28b1-4214-8bde-050e56e5ddd4", "metadata": {}, "outputs": [], "source": [ "ome_store = wr.rdr.getMetadataStore()\n", "ome_store" ] }, { "cell_type": "code", "execution_count": null, "id": "cce55e1d-e86e-41b1-ac87-577ac36157d6", "metadata": {}, "outputs": [], "source": [ "get_power = ome_store.getArcPower(0, 4)\n", "get_power" ] }, { "cell_type": "code", "execution_count": null, "id": "4f4a9389-2a97-43f9-bac3-016340790b03", "metadata": {}, "outputs": [], "source": [ "att = ome_store.getChannelLightSourceSettingsAttenuation(0, 0)" ] }, { "cell_type": "code", "execution_count": null, "id": "d15bc247-59a9-4a00-b09e-36df54ac4cec", "metadata": {}, "outputs": [], "source": [ "nmax = 7\n", "(\n", " len([md for md in md.full.items() if len(md[1][0][0]) == nmax]),\n", " [md for md in md.full.items() if len(md[1][0][0]) == nmax],\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "1a82accb-ce9e-4527-932a-a9aef18dab96", "metadata": {}, "outputs": [], "source": [ "list(range(4))" ] }, { "cell_type": "code", "execution_count": null, "id": "3b3ef3a7-7764-4508-bef5-66a684304693", "metadata": {}, "outputs": [], "source": [ "[(0,) * n for n in range(3 + 1)]" ] }, { "cell_type": "code", "execution_count": null, "id": "21eef9b4-22d5-44f4-8bcb-787af0baf79a", "metadata": {}, "outputs": [], "source": [ "ir.convert_java_numeric_field(att), ir.convert_java_numeric_field(get_power)" ] }, { "cell_type": "code", "execution_count": null, "id": "7ac12df6-d29f-491e-84de-747c0efe4f59", "metadata": {}, "outputs": [], "source": [ "{md.full.get(k)[0][0] for k in md.full}" ] }, { "cell_type": "code", "execution_count": null, "id": "aeffdafe-b157-4c13-aaf4-59c463479537", "metadata": {}, "outputs": [], "source": [ "[(k, md.full.get(k)[0]) for k in md.full if not md.full.get(k)[0][1]]" ] }, { "cell_type": "code", "execution_count": null, "id": "68f9f72e-49e0-42a9-b5e3-f014c385a248", "metadata": {}, "outputs": [], "source": [ "ome_store.getRoot() == root" ] }, { "cell_type": "code", "execution_count": null, "id": "26e765bd-d8c3-48a3-a4b8-dae9b8b37f84", "metadata": {}, "outputs": [], "source": [ "ome_store.getPlaneCount(4), ome_store.getPlaneTheC(4, 11), ome_store.getPixelsSizeZ(4)" ] }, { "cell_type": "code", "execution_count": null, "id": "b88acf3a-0949-4865-be24-ce6ad393acff", "metadata": {}, "outputs": [], "source": [ "wr.rdr.getDimensionOrder(), ir.read(slif)[1].rdr.getDimensionOrder()" ] }, { "cell_type": "markdown", "id": "40c0ca28-7497-4f1f-bb1e-b687f7976515", "metadata": {}, "source": [ "Mind the difference between img_void_tile and lif files." ] }, { "cell_type": "code", "execution_count": null, "id": "4677ca07-41ac-4024-966e-1db3804b77cc", "metadata": {}, "outputs": [], "source": [ "md.full[\"PixelsDimensionOrder\"]" ] }, { "cell_type": "code", "execution_count": null, "id": "4776ee74-ec78-4ae6-92bf-bbb8e4c6024f", "metadata": {}, "outputs": [], "source": [ "root.getImage(0)" ] }, { "cell_type": "code", "execution_count": null, "id": "30d3b452-3a99-4725-a5f9-f9b107aba831", "metadata": {}, "outputs": [], "source": [ "root.getImage(13).getPixels().getPlane(11).getTheC().getValue()" ] }, { "cell_type": "code", "execution_count": null, "id": "ce2885f8-dd11-42b8-92e1-8a18b30586f1", "metadata": {}, "outputs": [], "source": [ "(\n", " root.getImage(13).getName(),\n", " ir.read(slif)[1].rdr.getMetadataStoreRoot().getImage(2).getName(),\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "a879c84e-f2b5-4a4e-9b60-2e83fc58716c", "metadata": {}, "outputs": [], "source": [ "md.core.__dict__" ] }, { "cell_type": "code", "execution_count": null, "id": "1a281aa0-8f25-4481-9321-04312c6794db", "metadata": {}, "outputs": [], "source": [ "vars(md.core)" ] }, { "cell_type": "markdown", "id": "98e5d9de-4b62-476e-86f0-e5d60ab91b2e", "metadata": {}, "source": [ "### Stitch" ] }, { "cell_type": "code", "execution_count": null, "id": "819679c9-ecdc-44c0-a545-633f97c68995", "metadata": {}, "outputs": [], "source": [ "f = ir.stitch(md.core, wr, c=2, t=2)\n", "skimage.io.imshow(f)" ] }, { "cell_type": "code", "execution_count": null, "id": "f0d27dd7-5a5e-44b0-bdf6-d9734caee739", "metadata": {}, "outputs": [], "source": [ "md.core.stage_position[2]" ] }, { "attachments": {}, "cell_type": "markdown", "id": "ace3967a-ea05-453b-b6d7-f65263445722", "metadata": {}, "source": [ "## nima_io.read\n", "\n", "| function | time (ms) | note |\n", "|------------|------------|--------------------------|\n", "| read | 169 | |\n", "| read_pims | 195 | extra pims DIMS |\n", "\n", "- Metadata is now uniform across different reading functions.\n", "\n", "In the following sections, various bioformats implementations are explored. None of the explored libraries return the numerous metadata linked to individual planes. Consequently, I have developed a small library to handle additional (often neglected) metadata, such as acquisition stage position (essential for reconstructing tiled images) and illumination and emission settings.\n", "\n", "\n", "### PIMS\n", "\n", "Which is currently unable to download loci_tools.jar.\n", "\n", "**I really like the frame metadata t_s, x_um, y_um and z_um.\n", "Every array (2D, 3D, ..., n-D) having those metadata in common are contained in the Frame obj: a numpy array with metadata(dict) and frame_no(int).**\n", "\n", "Are fs.bundle_axes (fs.frame_shape), fs.iter_axes and fs.default_coords overcomplicated?\n", "\n", "Anyway: iter=0 == iter=n which is at least unexpected." ] }, { "cell_type": "code", "execution_count": null, "id": "bc25301d-002b-4f4c-9710-c61ed74638e5", "metadata": {}, "outputs": [], "source": [ "md_pims, wr_pims = ir.read_pims(img_void_tile)\n", "md_pims.core.__dict__" ] }, { "cell_type": "code", "execution_count": null, "id": "6d3ae5b9-b048-46a5-b9ad-2395507d10d8", "metadata": {}, "outputs": [], "source": [ "mdata = wr.rdr.getMetadataStore()" ] }, { "cell_type": "code", "execution_count": null, "id": "a3585a04-cca5-4217-b7a9-839f718cdad7", "metadata": {}, "outputs": [], "source": [ "root = mdata.getRoot()" ] }, { "cell_type": "code", "execution_count": null, "id": "a2d1f293-02c6-44ac-a939-3fa8ee77f421", "metadata": {}, "outputs": [], "source": [ "im0 = root.getImage(0)" ] }, { "cell_type": "code", "execution_count": null, "id": "a4945eaf-d84a-40f4-b45e-1b19cd83ff77", "metadata": {}, "outputs": [], "source": [ "pixels = im0.getPixels()" ] }, { "cell_type": "code", "execution_count": null, "id": "13be7ffa-5d4a-4a7c-899f-bdb4d8b20028", "metadata": {}, "outputs": [], "source": [ "for idx in range(pixels.sizeOfTiffDataList()):\n", " tiffData = pixels.getTiffData(idx)\n", " c = tiffData.getFirstC().getValue().intValue()\n", " t = tiffData.getFirstT().getValue().intValue()\n", " print(f\"TiffData: c={c}, t={t}\")" ] }, { "cell_type": "markdown", "id": "953f0cb2-a996-4cb6-aaf0-6e96da4d28f7", "metadata": {}, "source": [ "## ImageIO" ] }, { "cell_type": "code", "execution_count": null, "id": "9477b049-2b46-4ab3-8e6b-b809c762bda3", "metadata": {}, "outputs": [], "source": [ "from imageio.v3 import imread\n", "\n", "%timeit imread(img_void_tile, index=13)\n", "i = imread(img_void_tile, index=13)\n", "i.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "f88e7ba7-21e4-4c2d-bf08-20a7157d6f40", "metadata": {}, "outputs": [], "source": [ "i.nbytes, 512**2 * 3 * 4 * 2" ] }, { "cell_type": "markdown", "id": "8e1fa466-c8b6-4edb-b5b7-87dcbca156b8", "metadata": {}, "source": [ "It can read tif (tf8) files. Series might be passed using `index` (you need to know in advance).\n", "\n", "## AICSImageIO" ] }, { "cell_type": "code", "execution_count": null, "id": "0bad2621-ee75-4c61-9a3c-434c67866c31", "metadata": {}, "outputs": [], "source": [ "from aicsimageio import AICSImage\n", "\n", "i = AICSImage(img_void_tile)\n", "# i = AICSImage(img_void_tile, reconstruct_mosaic=True)\n", "# i_lif = AICSImage(lif)" ] }, { "cell_type": "code", "execution_count": null, "id": "becc0899-39f0-4a56-8a88-a63b9bdc56e7", "metadata": {}, "outputs": [], "source": [ "i.ome_metadata.instruments[0].arcs[0]" ] }, { "cell_type": "code", "execution_count": null, "id": "d914489b-12f8-401a-b044-0f328821f30b", "metadata": {}, "outputs": [], "source": [ "lif_aics = AICSImage(slif)" ] }, { "cell_type": "code", "execution_count": null, "id": "2425c1a6-8b27-4fbc-9d6d-8afef7d4a375", "metadata": {}, "outputs": [], "source": [ "lif_aics.metadata" ] }, { "cell_type": "code", "execution_count": null, "id": "e63e480e-af93-4654-ac9a-0f87738eaa64", "metadata": {}, "outputs": [], "source": [ "i.ome_metadata" ] }, { "cell_type": "code", "execution_count": null, "id": "e872772c-7b09-4180-b663-99c516029b66", "metadata": {}, "outputs": [], "source": [ "i.metadata.images[0].pixels.channels[0].light_source_settings.attenuation" ] }, { "cell_type": "code", "execution_count": null, "id": "5482b4a9-8bb7-4c86-8d24-d066d55e9678", "metadata": {}, "outputs": [], "source": [ "i.scenes" ] }, { "cell_type": "code", "execution_count": null, "id": "06fa9adb-e8f3-4e78-bfcf-e292ab941c8f", "metadata": {}, "outputs": [], "source": [ "i.get_dask_stack()" ] }, { "cell_type": "markdown", "id": "5ff0083c-40ef-4ff7-ab40-cb0d5193f345", "metadata": {}, "source": [ "Mosaic stitch is not supported on tif files; so I will use my function relying on the PositionXYZ metadata.\n", "\n", "## dask_image" ] }, { "cell_type": "code", "execution_count": null, "id": "086065c7-e210-410f-8d96-07fb1fc27a43", "metadata": {}, "outputs": [], "source": [ "from dask_image.imread import imread\n", "\n", "i = imread(img_void_tile)" ] }, { "cell_type": "code", "execution_count": null, "id": "fe7d003f-96d6-44f5-a229-79bfc07e95fb", "metadata": {}, "outputs": [], "source": [ "i" ] }, { "cell_type": "markdown", "id": "71d2c542-5b10-457d-88b5-25c5c474184a", "metadata": {}, "source": [ "Somehow it uses bioformats and can handle lif. No mosaic, no metadata though.\n", "\n", "**Pycroscopy** https://pypi.org/project/pycroscopy/ is not reading lif nor ome-tif at the moment.\n", "\n", "**large-image[all]** failed to install.\n", "\n", "**pyimagej** need conda?\n", "\n", "## bioio-bioformats" ] }, { "cell_type": "markdown", "id": "aef0981b-77aa-49f0-996a-692ed36eaf6e", "metadata": {}, "source": [ "import bioio_ome_tiled_tiff\n", "\n", "bioio_ome_tiled_tiff.Reader(str(img_void_tile))\n", "\n", "TypeError: tile6_1.tif is not a tiled tiff. The python backend of the BioReader only supports OME tiled tiffs." ] }, { "cell_type": "code", "execution_count": null, "id": "b48df022-16b9-40a8-bf06-e93714d3ffe9", "metadata": {}, "outputs": [], "source": [ "import bioio_bioformats\n", "\n", "im = bioio_bioformats.Reader(img_void_tile)" ] }, { "cell_type": "code", "execution_count": null, "id": "abbd50ca-1992-42cd-a8cc-b1aeca5a0d12", "metadata": {}, "outputs": [], "source": [ "im.ome_metadata.images[0].pixels.channels[2].light_source_settings" ] }, { "cell_type": "code", "execution_count": null, "id": "be92cc51-e1ba-4b50-a0ab-4eaf4d5ba278", "metadata": {}, "outputs": [], "source": [ "lif_bioio = bioio_bioformats.Reader(lif)" ] }, { "cell_type": "code", "execution_count": null, "id": "016596c1-432e-4160-9b07-3cc9fa75d702", "metadata": {}, "outputs": [], "source": [ "lif_bioio.physical_pixel_sizes" ] }, { "cell_type": "code", "execution_count": null, "id": "f524812d-0818-4e6b-9737-89485dd3573c", "metadata": {}, "outputs": [], "source": [ "im.get_dask_stack()" ] }, { "cell_type": "code", "execution_count": null, "id": "013e761c-fbfe-4b15-b582-f3ced59d7136", "metadata": {}, "outputs": [], "source": [ "im.ome_metadata.plates[0].wells[0]" ] }, { "cell_type": "code", "execution_count": null, "id": "24ec421e-3b7b-4649-8e6b-8bfa7e65669d", "metadata": {}, "outputs": [], "source": [ "i = bioio_bioformats.Reader(img_tile)\n", "i.data.shape, i.dims" ] }, { "cell_type": "code", "execution_count": null, "id": "e697140f-b756-486f-bca7-725ccd25f782", "metadata": {}, "outputs": [], "source": [ "i.xarray_dask_data.attrs[\"processed\"]" ] }, { "cell_type": "code", "execution_count": null, "id": "e2656b99-7da0-4d97-80ac-844c54cd1945", "metadata": {}, "outputs": [], "source": [ "unp = i.xarray_dask_data.attrs[\"unprocessed\"]\n", "unp[:1000]" ] }, { "cell_type": "code", "execution_count": null, "id": "48df43f5-f189-48d0-b5e0-d2243c6b72cb", "metadata": {}, "outputs": [], "source": [ "stk = i.get_dask_stack()" ] }, { "cell_type": "code", "execution_count": null, "id": "6d910666-9ed5-4809-aa73-6bb116baed51", "metadata": {}, "outputs": [], "source": [ "stk.A" ] }, { "cell_type": "markdown", "id": "54963f96-3e06-4e85-8c4b-1870689c2523", "metadata": {}, "source": [ "## bfio" ] }, { "cell_type": "code", "execution_count": null, "id": "c14d2152-521b-4c3d-924f-462525647be5", "metadata": {}, "outputs": [], "source": [ "import bfio\n", "\n", "bfio.BioReader(img_void_tile)" ] }, { "cell_type": "code", "execution_count": null, "id": "a5650a71-bf23-4632-9857-be38ddb32bb2", "metadata": {}, "outputs": [], "source": [ "rdr = bfio.BioReader(img_void_tile)\n", "%timeit i = rdr.read()\n", "i = rdr.read()\n", "i.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "69328e4b-cfff-45ec-af5a-73b94577c230", "metadata": {}, "outputs": [], "source": [ "rdr.metadata" ] }, { "cell_type": "code", "execution_count": null, "id": "a222f1fe-34db-43d1-8a97-6720ccede82a", "metadata": {}, "outputs": [], "source": [ "rdr.ps_x" ] }, { "cell_type": "code", "execution_count": null, "id": "eab10d55-8697-453f-8422-145418ef10d6", "metadata": {}, "outputs": [], "source": [ "rdr.close()" ] }, { "cell_type": "markdown", "id": "e6d681d7-0dd1-4be8-b5ed-6e25d09bcf58", "metadata": {}, "source": [ "## PIMS" ] }, { "cell_type": "code", "execution_count": null, "id": "ea19fd32-096d-4cf4-9d1f-a17143d950ec", "metadata": {}, "outputs": [], "source": [ "import pims\n", "\n", "# %timeit fs = pims.Bioformats(img_void_tile)\n", "fs = pims.Bioformats(img_void_tile)\n", "fs.sizes" ] }, { "cell_type": "markdown", "id": "51091c74-7230-4ae9-b34c-3eb998e2a2a9", "metadata": {}, "source": [ "## PyOMETiff" ] }, { "cell_type": "code", "execution_count": null, "id": "d1584382-71bc-45a3-8b1a-864919a2bddf", "metadata": {}, "outputs": [], "source": [ "import pyometiff\n", "\n", "%timeit rdr = pyometiff.OMETIFFReader(fpath=img_void_tile)\n", "rdr = pyometiff.OMETIFFReader(fpath=img_void_tile)" ] }, { "cell_type": "code", "execution_count": null, "id": "9c0c6e95-2056-4cbe-83bb-015924e804e0", "metadata": {}, "outputs": [], "source": [ "%timeit r = rdr.read()\n", "res = rdr.read()" ] }, { "cell_type": "code", "execution_count": null, "id": "6319e148-99cf-43ed-8452-f836c36ef558", "metadata": {}, "outputs": [], "source": [ "res[1]" ] }, { "cell_type": "code", "execution_count": null, "id": "7eb964f5-be1a-4c65-9304-87eef305059e", "metadata": {}, "outputs": [], "source": [ "pyometiff.OMETIFFReader._get_metadata_template()" ] }, { "cell_type": "markdown", "id": "173fc85e-e4e3-40ff-bf57-97d1c252d4a0", "metadata": {}, "source": [ "## Final Note\n", "\n", "I will keep \n", "\n", "0. Read\n", "1. stitch\n", "2. md_grouping\n", "\n", "- impy\n", "- napari.read\n", "- pycromanager\n", "- microscope\n", "- python-microscopy" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" } }, "nbformat": 4, "nbformat_minor": 5 }