diff --git a/20221122-Madison.ipynb b/20221122-Madison.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..357b412ec00c218eeb34f98de0b4ce7e01e5b788 --- /dev/null +++ b/20221122-Madison.ipynb @@ -0,0 +1,1190 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "b2008c50-e0c5-4a52-9d11-10adce12220d", + "metadata": {}, + "outputs": [], + "source": [ + "import nd2\n", + "from zarr_tools import convert\n", + "import dask.array as da\n", + "import tifffile as tf\n", + "import numpy as np\n", + "from napari import Viewer\n", + "\n", + "from napari_plugin_engine import napari_hook_implementation\n", + "from qtpy.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QPushButton, QLabel, QLineEdit\n", + "from napari_tools_menu import register_dock_widget\n", + "from magicgui.widgets import create_widget\n", + "from magicgui import magicgui\n", + "from napari.layers import Shapes, Points, Image\n", + "from napari._qt.qthreading import thread_worker" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "a2bbd55e-cb6c-48ac-849c-d08db2191dd3", + "metadata": {}, + "outputs": [], + "source": [ + "@magicgui\n", + "def make_matrix(\n", + " Manual_ref_line:Shapes,\n", + " n_cols : int = 5,\n", + " n_rows : int = 5,\n", + " row_multiplier : float = 1.,\n", + " check : bool = True,\n", + " size : int = 300\n", + " \n", + ") -> napari.types.LayerDataTuple:\n", + " manual_points = Manual_ref_line.data[0]\n", + " assert len(manual_points == 2), \"Select a line along your wells\"\n", + " manual_period = manual_points[1] - manual_points[0]\n", + " col_period = manual_period / (n_cols - 1)\n", + " \n", + " row_period = np.zeros_like(col_period)\n", + " row_period[-2:] = np.array([col_period[-1], -col_period[-2]])\n", + " extrapolated_wells = np.stack([\n", + " manual_points[0] + \\\n", + " col_period * i + \\\n", + " row_period * j * row_multiplier + \\\n", + " (col_period + row_period * row_multiplier) / 2 * k \\\n", + " for k in range(2 * check) \\\n", + " for i in range(n_cols) \\\n", + " for j in range(n_rows)\n", + " ])\n", + " \n", + " return (\n", + " extrapolated_wells[:,-2:],\n", + " {\"symbol\": \"square\",\n", + " \"size\" : size,\n", + " \"edge_color\": \"#ff0000\",\n", + " \"face_color\": \"#00000000\"\n", + " },\n", + " \"points\"\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "187017c9-5906-4c92-be8c-eff6ae6a01c3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'sizes': {'T': 46, 'P': 2, 'Z': 5, 'C': 2, 'Y': 5928, 'X': 9831},\n", + " 'path': 'E:\\\\Madison\\\\LPYgalvstet.nd2',\n", + " 'pixel_size_um': 0.325028674328292}" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v.layers[0].metadata" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "id": "273f8bbb-bd3a-45e1-8a51-392f695b3bda", + "metadata": {}, + "outputs": [], + "source": [ + "@magicgui\n", + "def crop_regions(\n", + " dataset:Image,\n", + " ROIs: Points,\n", + " \n", + " \n", + ") -> napari.types.LayerDataTuple:\n", + " manual_points = Manual_ref_line.data[0]\n", + " assert len(manual_points == 2), \"Select a line along your wells\"\n", + " manual_period = manual_points[1] - manual_points[0]\n", + " col_period = manual_period / (n_cols - 1)\n", + " \n", + " row_period = np.zeros_like(col_period)\n", + " row_period[-2:] = np.array([col_period[-1], -col_period[-2]])\n", + " extrapolated_wells = np.stack([\n", + " manual_points[0] + \\\n", + " col_period * i + \\\n", + " row_period * j * row_multiplier + \\\n", + " (col_period + row_period * row_multiplier) / 2 * k \\\n", + " for k in range(2 * check) \\\n", + " for i in range(n_cols) \\\n", + " for j in range(n_rows)\n", + " ])\n", + " \n", + " return (\n", + " extrapolated_wells[:,-2:],\n", + " {\"symbol\": \"square\",\n", + " \"size\" : size,\n", + " \"edge_color\": \"#ff0000\",\n", + " \"face_color\": \"#00000000\"\n", + " },\n", + " \"points\"\n", + " )" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "73b70617-11a9-4f53-9ab4-5a590c976d02", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "6befd5f7-066f-4f0d-afd7-c689b374eb94", + "metadata": { + "collapsed": true, + "jupyter": { + "outputs_hidden": true + }, + "tags": [] + }, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAFSCAYAAACNC7oQAAAbw0lEQVR42u3dTWgj98HH8Z9LzvGwu/apZTfa9W7CNoeKFcGhJQTvwL7k0D0ohVCCaCAGlRptoYbIbQ55ugr4OawwROANaYccAlkfnEOSXZ5ZN4QG+zBGl2Ly1FrraaAXvyzMBkKPeg4zeh/Jli3Z0uj7gYGs9J8X/2Xrl//bzIjruiUBADAkfkQVAAAIPgAACD4AAAg+AAAIPgAACD4AAAg+AAAIPgAACD4AAAg+AAAIPgAACD4AAAg+AADBBwAAwQcAAMEHAADBBwAAwQcAAMEHAADBBwAAwQcAQPc8QxUAGFQrKytUQohNTU0RfADQ6MqVK1RCCK2vr/fs2HR1AgCGCsEHACD4AAAg+AAAIPgAACD4AAAg+AAAIPgAACD4wsRWyjBkGCnZJ3kVKUOGUbOl2l1NUTnTkGGYyhX5BAEQfJ1+43b4ZettKZsPppuhF7e6FeB8NgAIvoOz5lu3IOwFpR0+jK4r5jRvSVJCS64rt7xlTeoGAMHXe47SC8HNBfsLi0+iF7n3cFmOpFhmRkeLOlNZPzTJTAAE30EkMsrEJFlfNI91lVsl5TIAAAx+i29C127FJFmab+jvLLdKEjevtdi3Or7UuDWPNzVMJqkdYwwcZ2w/+aSYM2UYhsy6a+7kejptouVkGoYMM6dizfmbJpqUy9Vu/j5+AeVMQ1G//9hJR1uUO/CFBUx4aXit8Zranafxc9l3DBgABi74pEhyVglJzvLDmi9EWwtpR4plNNOqC83+QlaLt6x4YyiVbWjeNGQ0zuqw4kf/gj3U9XRqUws1wdUUxtG0mt5x0oqe0EzM5Wmj+ZqctKIB4WenAj6X8mdzwrNfAXTm17/+tf72t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AAgg8AAIIPAACCDwAAgg8AAE9Pn86wsrJCDQMAOjY1NTWYwSdJV65c4RMEABzY+vp6T49PVycAYKgQfAAAgg8AAIIPAACCDwAAgg8AAIIPAACCDwAAgg8AAIIPAACCDwAAgg8AAIIPAADPM1QB0KGv3tHZxCct3ozq3a+X9dY5qgmgxQcMhbzee+Wsbn30L6oCIPiAkIm+q6+/+07f1WzWG378vXdbZB9A8AGh9+r7X+vdqNfy+3yF5AMIPiD0zinyvN/qe/x/1Zf/9ZFunT2rs7c+UlAcfvXOWZ09e1bvfNXqta/0zlnv3972jr6isgGCD+gn0QvPdeU4/7twS2fPJlQ/neYTJQg/gOADTt5X+h8/oZ6PnOvKEfP5vPSGVTOWaOkNP/wWGEgECD7g5PxLH93yW2bRdzX9aneO+ob1nb57v/Zgr2raG0is704FcCCs4wMO3RR7T6+cfa/59ei7+nr5LZ3r4anPRZ6XlOczAAg+4GRF3/1ay6xeB/oaXZ3A4VOuuo7PX8CXf++VupmZAAg+IJxefV9f++NunyRusXgdIPiA8Dv31rJ/55a83nulYanBuYiel6T8YzEdBSD4gBA1/Mp3bvlEibrF6s/pgv96/RIEb2F6y3teAyD4gD5v9+mtZX+dXf49vVIZ8Dunt2aq44DVO7Ak9ImiikapOYDgAwa33af3v35XXgMvUb1N2avvVybBVLxh6bvvljXzPLUGHJcR13VLvTr4ysqKrly5Qi0DAA5sfX1dU1NTtPgAACD4AAAg+AAAIPgAACD4AAAEHwAABB8AAAQfAAAEHwAABB8AAAQfAAAn4Zlen2B9fZ1aBgD0jZ7epBoAgH5DVycAgOADAIDgAwCA4AMAgOADAIDgAwCA4AMAgOADAIDgAwCA4AMAgOADAIDgAwCA4AMAEHwAABB8AAAQfAAAEHwAABB8AAAQfAAAEHwAABB8AAAQfAAAHM7/A/sip3ekMeOFAAAAAElFTkSuQmCC\n", + "text/plain": [ + "<FunctionGui make_matrix(Manual_ref_line: napari.layers.shapes.shapes.Shapes = None, n_cols: int = 5, n_rows: int = 5, check: bool = True, size: int = 300)>" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "make_matrix.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "ff6cc2f0-7568-4814-a687-13cb6be23c87", + "metadata": {}, + "outputs": [], + "source": [ + "v = Viewer()" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "id": "c6692e35-ebff-4624-9115-68fa6585ed44", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "<napari._qt.widgets.qt_viewer_dock_widget.QtViewerDockWidget at 0x1dc227a8a60>" + ] + }, + "execution_count": 48, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v.window.add_dock_widget(make_matrix)" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "14307285-af98-4148-ae1c-1b99fecddef9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[array([[2.30000000e+01, 1.00000000e+00, 2.00000000e+00, 7.69845734e+02,\n", + " 2.50737153e+02],\n", + " [2.30000000e+01, 1.00000000e+00, 2.00000000e+00, 3.56612270e+02,\n", + " 9.03414632e+03]])]" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v.layers[\"Shapes\"].data" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a5b1d00c-aa57-40f3-9977-1de23e28e381", + "metadata": { + "jupyter": { + "source_hidden": true + }, + "tags": [] + }, + "outputs": [], + "source": [ + "\n", + "grey = np.array([np.arange(256)] * 3, dtype='uint8')\n", + "red = np.array([np.arange(256), np.zeros((256,)), np.zeros((256,))], dtype='uint8')\n", + "green = np.array([np.zeros((256,)), np.arange(256), np.zeros((256,))], dtype='uint8')\n", + "blue = np.array([np.zeros((256,)), np.zeros((256,)), np.arange(256)], dtype='uint8')\n", + "magenta = np.array([np.arange(256), np.zeros((256,)), np.arange(256)], dtype='uint8')\n", + "yellow = red + green\n", + "\n", + "METADATA = {'ImageJ': '1.53c',\n", + " 'images': 3,\n", + " 'channels': 3,\n", + " 'hyperstack': True,\n", + " 'mode': 'composite',\n", + " 'unit': '',\n", + " 'loop': False,\n", + " 'min': 254.0,\n", + " 'max': 3165.0,\n", + " 'Ranges': (254.0, 3165.0, 60.0, 300.0, 60.0, 300.0),\n", + " 'LUTs': [ grey, yellow, green]\n", + " }\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "5b18f021-1515-479b-ae5c-1425a570bfcd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "<ND2File at 0x11c5de03400: 'LPYgalvstet.nd2' uint16: {'T': 46, 'P': 2, 'Z': 5, 'C': 2, 'Y': 5928, 'X': 9831}>" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data = nd2.ND2File('E:/Madison/LPYgalvstet.nd2')\n", + "data" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "a5b17ec4-e729-4d15-9316-9325052623ba", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "<Image layer 'slide' at 0x1358349f7c0>" + ] + }, + "execution_count": 65, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v.add_image(slide := data.to_dask()[:,0,1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "775e16d3-ae36-48bc-9f65-bbb3f5af96d8", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 43, + "id": "b05b288b-c064-45bf-b422-7aa89452852e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[ 45. , 0. , 706.2413435 , 8902.72711538],\n", + " [ 45. , 0. , 565.24692711, 4917.90037923]])" + ] + }, + "execution_count": 43, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "manual_points = v.layers[\"Points\"].data\n", + "manual_points" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "id": "bf0831bf-5cfd-4536-ad1c-b1343fab7184", + "metadata": {}, + "outputs": [], + "source": [ + "time, ch, y0, x0 = manual_points[0]\n", + "time, ch, y1, x1 = manual_points[1]\n", + "n_wells_within_01 = 5\n", + "n_rows = 6" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "id": "a2e2a49b-516e-4d78-b320-5b6f2c1f721d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([ 0. , 0. , 140.99441639, 3984.82673615]),)" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "manual_period = manual_points[0] - manual_points[1]\n", + "\n", + "manual_period, " + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "056c088e-c9ad-40ac-8368-32ea99f5c595", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([ 0. , 0. , 35.2486041 , 996.20668404]),\n", + " array([ 0. , 0. , 996.20668404, -35.2486041 ]))" + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "well_period = manual_period / (n_wells_within_01 - 1)\n", + "row_period = np.array([0,0,well_period[3], -well_period[2]])\n", + "\n", + "well_period, row_period" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "d141d0f4-af1c-4a6c-8d00-dcaa060b80d7", + "metadata": {}, + "outputs": [], + "source": [ + "extrapolated_wells = np.stack([manual_points[1] + well_period * i + row_period * j + (well_period + row_period) / 2 * k for k in range(2) for i in range(n_wells_within_01) for j in range(n_rows)])" + ] + }, + { + "cell_type": "code", + "execution_count": 68, + "id": "f6cc8a56-f6e7-48de-af74-a97eb2371eb3", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(46, 2, 5928, 9831)" + ] + }, + "execution_count": 68, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "slide.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "id": "6debf480-a364-4f05-a432-b49fe464beef", + "metadata": {}, + "outputs": [], + "source": [ + "filter_outliers = np.logical_and(extrapolated_wells[:,2]< slide.shape[2], extrapolated_wells[:,3]< slide.shape[3])" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "id": "d61aa3a7-580c-4165-a59f-120b41e6062b", + "metadata": {}, + "outputs": [], + "source": [ + "good_extrapolated_wells = extrapolated_wells[filter_outliers]" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "id": "a9a3ccff-9156-485a-9700-e060fad638b4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "<Points layer 'good_extrapolated_wells' at 0x1357f3e1640>" + ] + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "v.add_points(good_extrapolated_wells, size=500, edge_color=\"#ff0000\", face_color=\"#00000000\", symbol=\"square\")" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "id": "0c395757-2760-41ed-8821-555f6a5b3212", + "metadata": {}, + "outputs": [ + { + "ename": "TypeError", + "evalue": "world_to_data() missing 1 required positional argument: 'position'", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_4928/3178144984.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mv\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlayers\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"Points\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mworld_to_data\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;31mTypeError\u001b[0m: world_to_data() missing 1 required positional argument: 'position'" + ] + } + ], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "5604fad4-5a71-4102-ad26-0b4393d26fe7", + "metadata": {}, + "outputs": [], + "source": [ + "crop = tf.imread('E:/Madison/crops/crops_2ch/crop1.tif')" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "d63116cc-08b5-4ecc-bd6f-f6ed9cacf645", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(46, 2, 640, 640)" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "crop.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "3b570ba7-5e50-44a7-bdb6-81064679f2ee", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "AICSImageIO: Unsupported file format.\n", + "AICSImageIO: Unsupported file format.\n", + "read_zarr D:\\Lena\\20221122-ecoli-chp\\day2\\BF_TRITC_maxZ.zarr\n", + "found channel axis 1\n", + "D:\\Lena\\20221122-ecoli-chp\\day2\\BF_TRITC_maxZ.zarr\\.detections.csv doesn't exists\n", + "D:\\Lena\\20221122-ecoli-chp\\day2\\BF_TRITC_maxZ.zarr\\.droplets.csv doesn't exists\n", + "AICSImageIO: Unsupported file format.\n", + "AICSImageIO: Unsupported file format.\n", + "read_zarr D:\\Lena\\20221122-ecoli-chp\\day1\\BF_TRITC_aligned.zarr\n", + "found channel axis 1\n", + "D:\\Lena\\20221122-ecoli-chp\\day1\\BF_TRITC_aligned.zarr\\.detections.csv doesn't exists\n", + "D:\\Lena\\20221122-ecoli-chp\\day1\\BF_TRITC_aligned.zarr\\.droplets.csv doesn't exists\n", + "AICSImageIO: Unsupported file format.\n", + "AICSImageIO: Unsupported file format.\n", + "read_zarr D:\\Lena\\20221122-ecoli-chp\\day2\\BF_TRITC_aligned.zarr\n", + "found channel axis 1\n", + "D:\\Lena\\20221122-ecoli-chp\\day2\\BF_TRITC_aligned.zarr\\.detections.csv doesn't exists\n", + "D:\\Lena\\20221122-ecoli-chp\\day2\\BF_TRITC_aligned.zarr\\.droplets.csv doesn't exists\n" + ] + } + ], + "source": [ + "tf.imwrite('E:/Madison/crops/crops_2ch/crop1_IJ.tif', crop[:].reshape((46, 1,2,640,640)), imagej=True,)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "83bf2b73-04bf-436e-9aef-713d95565d63", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "<ND2File at 0x20a797fb100: 'LPYgalvstet.nd2' uint16: {'T': 46, 'P': 2, 'Z': 5, 'C': 2, 'Y': 5928, 'X': 9831}>" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "2ac497cf-1027-48f5-a2d2-0af0f034718a", + "metadata": {}, + "outputs": [], + "source": [ + "d = data.to_dask()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "58b29899-9962-4e7f-8ef6-b0ba9abe7443", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<table>\n", + " <tr>\n", + " <td>\n", + " <table>\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> 99.87 GiB </td>\n", + " <td> 222.31 MiB </td>\n", + " </tr>\n", + " \n", + " <tr>\n", + " <th> Shape </th>\n", + " <td> (46, 2, 5, 2, 5928, 9831) </td>\n", + " <td> (1, 1, 1, 2, 5928, 9831) </td>\n", + " </tr>\n", + " <tr>\n", + " <th> Count </th>\n", + " <td> 920 Tasks </td>\n", + " <td> 460 Chunks </td>\n", + " </tr>\n", + " <tr>\n", + " <th> Type </th>\n", + " <td> uint16 </td>\n", + " <td> numpy.ndarray </td>\n", + " </tr>\n", + " </tbody>\n", + " </table>\n", + " </td>\n", + " <td>\n", + " <svg width=\"424\" height=\"137\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"10\" y1=\"12\" x2=\"24\" y2=\"27\" />\n", + " <line x1=\"10\" y1=\"25\" x2=\"24\" y2=\"40\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" style=\"stroke-width:2\" />\n", + " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"25\" />\n", + " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"26\" />\n", + " <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"26\" />\n", + " <line x1=\"11\" y1=\"1\" x2=\"11\" y2=\"27\" />\n", + " <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"27\" />\n", + " <line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"28\" />\n", + " <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"28\" />\n", + " <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"28\" />\n", + " <line x1=\"13\" y1=\"3\" x2=\"13\" y2=\"29\" />\n", + " <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"29\" />\n", + " <line x1=\"14\" y1=\"4\" x2=\"14\" y2=\"30\" />\n", + " <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"30\" />\n", + " <line x1=\"15\" y1=\"5\" x2=\"15\" y2=\"31\" />\n", + " <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"31\" />\n", + " <line x1=\"16\" y1=\"6\" x2=\"16\" y2=\"32\" />\n", + " <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"32\" />\n", + " <line x1=\"17\" y1=\"7\" x2=\"17\" y2=\"33\" />\n", + " <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"33\" />\n", + " <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"34\" />\n", + " <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"34\" />\n", + " <line x1=\"19\" y1=\"9\" x2=\"19\" y2=\"35\" />\n", + " <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"35\" />\n", + " <line x1=\"20\" y1=\"10\" x2=\"20\" y2=\"36\" />\n", + " <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"36\" />\n", + " <line x1=\"21\" y1=\"11\" x2=\"21\" y2=\"36\" />\n", + " <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"37\" />\n", + " <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"37\" />\n", + " <line x1=\"22\" y1=\"12\" x2=\"22\" y2=\"38\" />\n", + " <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"38\" />\n", + " <line x1=\"23\" y1=\"13\" x2=\"23\" y2=\"39\" />\n", + " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"39\" />\n", + " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"40\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"10.0,0.0 24.9485979497544,14.948597949754403 24.9485979497544,40.36121446433689 10.0,25.412616514582485\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" style=\"stroke-width:2\" />\n", + " <line x1=\"10\" y1=\"0\" x2=\"35\" y2=\"0\" />\n", + " <line x1=\"10\" y1=\"0\" x2=\"36\" y2=\"0\" />\n", + " <line x1=\"11\" y1=\"1\" x2=\"36\" y2=\"1\" />\n", + " <line x1=\"11\" y1=\"1\" x2=\"37\" y2=\"1\" />\n", + " <line x1=\"12\" y1=\"2\" x2=\"37\" y2=\"2\" />\n", + " <line x1=\"12\" y1=\"2\" x2=\"38\" y2=\"2\" />\n", + " <line x1=\"13\" y1=\"3\" x2=\"38\" y2=\"3\" />\n", + " <line x1=\"13\" y1=\"3\" x2=\"38\" y2=\"3\" />\n", + " <line x1=\"13\" y1=\"3\" x2=\"39\" y2=\"3\" />\n", + " <line x1=\"14\" y1=\"4\" x2=\"39\" y2=\"4\" />\n", + " <line x1=\"14\" y1=\"4\" x2=\"40\" y2=\"4\" />\n", + " <line x1=\"15\" y1=\"5\" x2=\"40\" y2=\"5\" />\n", + " <line x1=\"15\" y1=\"5\" x2=\"41\" y2=\"5\" />\n", + " <line x1=\"16\" y1=\"6\" x2=\"41\" y2=\"6\" />\n", + " <line x1=\"16\" y1=\"6\" x2=\"42\" y2=\"6\" />\n", + " <line x1=\"17\" y1=\"7\" x2=\"42\" y2=\"7\" />\n", + " <line x1=\"17\" y1=\"7\" x2=\"43\" y2=\"7\" />\n", + " <line x1=\"18\" y1=\"8\" x2=\"43\" y2=\"8\" />\n", + " <line x1=\"18\" y1=\"8\" x2=\"44\" y2=\"8\" />\n", + " <line x1=\"19\" y1=\"9\" x2=\"44\" y2=\"9\" />\n", + " <line x1=\"19\" y1=\"9\" x2=\"45\" y2=\"9\" />\n", + " <line x1=\"20\" y1=\"10\" x2=\"45\" y2=\"10\" />\n", + " <line x1=\"20\" y1=\"10\" x2=\"46\" y2=\"10\" />\n", + " <line x1=\"21\" y1=\"11\" x2=\"46\" y2=\"11\" />\n", + " <line x1=\"21\" y1=\"11\" x2=\"46\" y2=\"11\" />\n", + " <line x1=\"22\" y1=\"12\" x2=\"47\" y2=\"12\" />\n", + " <line x1=\"22\" y1=\"12\" x2=\"47\" y2=\"12\" />\n", + " <line x1=\"22\" y1=\"12\" x2=\"48\" y2=\"12\" />\n", + " <line x1=\"23\" y1=\"13\" x2=\"48\" y2=\"13\" />\n", + " <line x1=\"23\" y1=\"13\" x2=\"49\" y2=\"13\" />\n", + " <line x1=\"24\" y1=\"14\" x2=\"49\" y2=\"14\" />\n", + " <line x1=\"24\" y1=\"14\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"10\" y1=\"0\" x2=\"24\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"15\" y1=\"0\" x2=\"30\" y2=\"14\" />\n", + " <line x1=\"20\" y1=\"0\" x2=\"35\" y2=\"14\" />\n", + " <line x1=\"25\" y1=\"0\" x2=\"40\" y2=\"14\" />\n", + " <line x1=\"30\" y1=\"0\" x2=\"45\" y2=\"14\" />\n", + " <line x1=\"35\" y1=\"0\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"10.0,0.0 35.41261651458248,0.0 50.36121446433688,14.948597949754403 24.9485979497544,14.948597949754403\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"24\" y1=\"14\" x2=\"50\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"24\" y1=\"27\" x2=\"50\" y2=\"27\" />\n", + " <line x1=\"24\" y1=\"40\" x2=\"50\" y2=\"40\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"24\" y1=\"14\" x2=\"24\" y2=\"40\" style=\"stroke-width:2\" />\n", + " <line x1=\"30\" y1=\"14\" x2=\"30\" y2=\"40\" />\n", + " <line x1=\"35\" y1=\"14\" x2=\"35\" y2=\"40\" />\n", + " <line x1=\"40\" y1=\"14\" x2=\"40\" y2=\"40\" />\n", + " <line x1=\"45\" y1=\"14\" x2=\"45\" y2=\"40\" />\n", + " <line x1=\"50\" y1=\"14\" x2=\"50\" y2=\"40\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"24.9485979497544,14.948597949754403 50.36121446433688,14.948597949754403 50.36121446433688,40.36121446433689 24.9485979497544,40.36121446433689\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Text -->\n", + " <text x=\"37.654906\" y=\"60.361214\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >5</text>\n", + " <text x=\"70.361214\" y=\"27.654906\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,70.361214,27.654906)\">2</text>\n", + " <text x=\"7.474299\" y=\"52.886915\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,7.474299,52.886915)\">46</text>\n", + "\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"120\" y1=\"0\" x2=\"134\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"120\" y1=\"72\" x2=\"134\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"120\" y1=\"0\" x2=\"120\" y2=\"72\" style=\"stroke-width:2\" />\n", + " <line x1=\"134\" y1=\"14\" x2=\"134\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"120.0,0.0 134.9485979497544,14.948597949754403 134.9485979497544,87.30746276513432 120.0,72.35886481537992\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"120\" y1=\"0\" x2=\"240\" y2=\"0\" style=\"stroke-width:2\" />\n", + " <line x1=\"134\" y1=\"14\" x2=\"254\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"120\" y1=\"0\" x2=\"134\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"240\" y1=\"0\" x2=\"254\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"120.0,0.0 240.0,0.0 254.9485979497544,14.948597949754403 134.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"134\" y1=\"14\" x2=\"254\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"134\" y1=\"87\" x2=\"254\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"134\" y1=\"14\" x2=\"134\" y2=\"87\" style=\"stroke-width:2\" />\n", + " <line x1=\"254\" y1=\"14\" x2=\"254\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"134.9485979497544,14.948597949754403 254.9485979497544,14.948597949754403 254.9485979497544,87.30746276513432 134.9485979497544,87.30746276513432\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Text -->\n", + " <text x=\"194.948598\" y=\"107.307463\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >9831</text>\n", + " <text x=\"274.948598\" y=\"51.128030\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,274.948598,51.128030)\">5928</text>\n", + " <text x=\"117.474299\" y=\"99.833164\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,117.474299,99.833164)\">2</text>\n", + "</svg>\n", + " </td>\n", + " </tr>\n", + "</table>" + ], + "text/plain": [ + "dask.array<_dask_block, shape=(46, 2, 5, 2, 5928, 9831), dtype=uint16, chunksize=(1, 1, 1, 2, 5928, 9831), chunktype=numpy.ndarray>" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "0b5baecc-a2be-49d6-8451-0bc26b06ca6c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<table>\n", + " <tr>\n", + " <td>\n", + " <table>\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> 9.99 GiB </td>\n", + " <td> 222.31 MiB </td>\n", + " </tr>\n", + " \n", + " <tr>\n", + " <th> Shape </th>\n", + " <td> (46, 2, 5928, 9831) </td>\n", + " <td> (1, 2, 5928, 9831) </td>\n", + " </tr>\n", + " <tr>\n", + " <th> Count </th>\n", + " <td> 966 Tasks </td>\n", + " <td> 46 Chunks </td>\n", + " </tr>\n", + " <tr>\n", + " <th> Type </th>\n", + " <td> uint16 </td>\n", + " <td> numpy.ndarray </td>\n", + " </tr>\n", + " </tbody>\n", + " </table>\n", + " </td>\n", + " <td>\n", + " <svg width=\"374\" height=\"137\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"0\" y1=\"0\" x2=\"25\" y2=\"0\" style=\"stroke-width:2\" />\n", + " <line x1=\"0\" y1=\"25\" x2=\"25\" y2=\"25\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"25\" style=\"stroke-width:2\" />\n", + " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"25\" />\n", + " <line x1=\"1\" y1=\"0\" x2=\"1\" y2=\"25\" />\n", + " <line x1=\"2\" y1=\"0\" x2=\"2\" y2=\"25\" />\n", + " <line x1=\"2\" y1=\"0\" x2=\"2\" y2=\"25\" />\n", + " <line x1=\"3\" y1=\"0\" x2=\"3\" y2=\"25\" />\n", + " <line x1=\"4\" y1=\"0\" x2=\"4\" y2=\"25\" />\n", + " <line x1=\"5\" y1=\"0\" x2=\"5\" y2=\"25\" />\n", + " <line x1=\"6\" y1=\"0\" x2=\"6\" y2=\"25\" />\n", + " <line x1=\"6\" y1=\"0\" x2=\"6\" y2=\"25\" />\n", + " <line x1=\"7\" y1=\"0\" x2=\"7\" y2=\"25\" />\n", + " <line x1=\"8\" y1=\"0\" x2=\"8\" y2=\"25\" />\n", + " <line x1=\"9\" y1=\"0\" x2=\"9\" y2=\"25\" />\n", + " <line x1=\"9\" y1=\"0\" x2=\"9\" y2=\"25\" />\n", + " <line x1=\"11\" y1=\"0\" x2=\"11\" y2=\"25\" />\n", + " <line x1=\"11\" y1=\"0\" x2=\"11\" y2=\"25\" />\n", + " <line x1=\"12\" y1=\"0\" x2=\"12\" y2=\"25\" />\n", + " <line x1=\"13\" y1=\"0\" x2=\"13\" y2=\"25\" />\n", + " <line x1=\"13\" y1=\"0\" x2=\"13\" y2=\"25\" />\n", + " <line x1=\"14\" y1=\"0\" x2=\"14\" y2=\"25\" />\n", + " <line x1=\"15\" y1=\"0\" x2=\"15\" y2=\"25\" />\n", + " <line x1=\"16\" y1=\"0\" x2=\"16\" y2=\"25\" />\n", + " <line x1=\"17\" y1=\"0\" x2=\"17\" y2=\"25\" />\n", + " <line x1=\"18\" y1=\"0\" x2=\"18\" y2=\"25\" />\n", + " <line x1=\"18\" y1=\"0\" x2=\"18\" y2=\"25\" />\n", + " <line x1=\"19\" y1=\"0\" x2=\"19\" y2=\"25\" />\n", + " <line x1=\"20\" y1=\"0\" x2=\"20\" y2=\"25\" />\n", + " <line x1=\"20\" y1=\"0\" x2=\"20\" y2=\"25\" />\n", + " <line x1=\"22\" y1=\"0\" x2=\"22\" y2=\"25\" />\n", + " <line x1=\"22\" y1=\"0\" x2=\"22\" y2=\"25\" />\n", + " <line x1=\"23\" y1=\"0\" x2=\"23\" y2=\"25\" />\n", + " <line x1=\"24\" y1=\"0\" x2=\"24\" y2=\"25\" />\n", + " <line x1=\"25\" y1=\"0\" x2=\"25\" y2=\"25\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"0.0,0.0 25.412616514582485,0.0 25.412616514582485,25.412616514582485 0.0,25.412616514582485\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n", + "\n", + " <!-- Text -->\n", + " <text x=\"12.706308\" y=\"45.412617\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >46</text>\n", + " <text x=\"45.412617\" y=\"12.706308\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,45.412617,12.706308)\">1</text>\n", + "\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"109\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"95\" y1=\"72\" x2=\"109\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"95\" y2=\"72\" style=\"stroke-width:2\" />\n", + " <line x1=\"109\" y1=\"14\" x2=\"109\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"95.0,0.0 109.9485979497544,14.948597949754403 109.9485979497544,87.30746276513432 95.0,72.35886481537992\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"215\" y2=\"0\" style=\"stroke-width:2\" />\n", + " <line x1=\"109\" y1=\"14\" x2=\"229\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"109\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"215\" y1=\"0\" x2=\"229\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"95.0,0.0 215.0,0.0 229.9485979497544,14.948597949754403 109.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"109\" y1=\"14\" x2=\"229\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"109\" y1=\"87\" x2=\"229\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"109\" y1=\"14\" x2=\"109\" y2=\"87\" style=\"stroke-width:2\" />\n", + " <line x1=\"229\" y1=\"14\" x2=\"229\" y2=\"87\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"109.9485979497544,14.948597949754403 229.9485979497544,14.948597949754403 229.9485979497544,87.30746276513432 109.9485979497544,87.30746276513432\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Text -->\n", + " <text x=\"169.948598\" y=\"107.307463\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >9831</text>\n", + " <text x=\"249.948598\" y=\"51.128030\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,249.948598,51.128030)\">5928</text>\n", + " <text x=\"92.474299\" y=\"99.833164\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,92.474299,99.833164)\">2</text>\n", + "</svg>\n", + " </td>\n", + " </tr>\n", + "</table>" + ], + "text/plain": [ + "dask.array<getitem, shape=(46, 2, 5928, 9831), dtype=uint16, chunksize=(1, 2, 5928, 9831), chunktype=numpy.ndarray>" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "d[:,0,0]" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "7ac4aa10-cae4-471e-bc3b-29a450d2d0ee", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "<table>\n", + " <tr>\n", + " <td>\n", + " <table>\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> 28.54 GiB </td>\n", + " <td> 23.95 MiB </td>\n", + " </tr>\n", + " \n", + " <tr>\n", + " <th> Shape </th>\n", + " <td> (61, 20, 3, 2044, 2048) </td>\n", + " <td> (1, 1, 3, 2044, 2048) </td>\n", + " </tr>\n", + " <tr>\n", + " <th> Count </th>\n", + " <td> 61000 Tasks </td>\n", + " <td> 1220 Chunks </td>\n", + " </tr>\n", + " <tr>\n", + " <th> Type </th>\n", + " <td> uint16 </td>\n", + " <td> numpy.ndarray </td>\n", + " </tr>\n", + " </tbody>\n", + " </table>\n", + " </td>\n", + " <td>\n", + " <svg width=\"374\" height=\"184\" style=\"stroke:rgb(0,0,0);stroke-width:1\" >\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"0\" y1=\"0\" x2=\"25\" y2=\"0\" style=\"stroke-width:2\" />\n", + " <line x1=\"0\" y1=\"0\" x2=\"25\" y2=\"0\" />\n", + " <line x1=\"0\" y1=\"1\" x2=\"25\" y2=\"1\" />\n", + " <line x1=\"0\" y1=\"2\" x2=\"25\" y2=\"2\" />\n", + " <line x1=\"0\" y1=\"3\" x2=\"25\" y2=\"3\" />\n", + " <line x1=\"0\" y1=\"4\" x2=\"25\" y2=\"4\" />\n", + " <line x1=\"0\" y1=\"5\" x2=\"25\" y2=\"5\" />\n", + " <line x1=\"0\" y1=\"6\" x2=\"25\" y2=\"6\" />\n", + " <line x1=\"0\" y1=\"7\" x2=\"25\" y2=\"7\" />\n", + " <line x1=\"0\" y1=\"8\" x2=\"25\" y2=\"8\" />\n", + " <line x1=\"0\" y1=\"9\" x2=\"25\" y2=\"9\" />\n", + " <line x1=\"0\" y1=\"10\" x2=\"25\" y2=\"10\" />\n", + " <line x1=\"0\" y1=\"11\" x2=\"25\" y2=\"11\" />\n", + " <line x1=\"0\" y1=\"12\" x2=\"25\" y2=\"12\" />\n", + " <line x1=\"0\" y1=\"13\" x2=\"25\" y2=\"13\" />\n", + " <line x1=\"0\" y1=\"14\" x2=\"25\" y2=\"14\" />\n", + " <line x1=\"0\" y1=\"15\" x2=\"25\" y2=\"15\" />\n", + " <line x1=\"0\" y1=\"16\" x2=\"25\" y2=\"16\" />\n", + " <line x1=\"0\" y1=\"17\" x2=\"25\" y2=\"17\" />\n", + " <line x1=\"0\" y1=\"18\" x2=\"25\" y2=\"18\" />\n", + " <line x1=\"0\" y1=\"19\" x2=\"25\" y2=\"19\" />\n", + " <line x1=\"0\" y1=\"20\" x2=\"25\" y2=\"20\" />\n", + " <line x1=\"0\" y1=\"21\" x2=\"25\" y2=\"21\" />\n", + " <line x1=\"0\" y1=\"22\" x2=\"25\" y2=\"22\" />\n", + " <line x1=\"0\" y1=\"23\" x2=\"25\" y2=\"23\" />\n", + " <line x1=\"0\" y1=\"24\" x2=\"25\" y2=\"24\" />\n", + " <line x1=\"0\" y1=\"25\" x2=\"25\" y2=\"25\" />\n", + " <line x1=\"0\" y1=\"26\" x2=\"25\" y2=\"26\" />\n", + " <line x1=\"0\" y1=\"27\" x2=\"25\" y2=\"27\" />\n", + " <line x1=\"0\" y1=\"28\" x2=\"25\" y2=\"28\" />\n", + " <line x1=\"0\" y1=\"29\" x2=\"25\" y2=\"29\" />\n", + " <line x1=\"0\" y1=\"30\" x2=\"25\" y2=\"30\" />\n", + " <line x1=\"0\" y1=\"31\" x2=\"25\" y2=\"31\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"31\" style=\"stroke-width:2\" />\n", + " <line x1=\"1\" y1=\"0\" x2=\"1\" y2=\"31\" />\n", + " <line x1=\"2\" y1=\"0\" x2=\"2\" y2=\"31\" />\n", + " <line x1=\"3\" y1=\"0\" x2=\"3\" y2=\"31\" />\n", + " <line x1=\"5\" y1=\"0\" x2=\"5\" y2=\"31\" />\n", + " <line x1=\"6\" y1=\"0\" x2=\"6\" y2=\"31\" />\n", + " <line x1=\"7\" y1=\"0\" x2=\"7\" y2=\"31\" />\n", + " <line x1=\"8\" y1=\"0\" x2=\"8\" y2=\"31\" />\n", + " <line x1=\"10\" y1=\"0\" x2=\"10\" y2=\"31\" />\n", + " <line x1=\"11\" y1=\"0\" x2=\"11\" y2=\"31\" />\n", + " <line x1=\"12\" y1=\"0\" x2=\"12\" y2=\"31\" />\n", + " <line x1=\"13\" y1=\"0\" x2=\"13\" y2=\"31\" />\n", + " <line x1=\"15\" y1=\"0\" x2=\"15\" y2=\"31\" />\n", + " <line x1=\"16\" y1=\"0\" x2=\"16\" y2=\"31\" />\n", + " <line x1=\"17\" y1=\"0\" x2=\"17\" y2=\"31\" />\n", + " <line x1=\"19\" y1=\"0\" x2=\"19\" y2=\"31\" />\n", + " <line x1=\"20\" y1=\"0\" x2=\"20\" y2=\"31\" />\n", + " <line x1=\"21\" y1=\"0\" x2=\"21\" y2=\"31\" />\n", + " <line x1=\"22\" y1=\"0\" x2=\"22\" y2=\"31\" />\n", + " <line x1=\"24\" y1=\"0\" x2=\"24\" y2=\"31\" />\n", + " <line x1=\"25\" y1=\"0\" x2=\"25\" y2=\"31\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"0.0,0.0 25.412616514582485,0.0 25.412616514582485,31.347380743100317 0.0,31.347380743100317\" style=\"fill:#8B4903A0;stroke-width:0\"/>\n", + "\n", + " <!-- Text -->\n", + " <text x=\"12.706308\" y=\"51.347381\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >20</text>\n", + " <text x=\"45.412617\" y=\"15.673690\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(0,45.412617,15.673690)\">61</text>\n", + "\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"109\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"95\" y1=\"119\" x2=\"109\" y2=\"134\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"95\" y2=\"119\" style=\"stroke-width:2\" />\n", + " <line x1=\"109\" y1=\"14\" x2=\"109\" y2=\"134\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"95.0,0.0 109.9485979497544,14.948597949754403 109.9485979497544,134.7142229497544 95.0,119.765625\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"215\" y2=\"0\" style=\"stroke-width:2\" />\n", + " <line x1=\"109\" y1=\"14\" x2=\"229\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"95\" y1=\"0\" x2=\"109\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"215\" y1=\"0\" x2=\"229\" y2=\"14\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"95.0,0.0 215.0,0.0 229.9485979497544,14.948597949754403 109.9485979497544,14.948597949754403\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Horizontal lines -->\n", + " <line x1=\"109\" y1=\"14\" x2=\"229\" y2=\"14\" style=\"stroke-width:2\" />\n", + " <line x1=\"109\" y1=\"134\" x2=\"229\" y2=\"134\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Vertical lines -->\n", + " <line x1=\"109\" y1=\"14\" x2=\"109\" y2=\"134\" style=\"stroke-width:2\" />\n", + " <line x1=\"229\" y1=\"14\" x2=\"229\" y2=\"134\" style=\"stroke-width:2\" />\n", + "\n", + " <!-- Colored Rectangle -->\n", + " <polygon points=\"109.9485979497544,14.948597949754403 229.9485979497544,14.948597949754403 229.9485979497544,134.7142229497544 109.9485979497544,134.7142229497544\" style=\"fill:#ECB172A0;stroke-width:0\"/>\n", + "\n", + " <!-- Text -->\n", + " <text x=\"169.948598\" y=\"154.714223\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" >2048</text>\n", + " <text x=\"249.948598\" y=\"74.831410\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(-90,249.948598,74.831410)\">2044</text>\n", + " <text x=\"92.474299\" y=\"147.239924\" font-size=\"1.0rem\" font-weight=\"100\" text-anchor=\"middle\" transform=\"rotate(45,92.474299,147.239924)\">3</text>\n", + "</svg>\n", + " </td>\n", + " </tr>\n", + "</table>" + ], + "text/plain": [ + "dask.array<amax-aggregate, shape=(61, 20, 3, 2044, 2048), dtype=uint16, chunksize=(1, 1, 3, 2044, 2048), chunktype=numpy.ndarray>" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dmax" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "3d68df4f-e5a6-455c-bf62-d687b3e2045c", + "metadata": { + "collapsed": true, + "jupyter": { + "outputs_hidden": true + }, + "tags": [] + }, + "outputs": [ + { + "ename": "KeyboardInterrupt", + "evalue": "", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_9516/3234368865.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;33m[\u001b[0m\u001b[0mtf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mimwrite\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mf'F:/Madison/2022-09-30_Cas9induction_positions/pos{i:02d}.tif'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdmax\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreshape\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdmax\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2044\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2048\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mimagej\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mMETADATA\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdmax\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_9516/3234368865.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[1;34m(.0)\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;33m[\u001b[0m\u001b[0mtf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mimwrite\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34mf'F:/Madison/2022-09-30_Cas9induction_positions/pos{i:02d}.tif'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdmax\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreshape\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdmax\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m3\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2044\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m2048\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mimagej\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmetadata\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mMETADATA\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdmax\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\tifffile\\tifffile.py\u001b[0m in \u001b[0;36mimwrite\u001b[1;34m(file, data, shape, dtype, **kwargs)\u001b[0m\n\u001b[0;32m 964\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 965\u001b[0m \u001b[1;32mwith\u001b[0m \u001b[0mTiffWriter\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfile\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mtifargs\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mtif\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 966\u001b[1;33m \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mtif\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwrite\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mshape\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 967\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 968\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\tifffile\\tifffile.py\u001b[0m in \u001b[0;36mwrite\u001b[1;34m(self, data, shape, dtype, photometric, planarconfig, extrasamples, volumetric, tile, contiguous, truncate, align, rowsperstrip, bitspersample, compression, predictor, subsampling, jpegtables, colormap, description, datetime, resolution, subfiletype, software, subifds, metadata, extratags, returnoffset, ijmetadata, compress)\u001b[0m\n\u001b[0;32m 1501\u001b[0m \u001b[1;31m# must be C-contiguous numpy array of TIFF byteorder\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1502\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mhasattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'dtype'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1503\u001b[1;33m \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0masarray\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mbyteorder\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mchar\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'C'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1504\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1505\u001b[0m \u001b[0mdatadtype\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnumpy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnewbyteorder\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mbyteorder\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\dask\\array\\core.py\u001b[0m in \u001b[0;36m__array__\u001b[1;34m(self, dtype, **kwargs)\u001b[0m\n\u001b[0;32m 1579\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1580\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0m__array__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1581\u001b[1;33m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcompute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1582\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mdtype\u001b[0m \u001b[1;32mand\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdtype\u001b[0m \u001b[1;33m!=\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1583\u001b[0m \u001b[0mx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mx\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mastype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\dask\\base.py\u001b[0m in \u001b[0;36mcompute\u001b[1;34m(self, **kwargs)\u001b[0m\n\u001b[0;32m 286\u001b[0m \u001b[0mdask\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mbase\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcompute\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 287\u001b[0m \"\"\"\n\u001b[1;32m--> 288\u001b[1;33m \u001b[1;33m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcompute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtraverse\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 289\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 290\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\dask\\base.py\u001b[0m in \u001b[0;36mcompute\u001b[1;34m(traverse, optimize_graph, scheduler, get, *args, **kwargs)\u001b[0m\n\u001b[0;32m 569\u001b[0m \u001b[0mpostcomputes\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__dask_postcompute__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 570\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 571\u001b[1;33m \u001b[0mresults\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mschedule\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdsk\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkeys\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 572\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mrepack\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mf\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mr\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mf\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mzip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresults\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpostcomputes\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 573\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\dask\\threaded.py\u001b[0m in \u001b[0;36mget\u001b[1;34m(dsk, result, cache, num_workers, pool, **kwargs)\u001b[0m\n\u001b[0;32m 77\u001b[0m \u001b[0mpool\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mMultiprocessingPoolExecutor\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpool\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 78\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 79\u001b[1;33m results = get_async(\n\u001b[0m\u001b[0;32m 80\u001b[0m \u001b[0mpool\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msubmit\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 81\u001b[0m \u001b[0mpool\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_max_workers\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\dask\\local.py\u001b[0m in \u001b[0;36mget_async\u001b[1;34m(submit, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, chunksize, **kwargs)\u001b[0m\n\u001b[0;32m 494\u001b[0m \u001b[1;32mwhile\u001b[0m \u001b[0mstate\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"waiting\"\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mstate\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"ready\"\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mstate\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"running\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 495\u001b[0m \u001b[0mfire_tasks\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mchunksize\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 496\u001b[1;33m \u001b[1;32mfor\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mres_info\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfailed\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mqueue_get\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mqueue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mresult\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 497\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mfailed\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 498\u001b[0m \u001b[0mexc\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtb\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mloads\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mres_info\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\site-packages\\dask\\local.py\u001b[0m in \u001b[0;36mqueue_get\u001b[1;34m(q)\u001b[0m\n\u001b[0;32m 124\u001b[0m \u001b[1;32mwhile\u001b[0m \u001b[1;32mTrue\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 125\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 126\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mq\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mblock\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0.1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 127\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mEmpty\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 128\u001b[0m \u001b[1;32mpass\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\queue.py\u001b[0m in \u001b[0;36mget\u001b[1;34m(self, block, timeout)\u001b[0m\n\u001b[0;32m 177\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mremaining\u001b[0m \u001b[1;33m<=\u001b[0m \u001b[1;36m0.0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 178\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mEmpty\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 179\u001b[1;33m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnot_empty\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwait\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mremaining\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 180\u001b[0m \u001b[0mitem\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_get\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 181\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnot_full\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnotify\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\miniconda3\\envs\\nd2\\lib\\threading.py\u001b[0m in \u001b[0;36mwait\u001b[1;34m(self, timeout)\u001b[0m\n\u001b[0;32m 304\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 305\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0mtimeout\u001b[0m \u001b[1;33m>\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 306\u001b[1;33m \u001b[0mgotit\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mwaiter\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0macquire\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 307\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 308\u001b[0m \u001b[0mgotit\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mwaiter\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0macquire\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mKeyboardInterrupt\u001b[0m: " + ] + } + ], + "source": [ + "[tf.imwrite(f'F:/Madison/2022-09-30_Cas9induction_positions/pos{i:02d}.tif', data=dmax[:,i].reshape((dmax.shape[0],1,3,2044,2048)), imagej=True, metadata=METADATA) for i in range(dmax.shape[1])]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1b91bc70-eccb-4374-a447-70d4e194d45c", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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.8.12" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}