{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Converting STPT mosaic datasets from Zarr to TIFF format" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load the module that we are going to use. The class is `STPTDataset` defined in `imaxt_image.datasets`" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from imaxt_image.datasets import STPTDataset" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define here the location (`path`) and name (`name`) of the dataset. Additionaly set the scale that we want to use: 1, 2, 4, 8, 16 or 32 where 1 is the original resolution, 2 is downsampled 2x2 pixels, etc." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "path = \"/data/meds1_c/storage/processed/stpt/\"\n", "name = \"20200311_balbc_8020_3dIMC_20x15_2x8umOS_set1\"\n", "scale = 8" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We read the data as shown below, instantiating the `STPTDataset` class wih the location of the dataset and the scale (resolution) that we want to read." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\n", "Dimensions: (channel: 4, x: 2340, y: 1820, z: 2)\n", "Coordinates:\n", " * channel (channel) int64 1 2 3 4\n", " type \n", " S002 (z, channel, y, x) float64 dask.array\n", " S003 (z, channel, y, x) float64 dask.array\n", " S004 (z, channel, y, x) float64 dask.array\n", " S005 (z, channel, y, x) float64 dask.array\n", " S006 (z, channel, y, x) float64 dask.array\n", " S007 (z, channel, y, x) float64 dask.array\n", " S008 (z, channel, y, x) float64 dask.array\n", " S009 (z, channel, y, x) float64 dask.array\n", " S010 (z, channel, y, x) float64 dask.array\n", " S011 (z, channel, y, x) float64 dask.array\n", " S012 (z, channel, y, x) float64 dask.array\n", " S013 (z, channel, y, x) float64 dask.array\n", " S014 (z, channel, y, x) float64 dask.array\n", " S015 (z, channel, y, x) float64 dask.array\n", " S016 (z, channel, y, x) float64 dask.array\n", " S017 (z, channel, y, x) float64 dask.array\n", " S018 (z, channel, y, x) float64 dask.array\n", " S019 (z, channel, y, x) float64 dask.array\n", " S020 (z, channel, y, x) float64 dask.array" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ds = STPTDataset(name, path, scale=scale)\n", "ds" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can access e.g. the first slide as:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\n", "dask.array\n", "Coordinates:\n", " * channel (channel) int64 1 2 3 4\n", " type