Skip to content

Instantly share code, notes, and snippets.

@GenevieveBuckley
Created January 12, 2023 03:53
Show Gist options
  • Save GenevieveBuckley/082edcd40616f90aed5f6da0e6900367 to your computer and use it in GitHub Desktop.
Save GenevieveBuckley/082edcd40616f90aed5f6da0e6900367 to your computer and use it in GitHub Desktop.
downsampling artifacts
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "44b5acaa",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import pathlib\n",
"\n",
"import dask.array as da\n",
"import numpy as np\n",
"\n",
"from spatial_image import to_spatial_image\n",
"from multiscale_spatial_image import to_multiscale, Methods"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "19800256",
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "16f29b44",
"metadata": {},
"outputs": [],
"source": [
"import napari\n",
"viewer = napari.Viewer()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6531e490",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-671a2ef6-9223-11ed-bd67-1e8454a2fb78</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
"\n",
" <tr>\n",
" \n",
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> distributed.LocalCluster</td>\n",
" \n",
" </tr>\n",
"\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" \n",
"\n",
" </table>\n",
"\n",
" \n",
"\n",
" \n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
" <div class=\"jp-RenderedHTMLCommon jp-RenderedHTML jp-mod-trusted jp-OutputArea-output\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\">\n",
" </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px; margin-top: 0px;\">LocalCluster</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">ae40b791</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 4\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 8\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 16.00 GiB\n",
" </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <td style=\"text-align: left;\"><strong>Status:</strong> running</td>\n",
" <td style=\"text-align: left;\"><strong>Using processes:</strong> True</td>\n",
"</tr>\n",
"\n",
" \n",
" </table>\n",
"\n",
" <details>\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Scheduler Info</h3>\n",
" </summary>\n",
"\n",
" <div style=\"\">\n",
" <div>\n",
" <div style=\"width: 24px; height: 24px; background-color: #FFF7E5; border: 3px solid #FF6132; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <h3 style=\"margin-bottom: 0px;\">Scheduler</h3>\n",
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Scheduler-3e89a818-28d5-4934-a238-3e67c980177d</p>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm:</strong> tcp://127.0.0.1:49556\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Workers:</strong> 4\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard:</strong> <a href=\"http://127.0.0.1:8787/status\" target=\"_blank\">http://127.0.0.1:8787/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads:</strong> 8\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Started:</strong> Just now\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total memory:</strong> 16.00 GiB\n",
" </td>\n",
" </tr>\n",
" </table>\n",
" </div>\n",
" </div>\n",
"\n",
" <details style=\"margin-left: 48px;\">\n",
" <summary style=\"margin-bottom: 20px;\">\n",
" <h3 style=\"display: inline;\">Workers</h3>\n",
" </summary>\n",
"\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 0</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:49567\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 2\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:49570/status\" target=\"_blank\">http://127.0.0.1:49570/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 4.00 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:49560\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> /var/folders/82/phlx_f6j5518qtvpm4x0_0fm0000gq/T/dask-worker-space/worker-r6ympopg\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 1</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:49569\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 2\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:49574/status\" target=\"_blank\">http://127.0.0.1:49574/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 4.00 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:49562\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> /var/folders/82/phlx_f6j5518qtvpm4x0_0fm0000gq/T/dask-worker-space/worker-43xh1200\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 2</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:49568\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 2\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:49573/status\" target=\"_blank\">http://127.0.0.1:49573/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 4.00 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:49559\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> /var/folders/82/phlx_f6j5518qtvpm4x0_0fm0000gq/T/dask-worker-space/worker-itd2zq7g\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
" <div style=\"margin-bottom: 20px;\">\n",
" <div style=\"width: 24px; height: 24px; background-color: #DBF5FF; border: 3px solid #4CC9FF; border-radius: 5px; position: absolute;\"> </div>\n",
" <div style=\"margin-left: 48px;\">\n",
" <details>\n",
" <summary>\n",
" <h4 style=\"margin-bottom: 0px; display: inline;\">Worker: 3</h4>\n",
" </summary>\n",
" <table style=\"width: 100%; text-align: left;\">\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Comm: </strong> tcp://127.0.0.1:49572\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Total threads: </strong> 2\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Dashboard: </strong> <a href=\"http://127.0.0.1:49577/status\" target=\"_blank\">http://127.0.0.1:49577/status</a>\n",
" </td>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Memory: </strong> 4.00 GiB\n",
" </td>\n",
" </tr>\n",
" <tr>\n",
" <td style=\"text-align: left;\">\n",
" <strong>Nanny: </strong> tcp://127.0.0.1:49561\n",
" </td>\n",
" <td style=\"text-align: left;\"></td>\n",
" </tr>\n",
" <tr>\n",
" <td colspan=\"2\" style=\"text-align: left;\">\n",
" <strong>Local directory: </strong> /var/folders/82/phlx_f6j5518qtvpm4x0_0fm0000gq/T/dask-worker-space/worker-xp52czac\n",
" </td>\n",
" </tr>\n",
"\n",
" \n",
"\n",
" \n",
"\n",
" </table>\n",
" </details>\n",
" </div>\n",
" </div>\n",
" \n",
"\n",
" </details>\n",
"</div>\n",
"\n",
" </details>\n",
" </div>\n",
"</div>\n",
" </details>\n",
" \n",
"\n",
" </div>\n",
"</div>"
],
"text/plain": [
"<Client: 'tcp://127.0.0.1:49556' processes=4 threads=8, memory=16.00 GiB>"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from dask.distributed import Client\n",
"client = Client() # start distributed scheduler locally.\n",
"client"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "d19ccea6",
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"/Volumes/GENEVIEVE/Projects/empanada/oocyte/predictions/oocyte-sem2-rebinned2x2median_OocyteMacFinetunedModel-Mac.zarr/mito\n"
]
}
],
"source": [
"# Downsample mito labels for futher analysis\n",
"\n",
"directory = \"/Volumes/GENEVIEVE/Projects/empanada/oocyte/predictions/\"\n",
"# must include /mito path *inside* the zarr container\n",
"filename = os.path.join(directory, \"oocyte-sem2-rebinned2x2median_OocyteMacFinetunedModel-Mac.zarr/mito\")\n",
"filename = pathlib.Path(filename) # must be a pathlib Path\n",
"\n",
"print(filename)\n",
"assert os.path.exists(filename)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "c1013f5d",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 35.71 GiB </td>\n",
" <td> 64.00 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (1165, 2355, 3494) </td>\n",
" <td> (256, 256, 256) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 700 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> int32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"205\" height=\"156\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"8\" x2=\"35\" y2=\"34\" />\n",
" <line x1=\"10\" y1=\"17\" x2=\"35\" y2=\"43\" />\n",
" <line x1=\"10\" y1=\"26\" x2=\"35\" y2=\"52\" />\n",
" <line x1=\"10\" y1=\"35\" x2=\"35\" y2=\"60\" />\n",
" <line x1=\"10\" y1=\"43\" x2=\"35\" y2=\"69\" />\n",
" <line x1=\"10\" y1=\"52\" x2=\"35\" y2=\"78\" />\n",
" <line x1=\"10\" y1=\"61\" x2=\"35\" y2=\"87\" />\n",
" <line x1=\"10\" y1=\"70\" x2=\"35\" y2=\"96\" />\n",
" <line x1=\"10\" y1=\"79\" x2=\"35\" y2=\"104\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"80\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"86\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"92\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"97\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"103\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.815723019803514,25.815723019803514 35.815723019803514,106.69723418179551 10.0,80.881511161992\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"135\" y2=\"5\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"141\" y2=\"11\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"18\" y1=\"0\" x2=\"44\" y2=\"25\" />\n",
" <line x1=\"27\" y1=\"0\" x2=\"53\" y2=\"25\" />\n",
" <line x1=\"36\" y1=\"0\" x2=\"62\" y2=\"25\" />\n",
" <line x1=\"45\" y1=\"0\" x2=\"70\" y2=\"25\" />\n",
" <line x1=\"53\" y1=\"0\" x2=\"79\" y2=\"25\" />\n",
" <line x1=\"62\" y1=\"0\" x2=\"88\" y2=\"25\" />\n",
" <line x1=\"71\" y1=\"0\" x2=\"97\" y2=\"25\" />\n",
" <line x1=\"80\" y1=\"0\" x2=\"106\" y2=\"25\" />\n",
" <line x1=\"89\" y1=\"0\" x2=\"114\" y2=\"25\" />\n",
" <line x1=\"97\" y1=\"0\" x2=\"123\" y2=\"25\" />\n",
" <line x1=\"106\" y1=\"0\" x2=\"132\" y2=\"25\" />\n",
" <line x1=\"115\" y1=\"0\" x2=\"141\" y2=\"25\" />\n",
" <line x1=\"124\" y1=\"0\" x2=\"150\" y2=\"25\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 130.0,0.0 155.8157230198035,25.815723019803514 35.815723019803514,25.815723019803514\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"34\" x2=\"155\" y2=\"34\" />\n",
" <line x1=\"35\" y1=\"43\" x2=\"155\" y2=\"43\" />\n",
" <line x1=\"35\" y1=\"52\" x2=\"155\" y2=\"52\" />\n",
" <line x1=\"35\" y1=\"60\" x2=\"155\" y2=\"60\" />\n",
" <line x1=\"35\" y1=\"69\" x2=\"155\" y2=\"69\" />\n",
" <line x1=\"35\" y1=\"78\" x2=\"155\" y2=\"78\" />\n",
" <line x1=\"35\" y1=\"87\" x2=\"155\" y2=\"87\" />\n",
" <line x1=\"35\" y1=\"96\" x2=\"155\" y2=\"96\" />\n",
" <line x1=\"35\" y1=\"104\" x2=\"155\" y2=\"104\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
" <line x1=\"44\" y1=\"25\" x2=\"44\" y2=\"106\" />\n",
" <line x1=\"53\" y1=\"25\" x2=\"53\" y2=\"106\" />\n",
" <line x1=\"62\" y1=\"25\" x2=\"62\" y2=\"106\" />\n",
" <line x1=\"70\" y1=\"25\" x2=\"70\" y2=\"106\" />\n",
" <line x1=\"79\" y1=\"25\" x2=\"79\" y2=\"106\" />\n",
" <line x1=\"88\" y1=\"25\" x2=\"88\" y2=\"106\" />\n",
" <line x1=\"97\" y1=\"25\" x2=\"97\" y2=\"106\" />\n",
" <line x1=\"106\" y1=\"25\" x2=\"106\" y2=\"106\" />\n",
" <line x1=\"114\" y1=\"25\" x2=\"114\" y2=\"106\" />\n",
" <line x1=\"123\" y1=\"25\" x2=\"123\" y2=\"106\" />\n",
" <line x1=\"132\" y1=\"25\" x2=\"132\" y2=\"106\" />\n",
" <line x1=\"141\" y1=\"25\" x2=\"141\" y2=\"106\" />\n",
" <line x1=\"150\" y1=\"25\" x2=\"150\" y2=\"106\" />\n",
" <line x1=\"155\" y1=\"25\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"35.815723019803514,25.815723019803514 155.8157230198035,25.815723019803514 155.8157230198035,106.69723418179551 35.815723019803514,106.69723418179551\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"95.815723\" y=\"126.697234\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3494</text>\n",
" <text x=\"175.815723\" y=\"66.256479\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,175.815723,66.256479)\">2355</text>\n",
" <text x=\"12.907862\" y=\"113.789373\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.907862,113.789373)\">1165</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"dask.array<from-zarr, shape=(1165, 2355, 3494), dtype=int32, chunksize=(256, 256, 256), chunktype=numpy.ndarray>"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"image = da.from_zarr(filename)\n",
"# Chunks are a bit small for us right now\n",
"image = da.rechunk(image, chunks='auto')\n",
"image"
]
},
{
"cell_type": "code",
"execution_count": 99,
"id": "9589d0d2",
"metadata": {},
"outputs": [],
"source": [
"# # numpy doesn't have its own mode function\n",
"# def mode(array, **kwargs):\n",
"# vals, counts = np.unique(array, return_counts=True)\n",
"# mode_value = np.argmax(counts)\n",
"# # tie breaker chooses the highest integer value\n",
"# # else we'd return zeros even when fully half the pixels are labelled\n",
"# mode_value = vals[int(np.argwhere(counts == max(counts))[-1])]\n",
"# expand_axes = tuple(range(image.ndim))\n",
"# result = np.expand_dims(np.array(mode_value), expand_axes)\n",
"# return result\n"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "b520959d",
"metadata": {},
"outputs": [],
"source": [
"# numpy doesn't have its own mode function\n",
"def mode(array, **kwargs):\n",
" vals, counts = np.unique(array, return_counts=True)\n",
" mode_value = np.argmax(counts)\n",
" # tie breaker chooses the lowest integer (zero, in most cases)\n",
" mode_value = vals[np.argmax(counts)]\n",
" expand_axes = tuple(range(image.ndim))\n",
" result = np.expand_dims(np.array(mode_value), expand_axes).astype(array.dtype)\n",
" return result"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "6eb9ab23",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<class 'numpy.ndarray'>\n",
"int32\n",
"[[[0]]]\n"
]
}
],
"source": [
"# demo\n",
"arr = np.array([\n",
" [2,2,0],\n",
" [2,0,0],\n",
" [2,0,3]\n",
"]).astype(np.int32)\n",
"\n",
"test_result = mode(arr) # tie between 0 and 2, broken by highest label value\n",
"print(type(test_result))\n",
"print(test_result.dtype)\n",
"print(test_result)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "6b3281db",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"previous shape: (1165, 2355, 3494)\n",
"Previous image dtype: int32 \n",
"\n",
"downsampled2 shape: (291, 588, 873)\n",
"downsampled dtype: int32\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 569.83 MiB </td>\n",
" <td> 1.00 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (291, 588, 873) </td>\n",
" <td> (64, 64, 64) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 990 chunks in 4 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> int32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"205\" height=\"156\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"8\" x2=\"35\" y2=\"34\" />\n",
" <line x1=\"10\" y1=\"17\" x2=\"35\" y2=\"43\" />\n",
" <line x1=\"10\" y1=\"26\" x2=\"35\" y2=\"52\" />\n",
" <line x1=\"10\" y1=\"35\" x2=\"35\" y2=\"61\" />\n",
" <line x1=\"10\" y1=\"43\" x2=\"35\" y2=\"69\" />\n",
" <line x1=\"10\" y1=\"52\" x2=\"35\" y2=\"78\" />\n",
" <line x1=\"10\" y1=\"61\" x2=\"35\" y2=\"87\" />\n",
" <line x1=\"10\" y1=\"70\" x2=\"35\" y2=\"96\" />\n",
" <line x1=\"10\" y1=\"79\" x2=\"35\" y2=\"104\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"80\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"86\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"92\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"97\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"103\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.815196768886864,25.81519676888686 35.815196768886864,106.6399390369281 10.0,80.82474226804123\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"135\" y2=\"5\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"141\" y2=\"11\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"18\" y1=\"0\" x2=\"44\" y2=\"25\" />\n",
" <line x1=\"27\" y1=\"0\" x2=\"53\" y2=\"25\" />\n",
" <line x1=\"36\" y1=\"0\" x2=\"62\" y2=\"25\" />\n",
" <line x1=\"45\" y1=\"0\" x2=\"71\" y2=\"25\" />\n",
" <line x1=\"53\" y1=\"0\" x2=\"79\" y2=\"25\" />\n",
" <line x1=\"62\" y1=\"0\" x2=\"88\" y2=\"25\" />\n",
" <line x1=\"71\" y1=\"0\" x2=\"97\" y2=\"25\" />\n",
" <line x1=\"80\" y1=\"0\" x2=\"106\" y2=\"25\" />\n",
" <line x1=\"89\" y1=\"0\" x2=\"114\" y2=\"25\" />\n",
" <line x1=\"97\" y1=\"0\" x2=\"123\" y2=\"25\" />\n",
" <line x1=\"106\" y1=\"0\" x2=\"132\" y2=\"25\" />\n",
" <line x1=\"115\" y1=\"0\" x2=\"141\" y2=\"25\" />\n",
" <line x1=\"124\" y1=\"0\" x2=\"150\" y2=\"25\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"155\" y2=\"25\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 130.0,0.0 155.81519676888686,25.81519676888686 35.815196768886864,25.81519676888686\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"34\" x2=\"155\" y2=\"34\" />\n",
" <line x1=\"35\" y1=\"43\" x2=\"155\" y2=\"43\" />\n",
" <line x1=\"35\" y1=\"52\" x2=\"155\" y2=\"52\" />\n",
" <line x1=\"35\" y1=\"61\" x2=\"155\" y2=\"61\" />\n",
" <line x1=\"35\" y1=\"69\" x2=\"155\" y2=\"69\" />\n",
" <line x1=\"35\" y1=\"78\" x2=\"155\" y2=\"78\" />\n",
" <line x1=\"35\" y1=\"87\" x2=\"155\" y2=\"87\" />\n",
" <line x1=\"35\" y1=\"96\" x2=\"155\" y2=\"96\" />\n",
" <line x1=\"35\" y1=\"104\" x2=\"155\" y2=\"104\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
" <line x1=\"44\" y1=\"25\" x2=\"44\" y2=\"106\" />\n",
" <line x1=\"53\" y1=\"25\" x2=\"53\" y2=\"106\" />\n",
" <line x1=\"62\" y1=\"25\" x2=\"62\" y2=\"106\" />\n",
" <line x1=\"71\" y1=\"25\" x2=\"71\" y2=\"106\" />\n",
" <line x1=\"79\" y1=\"25\" x2=\"79\" y2=\"106\" />\n",
" <line x1=\"88\" y1=\"25\" x2=\"88\" y2=\"106\" />\n",
" <line x1=\"97\" y1=\"25\" x2=\"97\" y2=\"106\" />\n",
" <line x1=\"106\" y1=\"25\" x2=\"106\" y2=\"106\" />\n",
" <line x1=\"114\" y1=\"25\" x2=\"114\" y2=\"106\" />\n",
" <line x1=\"123\" y1=\"25\" x2=\"123\" y2=\"106\" />\n",
" <line x1=\"132\" y1=\"25\" x2=\"132\" y2=\"106\" />\n",
" <line x1=\"141\" y1=\"25\" x2=\"141\" y2=\"106\" />\n",
" <line x1=\"150\" y1=\"25\" x2=\"150\" y2=\"106\" />\n",
" <line x1=\"155\" y1=\"25\" x2=\"155\" y2=\"106\" />\n",
" <line x1=\"155\" y1=\"25\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"35.815196768886864,25.81519676888686 155.81519676888686,25.81519676888686 155.81519676888686,106.6399390369281 35.815196768886864,106.6399390369281\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"95.815197\" y=\"126.639939\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >873</text>\n",
" <text x=\"175.815197\" y=\"66.227568\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,175.815197,66.227568)\">588</text>\n",
" <text x=\"12.907598\" y=\"113.732341\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.907598,113.732341)\">291</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"dask.array<coarsen, shape=(291, 588, 873), dtype=int32, chunksize=(64, 64, 64), chunktype=numpy.ndarray>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Downsampling by a factor of 4\n",
"# This will give us an effective 2nm voxel size\n",
"downsample_factor = 4\n",
"axes = {0: downsample_factor, 1: downsample_factor, 2: downsample_factor}\n",
"print(\"previous shape:\", image.shape) # (1165, 2355, 3494)\n",
"print(\"Previous image dtype:\", image.dtype, \"\\n\")\n",
"downsampled = da.coarsen(mode, image, axes, trim_excess=True, dtype=image.dtype)\n",
"\n",
"print(\"downsampled2 shape:\", downsampled.shape)\n",
"print(\"downsampled dtype:\", downsampled.dtype)\n",
"downsampled"
]
},
{
"cell_type": "code",
"execution_count": 17,
"id": "a9b24fb9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"int32\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 569.83 MiB </td>\n",
" <td> 64.00 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (291, 588, 873) </td>\n",
" <td> (256, 256, 256) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 24 chunks in 5 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> int32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"205\" height=\"156\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"35\" x2=\"35\" y2=\"61\" />\n",
" <line x1=\"10\" y1=\"70\" x2=\"35\" y2=\"96\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"80\" style=\"stroke-width:2\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"103\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.815196768886864,25.81519676888686 35.815196768886864,106.6399390369281 10.0,80.82474226804123\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"45\" y1=\"0\" x2=\"71\" y2=\"25\" />\n",
" <line x1=\"80\" y1=\"0\" x2=\"106\" y2=\"25\" />\n",
" <line x1=\"115\" y1=\"0\" x2=\"141\" y2=\"25\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 130.0,0.0 155.81519676888686,25.81519676888686 35.815196768886864,25.81519676888686\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"61\" x2=\"155\" y2=\"61\" />\n",
" <line x1=\"35\" y1=\"96\" x2=\"155\" y2=\"96\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
" <line x1=\"71\" y1=\"25\" x2=\"71\" y2=\"106\" />\n",
" <line x1=\"106\" y1=\"25\" x2=\"106\" y2=\"106\" />\n",
" <line x1=\"141\" y1=\"25\" x2=\"141\" y2=\"106\" />\n",
" <line x1=\"155\" y1=\"25\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"35.815196768886864,25.81519676888686 155.81519676888686,25.81519676888686 155.81519676888686,106.6399390369281 35.815196768886864,106.6399390369281\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"95.815197\" y=\"126.639939\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >873</text>\n",
" <text x=\"175.815197\" y=\"66.227568\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,175.815197,66.227568)\">588</text>\n",
" <text x=\"12.907598\" y=\"113.732341\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.907598,113.732341)\">291</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"dask.array<rechunk-merge, shape=(291, 588, 873), dtype=int32, chunksize=(256, 256, 256), chunktype=numpy.ndarray>"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# rechunk the downsampled volume\n",
"mito_labels = downsampled.rechunk(chunks=(image.chunksize))\n",
"mito_labels = mito_labels.astype(image.dtype)\n",
"print(mito_labels.dtype)\n",
"mito_labels"
]
},
{
"cell_type": "code",
"execution_count": 19,
"id": "e3470e90",
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-01-12 14:02:27,077 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-store-map-af7bf65f8986dadc90be9489a71d0758', 1, 2, 3)\n",
"Function: execute_task\n",
"args: ((<function store_chunk at 0x123483c10>, (<function concatenate3 at 0x1234848b0>, [[[array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)]]]), <zarr.core.Array (291, 588, 873) int32>, (slice(256, 291, None), slice(512, 588, None), slice(768, 873, None)), False, False))\n",
"kwargs: {}\n",
"Exception: 'ValueError(\"parameter \\'value\\': expected array with shape (35, 76, 105), got (1, 2, 2)\")'\n",
"\n",
"2023-01-12 14:02:27,127 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-store-map-af7bf65f8986dadc90be9489a71d0758', 1, 0, 3)\n",
"Function: execute_task\n",
"args: ((<function store_chunk at 0x10e853c10>, (<function concatenate3 at 0x10e8548b0>, [[[array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)]]]), <zarr.core.Array (291, 588, 873) int32>, (slice(256, 291, None), slice(0, 256, None), slice(768, 873, None)), False, False))\n",
"kwargs: {}\n",
"Exception: 'ValueError(\"parameter \\'value\\': expected array with shape (35, 256, 105), got (1, 4, 2)\")'\n",
"\n",
"2023-01-12 14:02:27,196 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-store-map-af7bf65f8986dadc90be9489a71d0758', 1, 1, 3)\n",
"Function: execute_task\n",
"args: ((<function store_chunk at 0x123e84c10>, (<function concatenate3 at 0x123e858b0>, [[[array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)], [array([[[0]]], dtype=int32), array([[[0]]], dtype=int32)]]]), <zarr.core.Array (291, 588, 873) int32>, (slice(256, 291, None), slice(256, 512, None), slice(768, 873, None)), False, False))\n",
"kwargs: {}\n",
"Exception: 'ValueError(\"parameter \\'value\\': expected array with shape (35, 256, 105), got (1, 4, 2)\")'\n",
"\n",
"2023-01-12 14:02:27,394 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 9).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"2023-01-12 14:02:27,395 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 9, 3).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 9, 3)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 9, 3)\"\n",
"2023-01-12 14:02:27,407 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 8).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 8)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 8)\"\n",
"2023-01-12 14:02:27,407 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 10).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 10)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 10)\"\n",
"2023-01-12 14:02:27,408 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 9, 11).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"2023-01-12 14:02:27,408 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 11).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 11)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 11)\"\n",
"2023-01-12 14:02:27,409 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 3).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 3)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-rechunk-split-rechunk-merge-rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 3)\"\n",
"2023-01-12 14:02:27,410 - distributed.worker - ERROR - Exception during execution of task ('coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 8, 2).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 2)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('rechunk-merge-a30a11fc90c1b0d4fbd9c97c6bf390a3', 4, 8, 2)\"\n"
]
},
{
"ename": "ValueError",
"evalue": "parameter 'value': expected array with shape (35, 76, 105), got (1, 2, 2)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [19]\u001b[0m, in \u001b[0;36m<cell line: 4>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m save_directory \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/Volumes/GENEVIEVE/Projects2023/OocyteProject/data-labelled/oocyte-mito-labels/\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 3\u001b[0m save_filename \u001b[38;5;241m=\u001b[39m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mjoin(save_directory, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124moocyte-mito-labels-2nmVoxels.zarr\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m----> 4\u001b[0m \u001b[43mmito_labels\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mto_zarr\u001b[49m\u001b[43m(\u001b[49m\u001b[43msave_filename\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:2926\u001b[0m, in \u001b[0;36mArray.to_zarr\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2915\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mto_zarr\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 2916\u001b[0m \u001b[38;5;124;03m\"\"\"Save array to the zarr storage format\u001b[39;00m\n\u001b[1;32m 2917\u001b[0m \n\u001b[1;32m 2918\u001b[0m \u001b[38;5;124;03m See https://zarr.readthedocs.io for details about the format.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2924\u001b[0m \u001b[38;5;124;03m dask.array.to_zarr : equivalent function\u001b[39;00m\n\u001b[1;32m 2925\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 2926\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mto_zarr\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:3694\u001b[0m, in \u001b[0;36mto_zarr\u001b[0;34m(arr, url, component, storage_options, overwrite, region, compute, return_stored, **kwargs)\u001b[0m\n\u001b[1;32m 3683\u001b[0m chunks \u001b[38;5;241m=\u001b[39m [c[\u001b[38;5;241m0\u001b[39m] \u001b[38;5;28;01mfor\u001b[39;00m c \u001b[38;5;129;01min\u001b[39;00m arr\u001b[38;5;241m.\u001b[39mchunks]\n\u001b[1;32m 3685\u001b[0m z \u001b[38;5;241m=\u001b[39m zarr\u001b[38;5;241m.\u001b[39mcreate(\n\u001b[1;32m 3686\u001b[0m shape\u001b[38;5;241m=\u001b[39marr\u001b[38;5;241m.\u001b[39mshape,\n\u001b[1;32m 3687\u001b[0m chunks\u001b[38;5;241m=\u001b[39mchunks,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3692\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[1;32m 3693\u001b[0m )\n\u001b[0;32m-> 3694\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43marr\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstore\u001b[49m\u001b[43m(\u001b[49m\u001b[43mz\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlock\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcompute\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcompute\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreturn_stored\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mreturn_stored\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:1768\u001b[0m, in \u001b[0;36mArray.store\u001b[0;34m(self, target, **kwargs)\u001b[0m\n\u001b[1;32m 1766\u001b[0m \u001b[38;5;129m@wraps\u001b[39m(store)\n\u001b[1;32m 1767\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mstore\u001b[39m(\u001b[38;5;28mself\u001b[39m, target, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m-> 1768\u001b[0m r \u001b[38;5;241m=\u001b[39m \u001b[43mstore\u001b[49m\u001b[43m(\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[43mtarget\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1770\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mreturn_stored\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mFalse\u001b[39;00m):\n\u001b[1;32m 1771\u001b[0m r \u001b[38;5;241m=\u001b[39m r[\u001b[38;5;241m0\u001b[39m]\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:1236\u001b[0m, in \u001b[0;36mstore\u001b[0;34m(***failed resolving arguments***)\u001b[0m\n\u001b[1;32m 1234\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m compute:\n\u001b[1;32m 1235\u001b[0m store_dsk \u001b[38;5;241m=\u001b[39m HighLevelGraph(layers, dependencies)\n\u001b[0;32m-> 1236\u001b[0m \u001b[43mcompute_as_if_collection\u001b[49m\u001b[43m(\u001b[49m\u001b[43mArray\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstore_dsk\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmap_keys\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1237\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1239\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/base.py:342\u001b[0m, in \u001b[0;36mcompute_as_if_collection\u001b[0;34m(cls, dsk, keys, scheduler, get, **kwargs)\u001b[0m\n\u001b[1;32m 340\u001b[0m schedule \u001b[38;5;241m=\u001b[39m get_scheduler(scheduler\u001b[38;5;241m=\u001b[39mscheduler, \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mcls\u001b[39m, get\u001b[38;5;241m=\u001b[39mget)\n\u001b[1;32m 341\u001b[0m dsk2 \u001b[38;5;241m=\u001b[39m optimization_function(\u001b[38;5;28mcls\u001b[39m)(dsk, keys, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 342\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mschedule\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdsk2\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeys\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:3122\u001b[0m, in \u001b[0;36mClient.get\u001b[0;34m(self, dsk, keys, workers, allow_other_workers, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)\u001b[0m\n\u001b[1;32m 3120\u001b[0m should_rejoin \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[1;32m 3121\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 3122\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgather\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpacked\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3123\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 3124\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m futures\u001b[38;5;241m.\u001b[39mvalues():\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:2291\u001b[0m, in \u001b[0;36mClient.gather\u001b[0;34m(self, futures, errors, direct, asynchronous)\u001b[0m\n\u001b[1;32m 2289\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2290\u001b[0m local_worker \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 2291\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2292\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_gather\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2293\u001b[0m \u001b[43m \u001b[49m\u001b[43mfutures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2294\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2295\u001b[0m \u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2296\u001b[0m \u001b[43m \u001b[49m\u001b[43mlocal_worker\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlocal_worker\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2297\u001b[0m \u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2298\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:339\u001b[0m, in \u001b[0;36mSyncMethodMixin.sync\u001b[0;34m(self, func, asynchronous, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 337\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m future\n\u001b[1;32m 338\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 339\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 340\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallback_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcallback_timeout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\n\u001b[1;32m 341\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:406\u001b[0m, in \u001b[0;36msync\u001b[0;34m(loop, func, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 404\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m error:\n\u001b[1;32m 405\u001b[0m typ, exc, tb \u001b[38;5;241m=\u001b[39m error\n\u001b[0;32m--> 406\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mwith_traceback(tb)\n\u001b[1;32m 407\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 408\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:379\u001b[0m, in \u001b[0;36msync.<locals>.f\u001b[0;34m()\u001b[0m\n\u001b[1;32m 377\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mwait_for(future, callback_timeout)\n\u001b[1;32m 378\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mensure_future(future)\n\u001b[0;32m--> 379\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m future\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 381\u001b[0m error \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/tornado/gen.py:762\u001b[0m, in \u001b[0;36mRunner.run\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 759\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 761\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 762\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 763\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 764\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:2154\u001b[0m, in \u001b[0;36mClient._gather\u001b[0;34m(self, futures, errors, direct, local_worker)\u001b[0m\n\u001b[1;32m 2152\u001b[0m exc \u001b[38;5;241m=\u001b[39m CancelledError(key)\n\u001b[1;32m 2153\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 2154\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exception\u001b[38;5;241m.\u001b[39mwith_traceback(traceback)\n\u001b[1;32m 2155\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[1;32m 2156\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m errors \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mskip\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:4366\u001b[0m, in \u001b[0;36mstore_chunk\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4363\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mstore_chunk\u001b[39m(\n\u001b[1;32m 4364\u001b[0m x: ArrayLike, out: ArrayLike, index: \u001b[38;5;28mslice\u001b[39m, lock: Any, return_stored: \u001b[38;5;28mbool\u001b[39m\n\u001b[1;32m 4365\u001b[0m ):\n\u001b[0;32m-> 4366\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m load_store_chunk(x, out, index, lock, return_stored, \u001b[38;5;28;01mFalse\u001b[39;00m)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:4348\u001b[0m, in \u001b[0;36mload_store_chunk\u001b[0;34m()\u001b[0m\n\u001b[1;32m 4346\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m x \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 4347\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m is_arraylike(x):\n\u001b[0;32m-> 4348\u001b[0m out[index] \u001b[38;5;241m=\u001b[39m x\n\u001b[1;32m 4349\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 4350\u001b[0m out[index] \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39masanyarray(x)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zarr/core.py:1373\u001b[0m, in \u001b[0;36m__setitem__\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1371\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvindex[selection] \u001b[38;5;241m=\u001b[39m value\n\u001b[1;32m 1372\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1373\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_basic_selection(pure_selection, value, fields\u001b[38;5;241m=\u001b[39mfields)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zarr/core.py:1468\u001b[0m, in \u001b[0;36mset_basic_selection\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1466\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_set_basic_selection_zd(selection, value, fields\u001b[38;5;241m=\u001b[39mfields)\n\u001b[1;32m 1467\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1468\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_set_basic_selection_nd(selection, value, fields\u001b[38;5;241m=\u001b[39mfields)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zarr/core.py:1772\u001b[0m, in \u001b[0;36m_set_basic_selection_nd\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1766\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_set_basic_selection_nd\u001b[39m(\u001b[38;5;28mself\u001b[39m, selection, value, fields\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[1;32m 1767\u001b[0m \u001b[38;5;66;03m# implementation of __setitem__ for array with at least one dimension\u001b[39;00m\n\u001b[1;32m 1768\u001b[0m \n\u001b[1;32m 1769\u001b[0m \u001b[38;5;66;03m# setup indexer\u001b[39;00m\n\u001b[1;32m 1770\u001b[0m indexer \u001b[38;5;241m=\u001b[39m BasicIndexer(selection, \u001b[38;5;28mself\u001b[39m)\n\u001b[0;32m-> 1772\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_set_selection(indexer, value, fields\u001b[38;5;241m=\u001b[39mfields)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zarr/core.py:1800\u001b[0m, in \u001b[0;36m_set_selection\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1798\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(value, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mshape\u001b[39m\u001b[38;5;124m'\u001b[39m):\n\u001b[1;32m 1799\u001b[0m value \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39masanyarray(value, like\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_meta_array)\n\u001b[0;32m-> 1800\u001b[0m check_array_shape(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalue\u001b[39m\u001b[38;5;124m'\u001b[39m, value, sel_shape)\n\u001b[1;32m 1802\u001b[0m \u001b[38;5;66;03m# iterate over chunks in range\u001b[39;00m\n\u001b[1;32m 1803\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mhasattr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstore, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msetitems\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_synchronizer \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \\\n\u001b[1;32m 1804\u001b[0m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28many\u001b[39m(\u001b[38;5;28mmap\u001b[39m(\u001b[38;5;28;01mlambda\u001b[39;00m x: x \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mshape)):\n\u001b[1;32m 1805\u001b[0m \u001b[38;5;66;03m# iterative approach\u001b[39;00m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zarr/util.py:547\u001b[0m, in \u001b[0;36mcheck_array_shape\u001b[0;34m()\u001b[0m\n\u001b[1;32m 544\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mparameter \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m: expected an array-like object, got \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 545\u001b[0m \u001b[38;5;241m.\u001b[39mformat(param, \u001b[38;5;28mtype\u001b[39m(array)))\n\u001b[1;32m 546\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m array\u001b[38;5;241m.\u001b[39mshape \u001b[38;5;241m!=\u001b[39m shape:\n\u001b[0;32m--> 547\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mparameter \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m: expected array with shape \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m, got \u001b[39m\u001b[38;5;132;01m{!r}\u001b[39;00m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 548\u001b[0m \u001b[38;5;241m.\u001b[39mformat(param, shape, array\u001b[38;5;241m.\u001b[39mshape))\n",
"\u001b[0;31mValueError\u001b[0m: parameter 'value': expected array with shape (35, 76, 105), got (1, 2, 2)"
]
}
],
"source": [
"# Save downsampled label dataset\n",
"save_directory = \"/Volumes/GENEVIEVE/Projects2023/OocyteProject/data-labelled/oocyte-mito-labels/\"\n",
"save_filename = os.path.join(save_directory, \"oocyte-mito-labels-2nmVoxels.zarr\")\n",
"mito_labels.to_zarr(save_filename)\n"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "346a3077",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-01-12 13:51:28,779 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 5, 6, 2)\n",
"Function: execute_task\n",
"args: ((<function apply at 0x1038fb9d0>, <function coarsen at 0x10dc34700>, [<function mode at 0x10f5a8ca0>, (<function getitem at 0x10dc34e50>, array([[[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" ...,\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]\n",
"kwargs: {}\n",
"Exception: \"ValueError('attempt to get argmax of an empty sequence')\"\n",
"\n",
"2023-01-12 13:51:28,786 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 5, 8, 8)\n",
"Function: execute_task\n",
"args: ((<function apply at 0x1051439d0>, <function coarsen at 0x117c034c0>, [<function mode at 0x130cf6f70>, (<function getitem at 0x117c03c10>, array([[[343, 343, 343, ..., 0, 0, 0],\n",
" [343, 343, 343, ..., 0, 0, 0],\n",
" [343, 343, 343, ..., 0, 0, 0],\n",
" ...,\n",
" [ 0, 0, 0, ..., 0, 0, 0],\n",
" [ 0, 0, 0, ..., 0, 0, 0],\n",
" [ 0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[343, 343, 343, ..., 0, 0, 0],\n",
" [343, 343, 343, ..., 0, 0, 0],\n",
" [343, 343, 343, ..., 0, 0, 0],\n",
" ...,\n",
" [ 0, 0, 0, ..., 0, 0, 0],\n",
" [ 0, 0, 0, ..., 0, 0, 0],\n",
" [ 0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[343, 343, 343, ..., 0, 0, 0],\n",
" [343, 343, 343, ..., 0, 0, 0],\n",
" [343, 343, 343, ..., 0, 0, 0],\n",
" ...,\n",
" [ 0, 0, 0, ..., 0, 0, 0],\n",
" [ 0, 0, 0, ..., 0, 0, 0],\n",
" [ 0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" \n",
"kwargs: {}\n",
"Exception: \"ValueError('attempt to get argmax of an empty sequence')\"\n",
"\n",
"2023-01-12 13:51:28,832 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 1, 10, 1)\n",
"Function: execute_task\n",
"args: ((<function apply at 0x1059179d0>, <function coarsen at 0x123233700>, [<function mode at 0x127c78af0>, (<function getitem at 0x123233e50>, array([[[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" ...,\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]\n",
"kwargs: {}\n",
"Exception: \"ValueError('attempt to get argmax of an empty sequence')\"\n",
"\n",
"2023-01-12 13:51:28,871 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 5, 1, 2)\n",
"Function: execute_task\n",
"args: ((<function apply at 0x1058679d0>, <function coarsen at 0x122833700>, [<function mode at 0x12428d310>, (<function getitem at 0x122833e50>, array([[[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" ...,\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]\n",
"kwargs: {}\n",
"Exception: \"ValueError('attempt to get argmax of an empty sequence')\"\n",
"\n",
"2023-01-12 13:51:28,878 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 5, 3, 0)\n",
"Function: execute_task\n",
"args: ((<function apply at 0x1058679d0>, <function coarsen at 0x122833700>, [<function mode at 0x124326700>, (<function getitem at 0x122833e50>, array([[[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" ...,\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]\n",
"kwargs: {}\n",
"Exception: \"ValueError('attempt to get argmax of an empty sequence')\"\n",
"\n",
"2023-01-12 13:51:28,929 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 5, 1, 6)\n",
"Function: execute_task\n",
"args: ((<function apply at 0x1038fb9d0>, <function coarsen at 0x10dc34700>, [<function mode at 0x10f5d6ee0>, (<function getitem at 0x10dc34e50>, array([[[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]],\n",
"\n",
" ...,\n",
"\n",
" [[0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" ...,\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0],\n",
" [0, 0, 0, ..., 0, 0, 0]\n",
"kwargs: {}\n",
"Exception: \"ValueError('attempt to get argmax of an empty sequence')\"\n",
"\n",
"2023-01-12 13:51:29,089 - distributed.worker - ERROR - Exception during execution of task ('coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 6, 2).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 6, 2)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 6, 2)\"\n",
"2023-01-12 13:51:29,089 - distributed.worker - ERROR - Exception during execution of task ('coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 1, 2).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 1, 2)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 1, 2)\"\n",
"2023-01-12 13:51:29,091 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-06659c57bc95b31caf432efd69ce8550', 3, 9, 3).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"2023-01-12 13:51:29,091 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-06659c57bc95b31caf432efd69ce8550', 4, 6, 7).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"2023-01-12 13:51:29,094 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 4, 3, 1).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-06659c57bc95b31caf432efd69ce8550', 4, 3, 1)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-06659c57bc95b31caf432efd69ce8550', 4, 3, 1)\"\n",
"2023-01-12 13:51:29,095 - distributed.worker - ERROR - Exception during execution of task ('rechunk-merge-rechunk-split-coarsen-fcfa589673e00a147db4ced802ce1c2a', 5, 3, 1).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('from-zarr-06659c57bc95b31caf432efd69ce8550', 4, 3, 1)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('from-zarr-06659c57bc95b31caf432efd69ce8550', 4, 3, 1)\"\n",
"2023-01-12 13:51:29,096 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-06659c57bc95b31caf432efd69ce8550', 0, 9, 5).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"2023-01-12 13:51:29,097 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-06659c57bc95b31caf432efd69ce8550', 4, 1, 8).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-06659c57bc95b31caf432efd69ce8550'\n"
]
},
{
"ename": "ValueError",
"evalue": "attempt to get argmax of an empty sequence",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [14]\u001b[0m, in \u001b[0;36m<cell line: 2>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# move dataset to in memory\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m mito_labels \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43masarray\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdownsampled\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;28mtype\u001b[39m(mito_labels))\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28mprint\u001b[39m(mito_labels\u001b[38;5;241m.\u001b[39mshape)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:1700\u001b[0m, in \u001b[0;36mArray.__array__\u001b[0;34m(self, dtype, **kwargs)\u001b[0m\n\u001b[1;32m 1699\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__array__\u001b[39m(\u001b[38;5;28mself\u001b[39m, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m-> 1700\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1701\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m dtype \u001b[38;5;129;01mand\u001b[39;00m x\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m!=\u001b[39m dtype:\n\u001b[1;32m 1702\u001b[0m x \u001b[38;5;241m=\u001b[39m x\u001b[38;5;241m.\u001b[39mastype(dtype)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/base.py:315\u001b[0m, in \u001b[0;36mDaskMethodsMixin.compute\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 291\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcompute\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 292\u001b[0m \u001b[38;5;124;03m\"\"\"Compute this dask collection\u001b[39;00m\n\u001b[1;32m 293\u001b[0m \n\u001b[1;32m 294\u001b[0m \u001b[38;5;124;03m This turns a lazy Dask collection into its in-memory equivalent.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 313\u001b[0m \u001b[38;5;124;03m dask.base.compute\u001b[39;00m\n\u001b[1;32m 314\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 315\u001b[0m (result,) \u001b[38;5;241m=\u001b[39m \u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtraverse\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 316\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/base.py:600\u001b[0m, in \u001b[0;36mcompute\u001b[0;34m(traverse, optimize_graph, scheduler, get, *args, **kwargs)\u001b[0m\n\u001b[1;32m 597\u001b[0m keys\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_keys__())\n\u001b[1;32m 598\u001b[0m postcomputes\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_postcompute__())\n\u001b[0;32m--> 600\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[43mschedule\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdsk\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeys\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 601\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m repack([f(r, \u001b[38;5;241m*\u001b[39ma) \u001b[38;5;28;01mfor\u001b[39;00m r, (f, a) \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(results, postcomputes)])\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:3122\u001b[0m, in \u001b[0;36mClient.get\u001b[0;34m(self, dsk, keys, workers, allow_other_workers, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)\u001b[0m\n\u001b[1;32m 3120\u001b[0m should_rejoin \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[1;32m 3121\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 3122\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgather\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpacked\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3123\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 3124\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m futures\u001b[38;5;241m.\u001b[39mvalues():\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:2291\u001b[0m, in \u001b[0;36mClient.gather\u001b[0;34m(self, futures, errors, direct, asynchronous)\u001b[0m\n\u001b[1;32m 2289\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2290\u001b[0m local_worker \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 2291\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2292\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_gather\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2293\u001b[0m \u001b[43m \u001b[49m\u001b[43mfutures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2294\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2295\u001b[0m \u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2296\u001b[0m \u001b[43m \u001b[49m\u001b[43mlocal_worker\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlocal_worker\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2297\u001b[0m \u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2298\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:339\u001b[0m, in \u001b[0;36mSyncMethodMixin.sync\u001b[0;34m(self, func, asynchronous, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 337\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m future\n\u001b[1;32m 338\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 339\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 340\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallback_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcallback_timeout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\n\u001b[1;32m 341\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:406\u001b[0m, in \u001b[0;36msync\u001b[0;34m(loop, func, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 404\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m error:\n\u001b[1;32m 405\u001b[0m typ, exc, tb \u001b[38;5;241m=\u001b[39m error\n\u001b[0;32m--> 406\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mwith_traceback(tb)\n\u001b[1;32m 407\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 408\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:379\u001b[0m, in \u001b[0;36msync.<locals>.f\u001b[0;34m()\u001b[0m\n\u001b[1;32m 377\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mwait_for(future, callback_timeout)\n\u001b[1;32m 378\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mensure_future(future)\n\u001b[0;32m--> 379\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m future\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 381\u001b[0m error \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/tornado/gen.py:762\u001b[0m, in \u001b[0;36mRunner.run\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 759\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 761\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 762\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 763\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 764\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:2154\u001b[0m, in \u001b[0;36mClient._gather\u001b[0;34m(self, futures, errors, direct, local_worker)\u001b[0m\n\u001b[1;32m 2152\u001b[0m exc \u001b[38;5;241m=\u001b[39m CancelledError(key)\n\u001b[1;32m 2153\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 2154\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exception\u001b[38;5;241m.\u001b[39mwith_traceback(traceback)\n\u001b[1;32m 2155\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[1;32m 2156\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m errors \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mskip\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/utils.py:71\u001b[0m, in \u001b[0;36mapply\u001b[0;34m()\u001b[0m\n\u001b[1;32m 40\u001b[0m \u001b[38;5;124;03m\"\"\"Apply a function given its positional and keyword arguments.\u001b[39;00m\n\u001b[1;32m 41\u001b[0m \n\u001b[1;32m 42\u001b[0m \u001b[38;5;124;03mEquivalent to ``func(*args, **kwargs)``\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 68\u001b[0m \u001b[38;5;124;03m>>> dsk = {'task-name': task} # adds the task to a low level Dask task graph\u001b[39;00m\n\u001b[1;32m 69\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 70\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m kwargs:\n\u001b[0;32m---> 71\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[1;32m 72\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 73\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/chunk.py:136\u001b[0m, in \u001b[0;36mcoarsen\u001b[0;34m()\u001b[0m\n\u001b[1;32m 133\u001b[0m \u001b[38;5;66;03m# (10, 10) -> (5, 2, 5, 2)\u001b[39;00m\n\u001b[1;32m 134\u001b[0m newshape \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mtuple\u001b[39m(concat([(x\u001b[38;5;241m.\u001b[39mshape[i] \u001b[38;5;241m/\u001b[39m\u001b[38;5;241m/\u001b[39m axes[i], axes[i]) \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(x\u001b[38;5;241m.\u001b[39mndim)]))\n\u001b[0;32m--> 136\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m reduction(x\u001b[38;5;241m.\u001b[39mreshape(newshape), axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mtuple\u001b[39m(\u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m1\u001b[39m, x\u001b[38;5;241m.\u001b[39mndim \u001b[38;5;241m*\u001b[39m \u001b[38;5;241m2\u001b[39m, \u001b[38;5;241m2\u001b[39m)), \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
"Input \u001b[0;32mIn [8]\u001b[0m, in \u001b[0;36mmode\u001b[0;34m()\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmode\u001b[39m(array, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 3\u001b[0m vals, counts \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39munique(array, return_counts\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[0;32m----> 4\u001b[0m mode_value \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39margmax(counts)\n\u001b[1;32m 5\u001b[0m \u001b[38;5;66;03m# tie breaker chooses the lowest integer (zero, in most cases)\u001b[39;00m\n\u001b[1;32m 6\u001b[0m mode_value \u001b[38;5;241m=\u001b[39m vals[np\u001b[38;5;241m.\u001b[39margmax(counts)]\n",
"File \u001b[0;32m<__array_function__ internals>:180\u001b[0m, in \u001b[0;36margmax\u001b[0;34m()\u001b[0m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/numpy/core/fromnumeric.py:1216\u001b[0m, in \u001b[0;36margmax\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1129\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1130\u001b[0m \u001b[38;5;124;03mReturns the indices of the maximum values along an axis.\u001b[39;00m\n\u001b[1;32m 1131\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1213\u001b[0m \u001b[38;5;124;03m(2, 1, 4)\u001b[39;00m\n\u001b[1;32m 1214\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 1215\u001b[0m kwds \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mkeepdims\u001b[39m\u001b[38;5;124m'\u001b[39m: keepdims} \u001b[38;5;28;01mif\u001b[39;00m keepdims \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m np\u001b[38;5;241m.\u001b[39m_NoValue \u001b[38;5;28;01melse\u001b[39;00m {}\n\u001b[0;32m-> 1216\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _wrapfunc(a, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124margmax\u001b[39m\u001b[38;5;124m'\u001b[39m, axis\u001b[38;5;241m=\u001b[39maxis, out\u001b[38;5;241m=\u001b[39mout, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/numpy/core/fromnumeric.py:57\u001b[0m, in \u001b[0;36m_wrapfunc\u001b[0;34m()\u001b[0m\n\u001b[1;32m 54\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _wrapit(obj, method, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n\u001b[1;32m 56\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m---> 57\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m bound(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n\u001b[1;32m 58\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[1;32m 59\u001b[0m \u001b[38;5;66;03m# A TypeError occurs if the object does have such a method in its\u001b[39;00m\n\u001b[1;32m 60\u001b[0m \u001b[38;5;66;03m# class, but its signature is not identical to that of NumPy's. This\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 64\u001b[0m \u001b[38;5;66;03m# Call _wrapit from within the except clause to ensure a potential\u001b[39;00m\n\u001b[1;32m 65\u001b[0m \u001b[38;5;66;03m# exception has a traceback chain.\u001b[39;00m\n\u001b[1;32m 66\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _wrapit(obj, method, \u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n",
"\u001b[0;31mValueError\u001b[0m: attempt to get argmax of an empty sequence"
]
}
],
"source": [
"# move dataset to in memory\n",
"mito_labels = np.asarray(downsampled)\n",
"print(type(mito_labels))\n",
"print(mito_labels.shape)\n",
"print('Done')"
]
},
{
"cell_type": "code",
"execution_count": 104,
"id": "d7aba3a2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.image.AxesImage at 0x29ddbe790>"
]
},
"execution_count": 104,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD8CAYAAACB3pQWAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjYuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8o6BhiAAAACXBIWXMAAAsTAAALEwEAmpwYAABMvElEQVR4nO3ddXgU1/rA8e+Z2c1uEuIKBAuB4BSXCi1QF+rutL01Wur0trdy76/uSkuVKjWo0tJCvYXiLsFJSEhC3HazO3N+f+wCCVEgWQnn8zx5spmZnXl3k7x75qiQUqIoiqIEJ83fASiKoigHTyVxRVGUIKaSuKIoShBTSVxRFCWIqSSuKIoSxFQSVxRFCWI+T+JCiJOEEBuEEJuEEFN8fX1FUZS2RPiyn7gQQgcygOOBLGARcJGUcq3PglAURWlDfF0SHw5sklJukVJWAzOACT6OQVEUpc2w+Ph6HYHMGj9nASP2P0gIcR1wHYCOPiSMSN9EpyiKEoAcVFAtnaK+fb5O4vUFUac+R0o5DZgGECli5QgxrrXjUhRFCVj/yHkN7vN1dUoW0KnG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1vF86YQItyfMUkpdwJPAzuAHKBESvmjP2Oq4UBj6Oh97IvYAK7GU2L0a0xCiDOAnVLKFfvt8uf71BM4WgjxjxDiNyHEsACIaa9ATeL11R/5tC+kEKId8AUwWUpZ2tih9Wxr0ViFEKcBeVLKJc19Sj3bWvr9s+C57ZwqpRwEVOCpJvBbTN565gl4bm07AOFCiEv9GVMzNBSDz2ITQtwHuIEP/RmTECIMuA94oL7d/ojJywLEACOBu4BPvXXcfv/dQeAm8Sw89WJ7pOC5LfYJIYQVTwL/UEo507s513ubhPf7nlsqX8R6JHCGEGIbnqqlsUKID/wcUxaQJaX8x/vz53iSuj9jGg9slVLmSyldwExgtJ9j2uNAY8hiX/VGq8UmhLgCOA24xHvr78+YuuP5AF7h/VtPAZYKIZL9GBPea8yUHgvx3A3H+zmmfVqrsv1QvvB88m3B8wvd07DZ10fXFnjqsJ7fb/tT1G6YetL7uC+1Gze20EoNm97rHcu+hk2/xgT8AaR7Hz/kjcdvMQEjgDV46sIFnrrnSf6ICehK7caxA44BWISn9LenceyUFo7pJGAtkLDfcX6Lab9929jXsOnP9+l64L/exz3xVKEIX8bUaLytdeIW+Cc4BU/PkM3AfT687lF4bn1WAsu9X6cAccA8YKP3e2yN59znjXMDrdgK7b3WsexL4n6NCTgCWOx9r77Ec8vp75geBtYDq4H3vf9gPo0J+BhPnbwLT6ls4sHEAAz1vo7NwMt4R1i3YEybvAlpz9/5a/6Oab/92/AmcT+/TyHAB95rLAXG+jKmpr7UsHtFUZQgFqh14oqiKEozqCSuKIoSxFQSVxRFCWIqiSuKogQxlcQVRVGCmEriiqIoQUwlcUVRlCD2/7JTQxTvDNVzAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"plt.imshow(mito_labels[0])"
]
},
{
"cell_type": "code",
"execution_count": 111,
"id": "9a08cbcc",
"metadata": {},
"outputs": [],
"source": [
"mito_labels = mito_labels.astype(int)"
]
},
{
"cell_type": "code",
"execution_count": 112,
"id": "5c4e54e4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Labels layer 'mito_labels' at 0x29e22b5e0>"
]
},
"execution_count": 112,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"viewer.add_labels(mito_labels)"
]
},
{
"cell_type": "code",
"execution_count": 114,
"id": "1cf12152",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dask.array.core.Array"
]
},
"execution_count": 114,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(mito_labels)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8a3b61e2",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 54,
"id": "51b438c2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"previous shape: (1165, 2355, 3494)\n",
"downsampled shape: (582, 1177, 1747)\n"
]
},
{
"data": {
"text/html": [
"<table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 8.92 GiB </td>\n",
" <td> 16.00 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (582, 1177, 1747) </td>\n",
" <td> (128, 128, 128) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 924 chunks in 4 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> float64 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"205\" height=\"156\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"8\" x2=\"35\" y2=\"34\" />\n",
" <line x1=\"10\" y1=\"17\" x2=\"35\" y2=\"43\" />\n",
" <line x1=\"10\" y1=\"26\" x2=\"35\" y2=\"52\" />\n",
" <line x1=\"10\" y1=\"35\" x2=\"35\" y2=\"60\" />\n",
" <line x1=\"10\" y1=\"43\" x2=\"35\" y2=\"69\" />\n",
" <line x1=\"10\" y1=\"52\" x2=\"35\" y2=\"78\" />\n",
" <line x1=\"10\" y1=\"61\" x2=\"35\" y2=\"87\" />\n",
" <line x1=\"10\" y1=\"70\" x2=\"35\" y2=\"96\" />\n",
" <line x1=\"10\" y1=\"79\" x2=\"35\" y2=\"104\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"80\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"86\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"92\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"97\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"103\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.814143515405604,25.8141435154056 35.814143515405604,106.66131008667062 10.0,80.84716657126502\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"135\" y2=\"5\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"141\" y2=\"11\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"18\" y1=\"0\" x2=\"44\" y2=\"25\" />\n",
" <line x1=\"27\" y1=\"0\" x2=\"53\" y2=\"25\" />\n",
" <line x1=\"36\" y1=\"0\" x2=\"62\" y2=\"25\" />\n",
" <line x1=\"45\" y1=\"0\" x2=\"70\" y2=\"25\" />\n",
" <line x1=\"53\" y1=\"0\" x2=\"79\" y2=\"25\" />\n",
" <line x1=\"62\" y1=\"0\" x2=\"88\" y2=\"25\" />\n",
" <line x1=\"71\" y1=\"0\" x2=\"97\" y2=\"25\" />\n",
" <line x1=\"80\" y1=\"0\" x2=\"106\" y2=\"25\" />\n",
" <line x1=\"89\" y1=\"0\" x2=\"114\" y2=\"25\" />\n",
" <line x1=\"97\" y1=\"0\" x2=\"123\" y2=\"25\" />\n",
" <line x1=\"106\" y1=\"0\" x2=\"132\" y2=\"25\" />\n",
" <line x1=\"115\" y1=\"0\" x2=\"141\" y2=\"25\" />\n",
" <line x1=\"124\" y1=\"0\" x2=\"150\" y2=\"25\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 130.0,0.0 155.8141435154056,25.8141435154056 35.814143515405604,25.8141435154056\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"34\" x2=\"155\" y2=\"34\" />\n",
" <line x1=\"35\" y1=\"43\" x2=\"155\" y2=\"43\" />\n",
" <line x1=\"35\" y1=\"52\" x2=\"155\" y2=\"52\" />\n",
" <line x1=\"35\" y1=\"60\" x2=\"155\" y2=\"60\" />\n",
" <line x1=\"35\" y1=\"69\" x2=\"155\" y2=\"69\" />\n",
" <line x1=\"35\" y1=\"78\" x2=\"155\" y2=\"78\" />\n",
" <line x1=\"35\" y1=\"87\" x2=\"155\" y2=\"87\" />\n",
" <line x1=\"35\" y1=\"96\" x2=\"155\" y2=\"96\" />\n",
" <line x1=\"35\" y1=\"104\" x2=\"155\" y2=\"104\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
" <line x1=\"44\" y1=\"25\" x2=\"44\" y2=\"106\" />\n",
" <line x1=\"53\" y1=\"25\" x2=\"53\" y2=\"106\" />\n",
" <line x1=\"62\" y1=\"25\" x2=\"62\" y2=\"106\" />\n",
" <line x1=\"70\" y1=\"25\" x2=\"70\" y2=\"106\" />\n",
" <line x1=\"79\" y1=\"25\" x2=\"79\" y2=\"106\" />\n",
" <line x1=\"88\" y1=\"25\" x2=\"88\" y2=\"106\" />\n",
" <line x1=\"97\" y1=\"25\" x2=\"97\" y2=\"106\" />\n",
" <line x1=\"106\" y1=\"25\" x2=\"106\" y2=\"106\" />\n",
" <line x1=\"114\" y1=\"25\" x2=\"114\" y2=\"106\" />\n",
" <line x1=\"123\" y1=\"25\" x2=\"123\" y2=\"106\" />\n",
" <line x1=\"132\" y1=\"25\" x2=\"132\" y2=\"106\" />\n",
" <line x1=\"141\" y1=\"25\" x2=\"141\" y2=\"106\" />\n",
" <line x1=\"150\" y1=\"25\" x2=\"150\" y2=\"106\" />\n",
" <line x1=\"155\" y1=\"25\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"35.814143515405604,25.8141435154056 155.8141435154056,25.8141435154056 155.8141435154056,106.66131008667062 35.814143515405604,106.66131008667062\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"95.814144\" y=\"126.661310\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >1747</text>\n",
" <text x=\"175.814144\" y=\"66.237727\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,175.814144,66.237727)\">1177</text>\n",
" <text x=\"12.907072\" y=\"113.754238\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.907072,113.754238)\">582</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table>"
],
"text/plain": [
"dask.array<coarsen, shape=(582, 1177, 1747), dtype=float64, chunksize=(128, 128, 128), chunktype=numpy.ndarray>"
]
},
"execution_count": 54,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# downsample_factor = 2\n",
"# axes = {0: downsample_factor, 1: downsample_factor, 2: downsample_factor}\n",
"# print(\"previous shape:\", image.shape) # (1165, 2355, 3494)\n",
"# downsampled = da.coarsen(np.median, image, axes, trim_excess=True)\n",
"\n",
"# print(\"downsampled shape:\", downsampled.shape)\n",
"# downsampled"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "f6f1b557",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-01-12 12:45:03,112 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('getitem-70dc12bbac69c2f8e1e987a1f3664c07', 6, 12)\n",
"Function: getitem\n",
"args: (0, (0, slice(None, None, None), slice(None, None, None)))\n",
"kwargs: {}\n",
"Exception: \"ValueError('Array chunk size or shape is unknown. Possible solution with x.compute_chunk_sizes()')\"\n",
"\n",
"2023-01-12 12:45:03,207 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('getitem-70dc12bbac69c2f8e1e987a1f3664c07', 8, 2)\n",
"Function: getitem\n",
"args: (0, (0, slice(None, None, None), slice(None, None, None)))\n",
"kwargs: {}\n",
"Exception: \"ValueError('Array chunk size or shape is unknown. Possible solution with x.compute_chunk_sizes()')\"\n",
"\n",
"2023-01-12 12:45:03,300 - distributed.worker - WARNING - Compute Failed\n",
"Key: ('getitem-70dc12bbac69c2f8e1e987a1f3664c07', 3, 3)\n",
"Function: getitem\n",
"args: (0, (0, slice(None, None, None), slice(None, None, None)))\n",
"kwargs: {}\n",
"Exception: \"ValueError('Array chunk size or shape is unknown. Possible solution with x.compute_chunk_sizes()')\"\n",
"\n",
"2023-01-12 12:45:03,334 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-71d2c6010038070a3ac4b4bb63d4b660', 0, 2, 0).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"2023-01-12 12:45:03,337 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-71d2c6010038070a3ac4b4bb63d4b660', 0, 1, 2).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"2023-01-12 12:45:03,339 - distributed.worker - ERROR - Exception during execution of task ('coarsen-fe74df233005ce504eb221dbb8d0ec51', 0, 1, 4).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('rechunk-merge-efa4b07a9f738039b3875df8bbdd7c92', 0, 1, 4)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('rechunk-merge-efa4b07a9f738039b3875df8bbdd7c92', 0, 1, 4)\"\n",
"2023-01-12 12:45:03,340 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-71d2c6010038070a3ac4b4bb63d4b660', 0, 1, 5).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"2023-01-12 12:45:03,386 - distributed.worker - ERROR - Exception during execution of task ('coarsen-fe74df233005ce504eb221dbb8d0ec51', 0, 3, 0).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: \"('rechunk-merge-efa4b07a9f738039b3875df8bbdd7c92', 0, 3, 0)\"\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: \"('rechunk-merge-efa4b07a9f738039b3875df8bbdd7c92', 0, 3, 0)\"\n",
"2023-01-12 12:45:03,386 - distributed.worker - ERROR - Exception during execution of task ('from-zarr-71d2c6010038070a3ac4b4bb63d4b660', 0, 2, 8).\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2351, in _prepare_args_for_execution\n",
" data[k] = self.data[k]\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/zict/buffer.py\", line 108, in __getitem__\n",
" raise KeyError(key)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n",
"\n",
"During handling of the above exception, another exception occurred:\n",
"\n",
"Traceback (most recent call last):\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2233, in execute\n",
" args2, kwargs2 = self._prepare_args_for_execution(ts, args, kwargs)\n",
" File \"/Users/genevieb/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/worker.py\", line 2355, in _prepare_args_for_execution\n",
" data[k] = Actor(type(self.state.actors[k]), self.address, k, self)\n",
"KeyError: 'original-from-zarr-71d2c6010038070a3ac4b4bb63d4b660'\n"
]
},
{
"ename": "ValueError",
"evalue": "Array chunk size or shape is unknown. Possible solution with x.compute_chunk_sizes()",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mIndexError\u001b[0m Traceback (most recent call last)",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/chunk.py:418\u001b[0m, in \u001b[0;36mgetitem\u001b[0;34m()\u001b[0m\n\u001b[1;32m 417\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 418\u001b[0m result \u001b[38;5;241m=\u001b[39m obj[index]\n\u001b[1;32m 419\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
"\u001b[0;31mIndexError\u001b[0m: invalid index to scalar variable.",
"\nThe above exception was the direct cause of the following exception:\n",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [33]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mviewer\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43madd_labels\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdownsampled2\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/components/viewer_model.py:4\u001b[0m, in \u001b[0;36madd_labels\u001b[0;34m(self, data, num_colors, features, properties, color, seed, name, metadata, scale, translate, rotate, shear, affine, opacity, blending, rendering, depiction, visible, multiscale, cache, plane, experimental_clipping_planes)\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m__future__\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m annotations\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01minspect\u001b[39;00m\n\u001b[0;32m----> 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mitertools\u001b[39;00m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mwarnings\u001b[39;00m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/labels/labels.py:247\u001b[0m, in \u001b[0;36mLabels.__init__\u001b[0;34m(self, data, num_colors, features, properties, color, seed, name, metadata, scale, translate, rotate, shear, affine, opacity, blending, rendering, depiction, visible, multiscale, cache, plane, experimental_clipping_planes)\u001b[0m\n\u001b[1;32m 244\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_ensure_int_labels(data)\n\u001b[1;32m 245\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_color_lookup_func \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 247\u001b[0m \u001b[38;5;28;43msuper\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;21;43m__init__\u001b[39;49m\u001b[43m(\u001b[49m\n\u001b[1;32m 248\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 249\u001b[0m \u001b[43m \u001b[49m\u001b[43mrgb\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 250\u001b[0m \u001b[43m \u001b[49m\u001b[43mcolormap\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_random_colormap\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 251\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontrast_limits\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0.0\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1.0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 252\u001b[0m \u001b[43m \u001b[49m\u001b[43minterpolation2d\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnearest\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 253\u001b[0m \u001b[43m \u001b[49m\u001b[43minterpolation3d\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mnearest\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 254\u001b[0m \u001b[43m \u001b[49m\u001b[43mrendering\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrendering\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 255\u001b[0m \u001b[43m \u001b[49m\u001b[43mdepiction\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdepiction\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 256\u001b[0m \u001b[43m \u001b[49m\u001b[43miso_threshold\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 257\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 258\u001b[0m \u001b[43m \u001b[49m\u001b[43mmetadata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmetadata\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 259\u001b[0m \u001b[43m \u001b[49m\u001b[43mscale\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mscale\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 260\u001b[0m \u001b[43m \u001b[49m\u001b[43mtranslate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtranslate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 261\u001b[0m \u001b[43m \u001b[49m\u001b[43mrotate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrotate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 262\u001b[0m \u001b[43m \u001b[49m\u001b[43mshear\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mshear\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 263\u001b[0m \u001b[43m \u001b[49m\u001b[43maffine\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43maffine\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 264\u001b[0m \u001b[43m \u001b[49m\u001b[43mopacity\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mopacity\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 265\u001b[0m \u001b[43m \u001b[49m\u001b[43mblending\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mblending\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 266\u001b[0m \u001b[43m \u001b[49m\u001b[43mvisible\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvisible\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 267\u001b[0m \u001b[43m \u001b[49m\u001b[43mmultiscale\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmultiscale\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 268\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 269\u001b[0m \u001b[43m \u001b[49m\u001b[43mplane\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mplane\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 270\u001b[0m \u001b[43m \u001b[49m\u001b[43mexperimental_clipping_planes\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexperimental_clipping_planes\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 271\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 273\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mevents\u001b[38;5;241m.\u001b[39madd(\n\u001b[1;32m 274\u001b[0m preserve_labels\u001b[38;5;241m=\u001b[39mEvent,\n\u001b[1;32m 275\u001b[0m properties\u001b[38;5;241m=\u001b[39mEvent,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 284\u001b[0m paint\u001b[38;5;241m=\u001b[39mEvent,\n\u001b[1;32m 285\u001b[0m )\n\u001b[1;32m 287\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_feature_table \u001b[38;5;241m=\u001b[39m _FeatureTable\u001b[38;5;241m.\u001b[39mfrom_layer(\n\u001b[1;32m 288\u001b[0m features\u001b[38;5;241m=\u001b[39mfeatures, properties\u001b[38;5;241m=\u001b[39mproperties\n\u001b[1;32m 289\u001b[0m )\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/utils/migrations.py:44\u001b[0m, in \u001b[0;36mrename_argument.<locals>._wrapper.<locals>._update_from_dict\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 42\u001b[0m kwargs \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mcopy()\n\u001b[1;32m 43\u001b[0m kwargs[to_name] \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(from_name)\n\u001b[0;32m---> 44\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/image/image.py:378\u001b[0m, in \u001b[0;36m_ImageBase.__init__\u001b[0;34m(self, data, rgb, colormap, contrast_limits, gamma, interpolation2d, interpolation3d, rendering, iso_threshold, attenuation, name, metadata, scale, translate, rotate, shear, affine, opacity, blending, visible, multiscale, cache, depiction, plane, experimental_clipping_planes)\u001b[0m\n\u001b[1;32m 375\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mplane \u001b[38;5;241m=\u001b[39m plane\n\u001b[1;32m 377\u001b[0m \u001b[38;5;66;03m# Trigger generation of view slice and thumbnail\u001b[39;00m\n\u001b[0;32m--> 378\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_update_dims\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/base/base.py:705\u001b[0m, in \u001b[0;36mLayer._update_dims\u001b[0;34m(self, event)\u001b[0m\n\u001b[1;32m 702\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mextent\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__dict__\u001b[39m:\n\u001b[1;32m 703\u001b[0m \u001b[38;5;28;01mdel\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mextent\n\u001b[0;32m--> 705\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrefresh\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/base/base.py:1209\u001b[0m, in \u001b[0;36mLayer.refresh\u001b[0;34m(self, event)\u001b[0m\n\u001b[1;32m 1207\u001b[0m \u001b[38;5;124;03m\"\"\"Refresh all layer data based on current view slice.\"\"\"\u001b[39;00m\n\u001b[1;32m 1208\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvisible:\n\u001b[0;32m-> 1209\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_view_slice\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1210\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mevents\u001b[38;5;241m.\u001b[39mset_data() \u001b[38;5;66;03m# refresh is called in _update_dims which means that extent cache is invalidated. Then, base on this event extent cache in layerlist is invalidated.\u001b[39;00m\n\u001b[1;32m 1211\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_update_thumbnail()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/base/base.py:959\u001b[0m, in \u001b[0;36mLayer.set_view_slice\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 957\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mset_view_slice\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 958\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdask_optimized_slicing():\n\u001b[0;32m--> 959\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_set_view_slice\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/image/image.py:822\u001b[0m, in \u001b[0;36m_ImageBase._set_view_slice\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 818\u001b[0m \u001b[38;5;66;03m# Load our images, might be sync or async.\u001b[39;00m\n\u001b[1;32m 819\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_SliceDataClass(\n\u001b[1;32m 820\u001b[0m \u001b[38;5;28mself\u001b[39m, image_indices, image, thumbnail_source\n\u001b[1;32m 821\u001b[0m )\n\u001b[0;32m--> 822\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_load_slice\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 823\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_should_calc_clims:\n\u001b[1;32m 824\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mreset_contrast_limits_range()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/image/image.py:846\u001b[0m, in \u001b[0;36m_ImageBase._load_slice\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 839\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_load_slice\u001b[39m(\u001b[38;5;28mself\u001b[39m, data: ImageSliceData):\n\u001b[1;32m 840\u001b[0m \u001b[38;5;124;03m\"\"\"Load the image and maybe thumbnail source.\u001b[39;00m\n\u001b[1;32m 841\u001b[0m \n\u001b[1;32m 842\u001b[0m \u001b[38;5;124;03m Parameters\u001b[39;00m\n\u001b[1;32m 843\u001b[0m \u001b[38;5;124;03m ----------\u001b[39;00m\n\u001b[1;32m 844\u001b[0m \u001b[38;5;124;03m data : Slice\u001b[39;00m\n\u001b[1;32m 845\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 846\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_slice\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[1;32m 847\u001b[0m \u001b[38;5;66;03m# The load was synchronous.\u001b[39;00m\n\u001b[1;32m 848\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_on_data_loaded(data, sync\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m 849\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 850\u001b[0m \u001b[38;5;66;03m# The load will be asynchronous. Signal that our self.loaded\u001b[39;00m\n\u001b[1;32m 851\u001b[0m \u001b[38;5;66;03m# property is now false, since the load is in progress.\u001b[39;00m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/image/_image_slice.py:123\u001b[0m, in \u001b[0;36mImageSlice.load\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 110\u001b[0m \u001b[38;5;124;03m\"\"\"Load this data into the slice.\u001b[39;00m\n\u001b[1;32m 111\u001b[0m \n\u001b[1;32m 112\u001b[0m \u001b[38;5;124;03mParameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 120\u001b[0m \u001b[38;5;124;03m Return True if load was synchronous.\u001b[39;00m\n\u001b[1;32m 121\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 122\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mloaded \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m \u001b[38;5;66;03m# False until self._on_loaded is calls\u001b[39;00m\n\u001b[0;32m--> 123\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloader\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/image/_image_loader.py:22\u001b[0m, in \u001b[0;36mImageLoader.load\u001b[0;34m(self, data)\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload\u001b[39m(\u001b[38;5;28mself\u001b[39m, data: ImageSliceData) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28mbool\u001b[39m:\n\u001b[1;32m 10\u001b[0m \u001b[38;5;124;03m\"\"\"Load the ImageSliceData synchronously.\u001b[39;00m\n\u001b[1;32m 11\u001b[0m \n\u001b[1;32m 12\u001b[0m \u001b[38;5;124;03m Parameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;124;03m True if load happened synchronously.\u001b[39;00m\n\u001b[1;32m 21\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m---> 22\u001b[0m \u001b[43mdata\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_sync\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 23\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/napari/layers/image/_image_slice_data.py:44\u001b[0m, in \u001b[0;36mImageSliceData.load_sync\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 42\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_sync\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 43\u001b[0m \u001b[38;5;124;03m\"\"\"Call asarray on our images to load them.\"\"\"\u001b[39;00m\n\u001b[0;32m---> 44\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mimage \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43masarray\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mimage\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 46\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mthumbnail_source \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 47\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mthumbnail_source \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39masarray(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mthumbnail_source)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/core.py:1700\u001b[0m, in \u001b[0;36mArray.__array__\u001b[0;34m(self, dtype, **kwargs)\u001b[0m\n\u001b[1;32m 1699\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__array__\u001b[39m(\u001b[38;5;28mself\u001b[39m, dtype\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m-> 1700\u001b[0m x \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1701\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m dtype \u001b[38;5;129;01mand\u001b[39;00m x\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m!=\u001b[39m dtype:\n\u001b[1;32m 1702\u001b[0m x \u001b[38;5;241m=\u001b[39m x\u001b[38;5;241m.\u001b[39mastype(dtype)\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/base.py:315\u001b[0m, in \u001b[0;36mDaskMethodsMixin.compute\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 291\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcompute\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 292\u001b[0m \u001b[38;5;124;03m\"\"\"Compute this dask collection\u001b[39;00m\n\u001b[1;32m 293\u001b[0m \n\u001b[1;32m 294\u001b[0m \u001b[38;5;124;03m This turns a lazy Dask collection into its in-memory equivalent.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 313\u001b[0m \u001b[38;5;124;03m dask.base.compute\u001b[39;00m\n\u001b[1;32m 314\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 315\u001b[0m (result,) \u001b[38;5;241m=\u001b[39m \u001b[43mcompute\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtraverse\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 316\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/base.py:600\u001b[0m, in \u001b[0;36mcompute\u001b[0;34m(traverse, optimize_graph, scheduler, get, *args, **kwargs)\u001b[0m\n\u001b[1;32m 597\u001b[0m keys\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_keys__())\n\u001b[1;32m 598\u001b[0m postcomputes\u001b[38;5;241m.\u001b[39mappend(x\u001b[38;5;241m.\u001b[39m__dask_postcompute__())\n\u001b[0;32m--> 600\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[43mschedule\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdsk\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeys\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 601\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m repack([f(r, \u001b[38;5;241m*\u001b[39ma) \u001b[38;5;28;01mfor\u001b[39;00m r, (f, a) \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(results, postcomputes)])\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:3122\u001b[0m, in \u001b[0;36mClient.get\u001b[0;34m(self, dsk, keys, workers, allow_other_workers, resources, sync, asynchronous, direct, retries, priority, fifo_timeout, actors, **kwargs)\u001b[0m\n\u001b[1;32m 3120\u001b[0m should_rejoin \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[1;32m 3121\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 3122\u001b[0m results \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgather\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpacked\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3123\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 3124\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m f \u001b[38;5;129;01min\u001b[39;00m futures\u001b[38;5;241m.\u001b[39mvalues():\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:2291\u001b[0m, in \u001b[0;36mClient.gather\u001b[0;34m(self, futures, errors, direct, asynchronous)\u001b[0m\n\u001b[1;32m 2289\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2290\u001b[0m local_worker \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 2291\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2292\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_gather\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2293\u001b[0m \u001b[43m \u001b[49m\u001b[43mfutures\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2294\u001b[0m \u001b[43m \u001b[49m\u001b[43merrors\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43merrors\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2295\u001b[0m \u001b[43m \u001b[49m\u001b[43mdirect\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdirect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2296\u001b[0m \u001b[43m \u001b[49m\u001b[43mlocal_worker\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mlocal_worker\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2297\u001b[0m \u001b[43m \u001b[49m\u001b[43masynchronous\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43masynchronous\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2298\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:339\u001b[0m, in \u001b[0;36mSyncMethodMixin.sync\u001b[0;34m(self, func, asynchronous, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 337\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m future\n\u001b[1;32m 338\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 339\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43msync\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 340\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunc\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallback_timeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcallback_timeout\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\n\u001b[1;32m 341\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:406\u001b[0m, in \u001b[0;36msync\u001b[0;34m(loop, func, callback_timeout, *args, **kwargs)\u001b[0m\n\u001b[1;32m 404\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m error:\n\u001b[1;32m 405\u001b[0m typ, exc, tb \u001b[38;5;241m=\u001b[39m error\n\u001b[0;32m--> 406\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mwith_traceback(tb)\n\u001b[1;32m 407\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 408\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/utils.py:379\u001b[0m, in \u001b[0;36msync.<locals>.f\u001b[0;34m()\u001b[0m\n\u001b[1;32m 377\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mwait_for(future, callback_timeout)\n\u001b[1;32m 378\u001b[0m future \u001b[38;5;241m=\u001b[39m asyncio\u001b[38;5;241m.\u001b[39mensure_future(future)\n\u001b[0;32m--> 379\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01myield\u001b[39;00m future\n\u001b[1;32m 380\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 381\u001b[0m error \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/tornado/gen.py:762\u001b[0m, in \u001b[0;36mRunner.run\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 759\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 761\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 762\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 763\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m:\n\u001b[1;32m 764\u001b[0m exc_info \u001b[38;5;241m=\u001b[39m sys\u001b[38;5;241m.\u001b[39mexc_info()\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/distributed/client.py:2154\u001b[0m, in \u001b[0;36mClient._gather\u001b[0;34m(self, futures, errors, direct, local_worker)\u001b[0m\n\u001b[1;32m 2152\u001b[0m exc \u001b[38;5;241m=\u001b[39m CancelledError(key)\n\u001b[1;32m 2153\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 2154\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exception\u001b[38;5;241m.\u001b[39mwith_traceback(traceback)\n\u001b[1;32m 2155\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\n\u001b[1;32m 2156\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m errors \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mskip\u001b[39m\u001b[38;5;124m\"\u001b[39m:\n",
"File \u001b[0;32m~/mambaforge/envs/zarpaint-dev/lib/python3.9/site-packages/dask/array/chunk.py:420\u001b[0m, in \u001b[0;36mgetitem\u001b[0;34m()\u001b[0m\n\u001b[1;32m 418\u001b[0m result \u001b[38;5;241m=\u001b[39m obj[index]\n\u001b[1;32m 419\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mIndexError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 420\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 421\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mArray chunk size or shape is unknown. \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 422\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPossible solution with x.compute_chunk_sizes()\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 423\u001b[0m ) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 425\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 426\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m result\u001b[38;5;241m.\u001b[39mflags\u001b[38;5;241m.\u001b[39mowndata \u001b[38;5;129;01mand\u001b[39;00m obj\u001b[38;5;241m.\u001b[39msize \u001b[38;5;241m>\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m2\u001b[39m \u001b[38;5;241m*\u001b[39m result\u001b[38;5;241m.\u001b[39msize:\n",
"\u001b[0;31mValueError\u001b[0m: Array chunk size or shape is unknown. Possible solution with x.compute_chunk_sizes()"
]
}
],
"source": [
"viewer.add_labels(downsampled2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c3d5500a",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 11,
"id": "546c155c",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div><svg style=\"position: absolute; width: 0; height: 0; overflow: hidden\">\n",
"<defs>\n",
"<symbol id=\"icon-database\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M16 0c-8.837 0-16 2.239-16 5v4c0 2.761 7.163 5 16 5s16-2.239 16-5v-4c0-2.761-7.163-5-16-5z\"></path>\n",
"<path d=\"M16 17c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"<path d=\"M16 26c-8.837 0-16-2.239-16-5v6c0 2.761 7.163 5 16 5s16-2.239 16-5v-6c0 2.761-7.163 5-16 5z\"></path>\n",
"</symbol>\n",
"<symbol id=\"icon-file-text2\" viewBox=\"0 0 32 32\">\n",
"<path d=\"M28.681 7.159c-0.694-0.947-1.662-2.053-2.724-3.116s-2.169-2.030-3.116-2.724c-1.612-1.182-2.393-1.319-2.841-1.319h-15.5c-1.378 0-2.5 1.121-2.5 2.5v27c0 1.378 1.122 2.5 2.5 2.5h23c1.378 0 2.5-1.122 2.5-2.5v-19.5c0-0.448-0.137-1.23-1.319-2.841zM24.543 5.457c0.959 0.959 1.712 1.825 2.268 2.543h-4.811v-4.811c0.718 0.556 1.584 1.309 2.543 2.268zM28 29.5c0 0.271-0.229 0.5-0.5 0.5h-23c-0.271 0-0.5-0.229-0.5-0.5v-27c0-0.271 0.229-0.5 0.5-0.5 0 0 15.499-0 15.5 0v7c0 0.552 0.448 1 1 1h7v19.5z\"></path>\n",
"<path d=\"M23 26h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 22h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"<path d=\"M23 18h-14c-0.552 0-1-0.448-1-1s0.448-1 1-1h14c0.552 0 1 0.448 1 1s-0.448 1-1 1z\"></path>\n",
"</symbol>\n",
"</defs>\n",
"</svg>\n",
"<style>/* CSS stylesheet for displaying xarray objects in jupyterlab.\n",
" *\n",
" */\n",
"\n",
":root {\n",
" --xr-font-color0: var(--jp-content-font-color0, rgba(0, 0, 0, 1));\n",
" --xr-font-color2: var(--jp-content-font-color2, rgba(0, 0, 0, 0.54));\n",
" --xr-font-color3: var(--jp-content-font-color3, rgba(0, 0, 0, 0.38));\n",
" --xr-border-color: var(--jp-border-color2, #e0e0e0);\n",
" --xr-disabled-color: var(--jp-layout-color3, #bdbdbd);\n",
" --xr-background-color: var(--jp-layout-color0, white);\n",
" --xr-background-color-row-even: var(--jp-layout-color1, white);\n",
" --xr-background-color-row-odd: var(--jp-layout-color2, #eeeeee);\n",
"}\n",
"\n",
"html[theme=dark],\n",
"body[data-theme=dark],\n",
"body.vscode-dark {\n",
" --xr-font-color0: rgba(255, 255, 255, 1);\n",
" --xr-font-color2: rgba(255, 255, 255, 0.54);\n",
" --xr-font-color3: rgba(255, 255, 255, 0.38);\n",
" --xr-border-color: #1F1F1F;\n",
" --xr-disabled-color: #515151;\n",
" --xr-background-color: #111111;\n",
" --xr-background-color-row-even: #111111;\n",
" --xr-background-color-row-odd: #313131;\n",
"}\n",
"\n",
".xr-wrap {\n",
" display: block !important;\n",
" min-width: 300px;\n",
" max-width: 700px;\n",
"}\n",
"\n",
".xr-text-repr-fallback {\n",
" /* fallback to plain text repr when CSS is not injected (untrusted notebook) */\n",
" display: none;\n",
"}\n",
"\n",
".xr-header {\n",
" padding-top: 6px;\n",
" padding-bottom: 6px;\n",
" margin-bottom: 4px;\n",
" border-bottom: solid 1px var(--xr-border-color);\n",
"}\n",
"\n",
".xr-header > div,\n",
".xr-header > ul {\n",
" display: inline;\n",
" margin-top: 0;\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-obj-type,\n",
".xr-array-name {\n",
" margin-left: 2px;\n",
" margin-right: 10px;\n",
"}\n",
"\n",
".xr-obj-type {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-sections {\n",
" padding-left: 0 !important;\n",
" display: grid;\n",
" grid-template-columns: 150px auto auto 1fr 20px 20px;\n",
"}\n",
"\n",
".xr-section-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-section-item input {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-item input + label {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label {\n",
" cursor: pointer;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-item input:enabled + label:hover {\n",
" color: var(--xr-font-color0);\n",
"}\n",
"\n",
".xr-section-summary {\n",
" grid-column: 1;\n",
" color: var(--xr-font-color2);\n",
" font-weight: 500;\n",
"}\n",
"\n",
".xr-section-summary > span {\n",
" display: inline-block;\n",
" padding-left: 0.5em;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label {\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-section-summary-in + label:before {\n",
" display: inline-block;\n",
" content: '►';\n",
" font-size: 11px;\n",
" width: 15px;\n",
" text-align: center;\n",
"}\n",
"\n",
".xr-section-summary-in:disabled + label:before {\n",
" color: var(--xr-disabled-color);\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label:before {\n",
" content: '▼';\n",
"}\n",
"\n",
".xr-section-summary-in:checked + label > span {\n",
" display: none;\n",
"}\n",
"\n",
".xr-section-summary,\n",
".xr-section-inline-details {\n",
" padding-top: 4px;\n",
" padding-bottom: 4px;\n",
"}\n",
"\n",
".xr-section-inline-details {\n",
" grid-column: 2 / -1;\n",
"}\n",
"\n",
".xr-section-details {\n",
" display: none;\n",
" grid-column: 1 / -1;\n",
" margin-bottom: 5px;\n",
"}\n",
"\n",
".xr-section-summary-in:checked ~ .xr-section-details {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-array-wrap {\n",
" grid-column: 1 / -1;\n",
" display: grid;\n",
" grid-template-columns: 20px auto;\n",
"}\n",
"\n",
".xr-array-wrap > label {\n",
" grid-column: 1;\n",
" vertical-align: top;\n",
"}\n",
"\n",
".xr-preview {\n",
" color: var(--xr-font-color3);\n",
"}\n",
"\n",
".xr-array-preview,\n",
".xr-array-data {\n",
" padding: 0 5px !important;\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-array-data,\n",
".xr-array-in:checked ~ .xr-array-preview {\n",
" display: none;\n",
"}\n",
"\n",
".xr-array-in:checked ~ .xr-array-data,\n",
".xr-array-preview {\n",
" display: inline-block;\n",
"}\n",
"\n",
".xr-dim-list {\n",
" display: inline-block !important;\n",
" list-style: none;\n",
" padding: 0 !important;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list li {\n",
" display: inline-block;\n",
" padding: 0;\n",
" margin: 0;\n",
"}\n",
"\n",
".xr-dim-list:before {\n",
" content: '(';\n",
"}\n",
"\n",
".xr-dim-list:after {\n",
" content: ')';\n",
"}\n",
"\n",
".xr-dim-list li:not(:last-child):after {\n",
" content: ',';\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-has-index {\n",
" font-weight: bold;\n",
"}\n",
"\n",
".xr-var-list,\n",
".xr-var-item {\n",
" display: contents;\n",
"}\n",
"\n",
".xr-var-item > div,\n",
".xr-var-item label,\n",
".xr-var-item > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-even);\n",
" margin-bottom: 0;\n",
"}\n",
"\n",
".xr-var-item > .xr-var-name:hover span {\n",
" padding-right: 5px;\n",
"}\n",
"\n",
".xr-var-list > li:nth-child(odd) > div,\n",
".xr-var-list > li:nth-child(odd) > label,\n",
".xr-var-list > li:nth-child(odd) > .xr-var-name span {\n",
" background-color: var(--xr-background-color-row-odd);\n",
"}\n",
"\n",
".xr-var-name {\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-var-dims {\n",
" grid-column: 2;\n",
"}\n",
"\n",
".xr-var-dtype {\n",
" grid-column: 3;\n",
" text-align: right;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-preview {\n",
" grid-column: 4;\n",
"}\n",
"\n",
".xr-index-preview {\n",
" grid-column: 2 / 5;\n",
" color: var(--xr-font-color2);\n",
"}\n",
"\n",
".xr-var-name,\n",
".xr-var-dims,\n",
".xr-var-dtype,\n",
".xr-preview,\n",
".xr-attrs dt {\n",
" white-space: nowrap;\n",
" overflow: hidden;\n",
" text-overflow: ellipsis;\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-var-name:hover,\n",
".xr-var-dims:hover,\n",
".xr-var-dtype:hover,\n",
".xr-attrs dt:hover {\n",
" overflow: visible;\n",
" width: auto;\n",
" z-index: 1;\n",
"}\n",
"\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" display: none;\n",
" background-color: var(--xr-background-color) !important;\n",
" padding-bottom: 5px !important;\n",
"}\n",
"\n",
".xr-var-attrs-in:checked ~ .xr-var-attrs,\n",
".xr-var-data-in:checked ~ .xr-var-data,\n",
".xr-index-data-in:checked ~ .xr-index-data {\n",
" display: block;\n",
"}\n",
"\n",
".xr-var-data > table {\n",
" float: right;\n",
"}\n",
"\n",
".xr-var-name span,\n",
".xr-var-data,\n",
".xr-index-name div,\n",
".xr-index-data,\n",
".xr-attrs {\n",
" padding-left: 25px !important;\n",
"}\n",
"\n",
".xr-attrs,\n",
".xr-var-attrs,\n",
".xr-var-data,\n",
".xr-index-data {\n",
" grid-column: 1 / -1;\n",
"}\n",
"\n",
"dl.xr-attrs {\n",
" padding: 0;\n",
" margin: 0;\n",
" display: grid;\n",
" grid-template-columns: 125px auto;\n",
"}\n",
"\n",
".xr-attrs dt,\n",
".xr-attrs dd {\n",
" padding: 0;\n",
" margin: 0;\n",
" float: left;\n",
" padding-right: 10px;\n",
" width: auto;\n",
"}\n",
"\n",
".xr-attrs dt {\n",
" font-weight: normal;\n",
" grid-column: 1;\n",
"}\n",
"\n",
".xr-attrs dt:hover span {\n",
" display: inline-block;\n",
" background: var(--xr-background-color);\n",
" padding-right: 10px;\n",
"}\n",
"\n",
".xr-attrs dd {\n",
" grid-column: 2;\n",
" white-space: pre-wrap;\n",
" word-break: break-all;\n",
"}\n",
"\n",
".xr-icon-database,\n",
".xr-icon-file-text2,\n",
".xr-no-icon {\n",
" display: inline-block;\n",
" vertical-align: middle;\n",
" width: 1em;\n",
" height: 1.5em !important;\n",
" stroke-width: 0;\n",
" stroke: currentColor;\n",
" fill: currentColor;\n",
"}\n",
"</style><pre class='xr-text-repr-fallback'>&lt;xarray.SpatialImage &#x27;image&#x27; (z: 1165, y: 2355, x: 3494)&gt;\n",
"dask.array&lt;from-zarr, shape=(1165, 2355, 3494), dtype=int32, chunksize=(256, 256, 256), chunktype=numpy.ndarray&gt;\n",
"Coordinates:\n",
" * z (z) float64 0.0 1.0 2.0 3.0 ... 1.162e+03 1.163e+03 1.164e+03\n",
" * y (y) float64 0.0 1.0 2.0 3.0 ... 2.352e+03 2.353e+03 2.354e+03\n",
" * x (x) float64 0.0 1.0 2.0 3.0 ... 3.491e+03 3.492e+03 3.493e+03</pre><div class='xr-wrap' style='display:none'><div class='xr-header'><div class='xr-obj-type'>xarray.SpatialImage</div><div class='xr-array-name'>'image'</div><ul class='xr-dim-list'><li><span class='xr-has-index'>z</span>: 1165</li><li><span class='xr-has-index'>y</span>: 2355</li><li><span class='xr-has-index'>x</span>: 3494</li></ul></div><ul class='xr-sections'><li class='xr-section-item'><div class='xr-array-wrap'><input id='section-e147ac02-8158-4def-b4e6-2bc91928854e' class='xr-array-in' type='checkbox' checked><label for='section-e147ac02-8158-4def-b4e6-2bc91928854e' title='Show/hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-array-preview xr-preview'><span>dask.array&lt;chunksize=(256, 256, 256), meta=np.ndarray&gt;</span></div><div class='xr-array-data'><table>\n",
" <tr>\n",
" <td>\n",
" <table style=\"border-collapse: collapse;\">\n",
" <thead>\n",
" <tr>\n",
" <td> </td>\n",
" <th> Array </th>\n",
" <th> Chunk </th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" \n",
" <tr>\n",
" <th> Bytes </th>\n",
" <td> 35.71 GiB </td>\n",
" <td> 64.00 MiB </td>\n",
" </tr>\n",
" \n",
" <tr>\n",
" <th> Shape </th>\n",
" <td> (1165, 2355, 3494) </td>\n",
" <td> (256, 256, 256) </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Dask graph </th>\n",
" <td colspan=\"2\"> 700 chunks in 2 graph layers </td>\n",
" </tr>\n",
" <tr>\n",
" <th> Data type </th>\n",
" <td colspan=\"2\"> int32 numpy.ndarray </td>\n",
" </tr>\n",
" </tbody>\n",
" </table>\n",
" </td>\n",
" <td>\n",
" <svg width=\"205\" height=\"156\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"10\" y1=\"8\" x2=\"35\" y2=\"34\" />\n",
" <line x1=\"10\" y1=\"17\" x2=\"35\" y2=\"43\" />\n",
" <line x1=\"10\" y1=\"26\" x2=\"35\" y2=\"52\" />\n",
" <line x1=\"10\" y1=\"35\" x2=\"35\" y2=\"60\" />\n",
" <line x1=\"10\" y1=\"43\" x2=\"35\" y2=\"69\" />\n",
" <line x1=\"10\" y1=\"52\" x2=\"35\" y2=\"78\" />\n",
" <line x1=\"10\" y1=\"61\" x2=\"35\" y2=\"87\" />\n",
" <line x1=\"10\" y1=\"70\" x2=\"35\" y2=\"96\" />\n",
" <line x1=\"10\" y1=\"79\" x2=\"35\" y2=\"104\" />\n",
" <line x1=\"10\" y1=\"80\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"80\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"86\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"92\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"27\" y2=\"97\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"32\" y2=\"103\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 35.815723019803514,25.815723019803514 35.815723019803514,106.69723418179551 10.0,80.881511161992\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"130\" y2=\"0\" style=\"stroke-width:2\" />\n",
" <line x1=\"15\" y1=\"5\" x2=\"135\" y2=\"5\" />\n",
" <line x1=\"21\" y1=\"11\" x2=\"141\" y2=\"11\" />\n",
" <line x1=\"27\" y1=\"17\" x2=\"147\" y2=\"17\" />\n",
" <line x1=\"32\" y1=\"22\" x2=\"152\" y2=\"22\" />\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"18\" y1=\"0\" x2=\"44\" y2=\"25\" />\n",
" <line x1=\"27\" y1=\"0\" x2=\"53\" y2=\"25\" />\n",
" <line x1=\"36\" y1=\"0\" x2=\"62\" y2=\"25\" />\n",
" <line x1=\"45\" y1=\"0\" x2=\"70\" y2=\"25\" />\n",
" <line x1=\"53\" y1=\"0\" x2=\"79\" y2=\"25\" />\n",
" <line x1=\"62\" y1=\"0\" x2=\"88\" y2=\"25\" />\n",
" <line x1=\"71\" y1=\"0\" x2=\"97\" y2=\"25\" />\n",
" <line x1=\"80\" y1=\"0\" x2=\"106\" y2=\"25\" />\n",
" <line x1=\"89\" y1=\"0\" x2=\"114\" y2=\"25\" />\n",
" <line x1=\"97\" y1=\"0\" x2=\"123\" y2=\"25\" />\n",
" <line x1=\"106\" y1=\"0\" x2=\"132\" y2=\"25\" />\n",
" <line x1=\"115\" y1=\"0\" x2=\"141\" y2=\"25\" />\n",
" <line x1=\"124\" y1=\"0\" x2=\"150\" y2=\"25\" />\n",
" <line x1=\"130\" y1=\"0\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"10.0,0.0 130.0,0.0 155.8157230198035,25.815723019803514 35.815723019803514,25.815723019803514\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Horizontal lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"155\" y2=\"25\" style=\"stroke-width:2\" />\n",
" <line x1=\"35\" y1=\"34\" x2=\"155\" y2=\"34\" />\n",
" <line x1=\"35\" y1=\"43\" x2=\"155\" y2=\"43\" />\n",
" <line x1=\"35\" y1=\"52\" x2=\"155\" y2=\"52\" />\n",
" <line x1=\"35\" y1=\"60\" x2=\"155\" y2=\"60\" />\n",
" <line x1=\"35\" y1=\"69\" x2=\"155\" y2=\"69\" />\n",
" <line x1=\"35\" y1=\"78\" x2=\"155\" y2=\"78\" />\n",
" <line x1=\"35\" y1=\"87\" x2=\"155\" y2=\"87\" />\n",
" <line x1=\"35\" y1=\"96\" x2=\"155\" y2=\"96\" />\n",
" <line x1=\"35\" y1=\"104\" x2=\"155\" y2=\"104\" />\n",
" <line x1=\"35\" y1=\"106\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Vertical lines -->\n",
" <line x1=\"35\" y1=\"25\" x2=\"35\" y2=\"106\" style=\"stroke-width:2\" />\n",
" <line x1=\"44\" y1=\"25\" x2=\"44\" y2=\"106\" />\n",
" <line x1=\"53\" y1=\"25\" x2=\"53\" y2=\"106\" />\n",
" <line x1=\"62\" y1=\"25\" x2=\"62\" y2=\"106\" />\n",
" <line x1=\"70\" y1=\"25\" x2=\"70\" y2=\"106\" />\n",
" <line x1=\"79\" y1=\"25\" x2=\"79\" y2=\"106\" />\n",
" <line x1=\"88\" y1=\"25\" x2=\"88\" y2=\"106\" />\n",
" <line x1=\"97\" y1=\"25\" x2=\"97\" y2=\"106\" />\n",
" <line x1=\"106\" y1=\"25\" x2=\"106\" y2=\"106\" />\n",
" <line x1=\"114\" y1=\"25\" x2=\"114\" y2=\"106\" />\n",
" <line x1=\"123\" y1=\"25\" x2=\"123\" y2=\"106\" />\n",
" <line x1=\"132\" y1=\"25\" x2=\"132\" y2=\"106\" />\n",
" <line x1=\"141\" y1=\"25\" x2=\"141\" y2=\"106\" />\n",
" <line x1=\"150\" y1=\"25\" x2=\"150\" y2=\"106\" />\n",
" <line x1=\"155\" y1=\"25\" x2=\"155\" y2=\"106\" style=\"stroke-width:2\" />\n",
"\n",
" <!-- Colored Rectangle -->\n",
" <polygon points=\"35.815723019803514,25.815723019803514 155.8157230198035,25.815723019803514 155.8157230198035,106.69723418179551 35.815723019803514,106.69723418179551\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n",
"\n",
" <!-- Text -->\n",
" <text x=\"95.815723\" y=\"126.697234\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >3494</text>\n",
" <text x=\"175.815723\" y=\"66.256479\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,175.815723,66.256479)\">2355</text>\n",
" <text x=\"12.907862\" y=\"113.789373\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,12.907862,113.789373)\">1165</text>\n",
"</svg>\n",
" </td>\n",
" </tr>\n",
"</table></div></div></li><li class='xr-section-item'><input id='section-b764a2dd-3c18-4772-8c49-b3ec1e0df0cb' class='xr-section-summary-in' type='checkbox' checked><label for='section-b764a2dd-3c18-4772-8c49-b3ec1e0df0cb' class='xr-section-summary' >Coordinates: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>z</span></div><div class='xr-var-dims'>(z)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 1.0 2.0 ... 1.163e+03 1.164e+03</div><input id='attrs-f510ea46-142b-4842-9c71-302c5d444d1a' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-f510ea46-142b-4842-9c71-302c5d444d1a' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-8005c79e-d433-411c-9eda-fcb5917bc5ed' class='xr-var-data-in' type='checkbox'><label for='data-8005c79e-d433-411c-9eda-fcb5917bc5ed' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>z</dd><dt><span>units :</span></dt><dd></dd></dl></div><div class='xr-var-data'><pre>array([0.000e+00, 1.000e+00, 2.000e+00, ..., 1.162e+03, 1.163e+03, 1.164e+03])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>y</span></div><div class='xr-var-dims'>(y)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 1.0 2.0 ... 2.353e+03 2.354e+03</div><input id='attrs-8dcf6965-42da-4673-8e8d-1660792b0b6e' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-8dcf6965-42da-4673-8e8d-1660792b0b6e' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-38a4f92c-2525-41df-92ff-3224299f9a9b' class='xr-var-data-in' type='checkbox'><label for='data-38a4f92c-2525-41df-92ff-3224299f9a9b' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>y</dd><dt><span>units :</span></dt><dd></dd></dl></div><div class='xr-var-data'><pre>array([0.000e+00, 1.000e+00, 2.000e+00, ..., 2.352e+03, 2.353e+03, 2.354e+03])</pre></div></li><li class='xr-var-item'><div class='xr-var-name'><span class='xr-has-index'>x</span></div><div class='xr-var-dims'>(x)</div><div class='xr-var-dtype'>float64</div><div class='xr-var-preview xr-preview'>0.0 1.0 2.0 ... 3.492e+03 3.493e+03</div><input id='attrs-988be582-8529-46eb-8883-f0996566be96' class='xr-var-attrs-in' type='checkbox' ><label for='attrs-988be582-8529-46eb-8883-f0996566be96' title='Show/Hide attributes'><svg class='icon xr-icon-file-text2'><use xlink:href='#icon-file-text2'></use></svg></label><input id='data-7b650b4b-81ba-4dcb-b581-610dc9d42436' class='xr-var-data-in' type='checkbox'><label for='data-7b650b4b-81ba-4dcb-b581-610dc9d42436' title='Show/Hide data repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-var-attrs'><dl class='xr-attrs'><dt><span>long_name :</span></dt><dd>x</dd><dt><span>units :</span></dt><dd></dd></dl></div><div class='xr-var-data'><pre>array([0.000e+00, 1.000e+00, 2.000e+00, ..., 3.491e+03, 3.492e+03, 3.493e+03])</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-4c1cd23b-c9b8-4011-9531-24ec6d3d5158' class='xr-section-summary-in' type='checkbox' ><label for='section-4c1cd23b-c9b8-4011-9531-24ec6d3d5158' class='xr-section-summary' >Indexes: <span>(3)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><ul class='xr-var-list'><li class='xr-var-item'><div class='xr-index-name'><div>z</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-474e55ca-2526-457c-862a-e506836e7016' class='xr-index-data-in' type='checkbox'/><label for='index-474e55ca-2526-457c-862a-e506836e7016' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,\n",
" 8.0, 9.0,\n",
" ...\n",
" 1155.0, 1156.0, 1157.0, 1158.0, 1159.0, 1160.0, 1161.0, 1162.0,\n",
" 1163.0, 1164.0],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;z&#x27;, length=1165))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>y</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-8579c70d-fa72-46d1-8c45-8237a1ffb676' class='xr-index-data-in' type='checkbox'/><label for='index-8579c70d-fa72-46d1-8c45-8237a1ffb676' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,\n",
" 8.0, 9.0,\n",
" ...\n",
" 2345.0, 2346.0, 2347.0, 2348.0, 2349.0, 2350.0, 2351.0, 2352.0,\n",
" 2353.0, 2354.0],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;y&#x27;, length=2355))</pre></div></li><li class='xr-var-item'><div class='xr-index-name'><div>x</div></div><div class='xr-index-preview'>PandasIndex</div><div></div><input id='index-b9acc9a7-6a34-4610-be56-c83494fdc94a' class='xr-index-data-in' type='checkbox'/><label for='index-b9acc9a7-6a34-4610-be56-c83494fdc94a' title='Show/Hide index repr'><svg class='icon xr-icon-database'><use xlink:href='#icon-database'></use></svg></label><div class='xr-index-data'><pre>PandasIndex(Float64Index([ 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,\n",
" 8.0, 9.0,\n",
" ...\n",
" 3484.0, 3485.0, 3486.0, 3487.0, 3488.0, 3489.0, 3490.0, 3491.0,\n",
" 3492.0, 3493.0],\n",
" dtype=&#x27;float64&#x27;, name=&#x27;x&#x27;, length=3494))</pre></div></li></ul></div></li><li class='xr-section-item'><input id='section-683e97b3-4205-48dd-9463-4020faaeb8cd' class='xr-section-summary-in' type='checkbox' disabled ><label for='section-683e97b3-4205-48dd-9463-4020faaeb8cd' class='xr-section-summary' title='Expand/collapse section'>Attributes: <span>(0)</span></label><div class='xr-section-inline-details'></div><div class='xr-section-details'><dl class='xr-attrs'></dl></div></li></ul></div></div>"
],
"text/plain": [
"<xarray.SpatialImage 'image' (z: 1165, y: 2355, x: 3494)>\n",
"dask.array<from-zarr, shape=(1165, 2355, 3494), dtype=int32, chunksize=(256, 256, 256), chunktype=numpy.ndarray>\n",
"Coordinates:\n",
" * z (z) float64 0.0 1.0 2.0 3.0 ... 1.162e+03 1.163e+03 1.164e+03\n",
" * y (y) float64 0.0 1.0 2.0 3.0 ... 2.352e+03 2.353e+03 2.354e+03\n",
" * x (x) float64 0.0 1.0 2.0 3.0 ... 3.491e+03 3.492e+03 3.493e+03"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"image = to_spatial_image(image)\n",
"image"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "8e0bb46d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"spatial_image.SpatialImage"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(image)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a6300de2",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 1,
"id": "ecb7e95f",
"metadata": {
"scrolled": false
},
"outputs": [],
"source": [
"# # dies, too much memory required (Mac)\n",
"# multiscale = to_multiscale(image, [2, 2], method=Methods.DASK_IMAGE_NEAREST)\n",
"# multiscale"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3f91a06e",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 14,
"id": "a0750c7f",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-01-12 12:19:54,941 - distributed.client - ERROR - Failed to reconnect to scheduler after 30.00 seconds, closing client\n"
]
}
],
"source": [
"# Shutdown procedure\n",
"try:\n",
" viewer.close()\n",
"try:\n",
" client.shutdown()"
]
}
],
"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.9.15"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment