diff --git a/docs_source/pages/notebooks/Image_Segmentation/Image_Segmentation_2.ipynb b/docs_source/pages/notebooks/Image_Segmentation/Image_Segmentation_2.ipynb index e3801b4..2231e59 100644 --- a/docs_source/pages/notebooks/Image_Segmentation/Image_Segmentation_2.ipynb +++ b/docs_source/pages/notebooks/Image_Segmentation/Image_Segmentation_2.ipynb @@ -2,10 +2,1330 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Processing cell sets in serial\n", + "{'classes': array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n", + " 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,\n", + " 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,\n", + " 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\n", + " 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,\n", + " 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n", + " 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,\n", + " 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,\n", + " 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,\n", + " 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,\n", + " 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,\n", + " 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,\n", + " 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,\n", + " 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,\n", + " 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,\n", + " 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,\n", + " 208], dtype=uint32), 'well': 'A1', 'classes_loaded': array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n", + " 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,\n", + " 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,\n", + " 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\n", + " 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,\n", + " 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,\n", + " 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,\n", + " 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,\n", + " 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,\n", + " 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,\n", + " 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,\n", + " 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,\n", + " 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,\n", + " 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,\n", + " 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,\n", + " 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,\n", + " 208], dtype=uint32)}\n", + "Merging intersecting shapes\n", + "center [array([nan, nan]), array([254.76721557, 698.56511976]), array([259.86753352, 409.69077611]), array([971.21844212, 459.56850369]), array([808.73684211, 946.92652085]), array([577.1920051 , 875.92642994]), array([265.03432589, 794.77894955]), array([578.27648202, 691.23663751]), array([486.59353664, 814.73441056]), array([664.48059521, 172.23929218]), array([335.05842391, 178.73686594]), array([858.7820765 , 882.90710383]), array([786.31519811, 978.77291543]), array([680.61261521, 845.88968894]), array([322.44490961, 43.24833492]), array([796.06549865, 887.22857143]), array([810.90721649, 119.59579848]), array([948.39975939, 934.37629973]), array([801.63590277, 43.43897049]), array([311.61059908, 759.73271889]), array([300.8918239 , 683.47127883]), array([590.62323391, 654.55180534]), array([914.94124773, 83.77286493]), array([512.23794489, 760.326062 ]), array([832.82862614, 822.127573 ]), array([768.82518641, 836.79756973]), array([258.92831921, 192.21327684]), array([949.87645286, 811.15368059]), array([214.41928934, 38.47055838]), array([863.43673852, 25.62980319]), array([282.42857143, 152.08109041]), array([112.8 , 243.51277955]), array([388.86646786, 753.79092114]), array([909.45791726, 21.53994294]), array([138.27740333, 189.54664775]), array([236.80669822, 316.89588642]), array([457.36380256, 742.83494385]), array([379.89669565, 684.66608696]), array([941.2333691, 853.8318133]), array([792.44200826, 764.04353352]), array([372.67908585, 810.7015556 ]), array([721.05746061, 94.54958295]), array([260.83376736, 86.98177083]), array([588.71497429, 504.77506427]), array([ 32.70134357, 716.76353167]), array([231.66963979, 537.12830189]), array([215.77467973, 108.74943482]), array([962.0181512 , 296.61002994]), array([310.76724592, 108.87756714]), array([410.45078106, 177.09273494]), array([169.25554608, 40.26834471]), array([923.33658945, 489.40217695]), array([268.27536809, 596.44846797]), array([581.38500421, 332.93723673]), array([846.78963186, 366.03681443]), array([290.69854338, 247.70234326]), array([ 72.49832916, 653.1641604 ]), array([ 75.20036765, 696.79181985]), array([380.91624041, 864.59910486]), array([683.28912072, 310.39940387]), array([180.93641405, 502.57486137]), array([783.74387378, 176.85968446]), array([650.83090564, 474.75585814]), array([204.72460757, 184.75738689]), array([116.71347518, 677.6141844 ]), array([659.7388535, 751.8 ]), array([752.50862069, 243.74956897]), array([452.41038118, 660.39497161]), array([710.61199455, 130.16310768]), array([682.2547736 , 536.30114566]), array([424.40207101, 706.56390533]), array([654.72253923, 45.76997147]), array([383.67131829, 952.36965558]), array([416.69281046, 534.00068799]), array([ 50.0992677 , 759.16219148]), array([843.37941034, 245.93813436]), array([520.67570216, 534.40496408]), array([384.6075188 , 213.39448622]), array([778.6497442 , 296.09130264]), array([697.75906555, 424.02824268]), array([ 96.42394015, 614.42679017]), array([453.77979275, 148.67764619]), array([474.19917127, 266.91712707]), array([199.55519481, 261.64805195]), array([519.2106309 , 578.78688525]), array([529.97727273, 956.77475248]), array([245.9480585 , 18.07009581]), array([431.50352243, 339.79644049]), array([158.76799264, 880.09473442]), array([874.13658112, 397.48629839]), array([926.24421594, 137.66580977]), array([957.26803776, 388.85030344]), array([393.53264185, 410.5823673 ]), array([899.29216655, 315.17360621]), array([386.54567212, 909.79218189]), array([608.68261965, 292.45675903]), array([231.72485836, 970.42351275]), array([578.30427699, 106.36782077]), array([221.01459362, 844.40435564]), array([179.2144714 , 552.52079723]), array([769.27152956, 367.99742931]), array([718.46068848, 684.64300892]), array([201.7428262 , 611.43313481]), array([335.0674189 , 341.04118477]), array([356.5994152 , 268.59137427]), array([565.97991578, 588.4515711 ]), array([574.40467219, 449.94084401]), array([450.61693057, 947.58140479]), array([635.20668426, 252.88478452]), array([513.66171429, 480.142 ]), array([381.58330335, 348.5595538 ]), array([908.29996802, 417.78413815]), array([403.42892504, 269.10997171]), array([537.05441354, 18.37726723]), array([547.64211391, 298.70618839]), array([135.76751008, 817.7909791 ]), array([354.29659053, 617.42701092]), array([635.31606715, 659.51270983]), array([496.21041348, 623.23644717]), array([334.79747306, 888.24451877]), array([470.73956044, 198.42912088]), array([453.32396607, 382.22004242]), array([100.94282287, 844.13594562]), array([185.90365945, 402.46751307]), array([235.67703162, 477.42304677]), array([964.94067278, 584.58165138]), array([461.22279349, 424.802485 ]), array([497.39172185, 330.8884106 ]), array([153.26402039, 446.75928623]), array([544.15378356, 232.02196908]), array([633.5037679 , 708.16314996]), array([605.51348089, 563.60362173]), array([596.68126327, 236.25212314]), array([535.77403666, 372.71754583]), array([469.79950698, 893.12544508]), array([539.77293338, 902.50680153]), array([894.54804151, 265.09373954]), array([492.53878943, 118.28090367]), array([150.10315473, 764.42864296]), array([280.67527499, 318.69679579]), array([936.29722222, 614.82388889]), array([964.03179516, 36.31232414]), array([249.40557006, 235.84334204]), array([678.10257395, 247.59815597]), array([554.07054455, 738.76691419]), array([184.03546454, 978.92557443]), array([124.22962666, 729.06864713]), array([146.87087759, 83.31414198]), array([972.58095238, 126.09153439]), array([714.04631295, 722.30935252]), array([163.50893228, 685.37931034]), array([720.76768802, 202.97743733]), array([975.10969388, 340.38903061]), array([166.12504092, 241.30212766]), array([820.18096136, 326.97957901]), array([233.22795699, 263.9516129 ]), array([217.46316225, 418.18046358]), array([194.22410546, 310.92278719]), array([696.62274096, 80.9435241 ]), array([382.2967033 , 576.36087912]), array([441.12829595, 597.12239276]), array([533.67381974, 195.1276824 ]), array([178.78285498, 809.38595166]), array([855.73397762, 163.89928789]), array([464.37722729, 557.28118209]), array([912.91745432, 187.92249527]), array([935.19715514, 231.56500165]), array([968.15239764, 187.65995183]), array([763.04081633, 722.38566196]), array([725.42225392, 275.33701854]), array([444.3432971, 297.90625 ]), array([213.82225541, 760.29947722]), array([952.27046632, 91.03937824]), array([179.04979734, 732.22177186]), array([165.78054008, 595.49121303]), array([141.44200244, 642.3980464 ]), array([486.80028839, 375.27757751]), array([554.58455598, 132.73359073]), array([170.54516971, 112.28563969]), array([598.87787221, 31.98646522]), array([546.3887468, 81.5681403]), array([152.76290202, 390.15856395]), array([889.81424936, 153.80203562]), array([154.2 , 351.39382716]), array([984.93471235, 82.57724628]), array([406.09397278, 628.13642255]), array([809.81547354, 209.75233437]), array([798.55086957, 250.04434783]), array([873.55451406, 213.32659102]), array([286.73553985, 540.18219794]), array([323.21456386, 571.44742991]), array([639.00546177, 303.7611718 ]), array([188.02967848, 370.88458368]), array([589.31302326, 194.54139535]), array([294.49095201, 15.35877262]), array([359.34105471, 530.48841794]), array([581.11364968, 163.18922086]), array([532.8814638 , 150.67382657]), array([265.26037118, 658.06168122]), array([627.50404898, 116.03021924]), array([469.71370143, 230.32310838]), array([500.83231707, 167.61341463]), array([540.12784091, 260.06439394]), array([508.12910619, 225.76928953]), array([236.70909091, 582.25367965]), array([703.92302772, 974.94371002]), array([502.57092199, 925.78368794]), array([177.31826742, 139.25423729]), array([313.22151899, 799.16202532])]\n", + "length [0, 2672, 2461, 6496, 5852, 4703, 4836, 2058, 4394, 4973, 4416, 4575, 3382, 3472, 5255, 3710, 5141, 11637, 7693, 3038, 2385, 1274, 3302, 3484, 4178, 3621, 2832, 4646, 1970, 2134, 2898, 3130, 3018, 2804, 2819, 2747, 3829, 2875, 3728, 3147, 5207, 1079, 2304, 3112, 2605, 2915, 2654, 5344, 3798, 4033, 2344, 3583, 2513, 2374, 2662, 3158, 2394, 2176, 3128, 2684, 2705, 2979, 3158, 4332, 2115, 2355, 2320, 2466, 2201, 3666, 3380, 5608, 3368, 2907, 3687, 2069, 3062, 1995, 2541, 2868, 2807, 2702, 3620, 1540, 2013, 4444, 1983, 2697, 4349, 2299, 1945, 2966, 3278, 2834, 2507, 1191, 2824, 2455, 4454, 2308, 3112, 2353, 1847, 3545, 2736, 3087, 2654, 4926, 2274, 3500, 2779, 3127, 2828, 3308, 3652, 2727, 3021, 2085, 3265, 2691, 1820, 1886, 2501, 1339, 3827, 1635, 2334, 3020, 2746, 1229, 2654, 2485, 3768, 2673, 3651, 2867, 2987, 2346, 1997, 2091, 1800, 3554, 1149, 2603, 2424, 2002, 2491, 1789, 1890, 2224, 2407, 3590, 1568, 3055, 3183, 1860, 2416, 2655, 1328, 2275, 2541, 1864, 2648, 1966, 2301, 1587, 3023, 4567, 1911, 2804, 2208, 2678, 965, 1727, 2333, 1638, 1387, 1295, 1915, 3177, 2737, 1337, 1965, 1620, 1547, 3086, 2249, 2300, 2027, 3112, 2568, 2014, 1213, 2150, 1271, 2029, 1707, 1257, 1832, 5063, 1467, 1640, 1056, 1309, 1155, 4690, 564, 531, 790]\n", + "coords [array([], shape=(0, 2), dtype=uint32), array([[229, 665],\n", + " [230, 665],\n", + " [231, 665],\n", + " ...,\n", + " [275, 733],\n", + " [276, 733],\n", + " [272, 734]], dtype=uint32), array([[258, 377],\n", + " [254, 378],\n", + " [255, 378],\n", + " ...,\n", + " [257, 450],\n", + " [258, 450],\n", + " [254, 451]], dtype=uint32), array([[975, 395],\n", + " [976, 395],\n", + " [977, 395],\n", + " ...,\n", + " [998, 529],\n", + " [999, 529],\n", + " [999, 530]], dtype=uint32), array([[742, 890],\n", + " [743, 890],\n", + " [744, 890],\n", + " ...,\n", + " [898, 999],\n", + " [899, 999],\n", + " [900, 999]], dtype=uint32), array([[551, 833],\n", + " [552, 833],\n", + " [547, 834],\n", + " ...,\n", + " [588, 943],\n", + " [587, 944],\n", + " [588, 944]], dtype=uint32), array([[253, 744],\n", + " [254, 744],\n", + " [255, 744],\n", + " ...,\n", + " [269, 844],\n", + " [270, 844],\n", + " [271, 844]], dtype=uint32), array([[571, 667],\n", + " [572, 667],\n", + " [571, 668],\n", + " ...,\n", + " [583, 723],\n", + " [584, 723],\n", + " [585, 723]], dtype=uint32), array([[465, 774],\n", + " [466, 774],\n", + " [467, 774],\n", + " ...,\n", + " [508, 847],\n", + " [509, 847],\n", + " [510, 847]], dtype=uint32), array([[679, 117],\n", + " [678, 118],\n", + " [679, 118],\n", + " ...,\n", + " [676, 214],\n", + " [677, 214],\n", + " [678, 214]], dtype=uint32), array([[330, 131],\n", + " [330, 132],\n", + " [331, 132],\n", + " ...,\n", + " [344, 221],\n", + " [339, 222],\n", + " [340, 222]], dtype=uint32), array([[871, 842],\n", + " [867, 843],\n", + " [868, 843],\n", + " ...,\n", + " [840, 937],\n", + " [839, 938],\n", + " [840, 938]], dtype=uint32), array([[752, 943],\n", + " [753, 943],\n", + " [754, 943],\n", + " ...,\n", + " [846, 999],\n", + " [847, 999],\n", + " [848, 999]], dtype=uint32), array([[661, 811],\n", + " [677, 811],\n", + " [678, 811],\n", + " ...,\n", + " [686, 879],\n", + " [690, 879],\n", + " [691, 879]], dtype=uint32), array([[319, 0],\n", + " [320, 0],\n", + " [321, 0],\n", + " ...,\n", + " [312, 87],\n", + " [313, 87],\n", + " [314, 87]], dtype=uint32), array([[800, 848],\n", + " [801, 848],\n", + " [802, 848],\n", + " ...,\n", + " [824, 926],\n", + " [825, 926],\n", + " [826, 926]], dtype=uint32), array([[768, 85],\n", + " [769, 85],\n", + " [770, 85],\n", + " ...,\n", + " [810, 166],\n", + " [811, 166],\n", + " [812, 166]], dtype=uint32), array([[969, 869],\n", + " [970, 869],\n", + " [971, 869],\n", + " ...,\n", + " [997, 999],\n", + " [998, 999],\n", + " [999, 999]], dtype=uint32), array([[733, 0],\n", + " [734, 0],\n", + " [735, 0],\n", + " ...,\n", + " [836, 88],\n", + " [837, 88],\n", + " [838, 88]], dtype=uint32), array([[314, 728],\n", + " [310, 729],\n", + " [311, 729],\n", + " ...,\n", + " [330, 788],\n", + " [331, 788],\n", + " [330, 789]], dtype=uint32), array([[301, 645],\n", + " [302, 645],\n", + " [303, 645],\n", + " ...,\n", + " [286, 719],\n", + " [287, 719],\n", + " [287, 720]], dtype=uint32), array([[588, 635],\n", + " [589, 635],\n", + " [590, 635],\n", + " ...,\n", + " [607, 674],\n", + " [608, 674],\n", + " [609, 674]], dtype=uint32), array([[905, 46],\n", + " [905, 47],\n", + " [906, 47],\n", + " ...,\n", + " [913, 119],\n", + " [914, 119],\n", + " [915, 119]], dtype=uint32), array([[500, 716],\n", + " [501, 716],\n", + " [502, 716],\n", + " ...,\n", + " [532, 795],\n", + " [514, 796],\n", + " [515, 796]], dtype=uint32), array([[821, 787],\n", + " [822, 787],\n", + " [820, 788],\n", + " ...,\n", + " [822, 862],\n", + " [823, 862],\n", + " [820, 863]], dtype=uint32), array([[790, 792],\n", + " [790, 793],\n", + " [791, 793],\n", + " ...,\n", + " [751, 889],\n", + " [752, 889],\n", + " [753, 889]], dtype=uint32), array([[242, 154],\n", + " [241, 155],\n", + " [242, 155],\n", + " ...,\n", + " [234, 223],\n", + " [235, 223],\n", + " [234, 224]], dtype=uint32), array([[933, 762],\n", + " [934, 762],\n", + " [935, 762],\n", + " ...,\n", + " [999, 892],\n", + " [998, 893],\n", + " [999, 893]], dtype=uint32), array([[208, 1],\n", + " [207, 2],\n", + " [208, 2],\n", + " ...,\n", + " [221, 65],\n", + " [222, 65],\n", + " [223, 65]], dtype=uint32), array([[822, 0],\n", + " [823, 0],\n", + " [824, 0],\n", + " ...,\n", + " [893, 68],\n", + " [885, 69],\n", + " [886, 69]], dtype=uint32), array([[246, 124],\n", + " [245, 125],\n", + " [246, 125],\n", + " ...,\n", + " [297, 184],\n", + " [293, 185],\n", + " [294, 185]], dtype=uint32), array([[100, 193],\n", + " [101, 193],\n", + " [102, 193],\n", + " ...,\n", + " [147, 279],\n", + " [142, 280],\n", + " [143, 280]], dtype=uint32), array([[376, 715],\n", + " [377, 715],\n", + " [378, 715],\n", + " ...,\n", + " [419, 785],\n", + " [420, 785],\n", + " [421, 785]], dtype=uint32), array([[869, 0],\n", + " [870, 0],\n", + " [871, 0],\n", + " ...,\n", + " [924, 55],\n", + " [925, 55],\n", + " [926, 55]], dtype=uint32), array([[138, 161],\n", + " [139, 161],\n", + " [134, 162],\n", + " ...,\n", + " [151, 221],\n", + " [136, 222],\n", + " [150, 222]], dtype=uint32), array([[239, 277],\n", + " [240, 277],\n", + " [241, 277],\n", + " ...,\n", + " [217, 356],\n", + " [226, 356],\n", + " [227, 356]], dtype=uint32), array([[463, 703],\n", + " [464, 703],\n", + " [465, 703],\n", + " ...,\n", + " [429, 785],\n", + " [430, 785],\n", + " [429, 786]], dtype=uint32), array([[373, 654],\n", + " [374, 654],\n", + " [375, 654],\n", + " ...,\n", + " [390, 715],\n", + " [391, 715],\n", + " [392, 715]], dtype=uint32), array([[946, 828],\n", + " [947, 828],\n", + " [948, 828],\n", + " ...,\n", + " [950, 879],\n", + " [951, 879],\n", + " [952, 879]], dtype=uint32), array([[784, 735],\n", + " [785, 735],\n", + " [805, 735],\n", + " ...,\n", + " [816, 794],\n", + " [815, 795],\n", + " [816, 795]], dtype=uint32), array([[357, 773],\n", + " [354, 774],\n", + " [355, 774],\n", + " ...,\n", + " [320, 873],\n", + " [321, 873],\n", + " [320, 874]], dtype=uint32), array([[720, 75],\n", + " [721, 75],\n", + " [722, 75],\n", + " ...,\n", + " [697, 110],\n", + " [698, 110],\n", + " [699, 110]], dtype=uint32), array([[265, 51],\n", + " [261, 52],\n", + " [262, 52],\n", + " ...,\n", + " [266, 121],\n", + " [267, 121],\n", + " [266, 122]], dtype=uint32), array([[612, 458],\n", + " [613, 458],\n", + " [611, 459],\n", + " ...,\n", + " [588, 542],\n", + " [589, 542],\n", + " [590, 542]], dtype=uint32), array([[ 37, 676],\n", + " [ 36, 677],\n", + " [ 37, 677],\n", + " ...,\n", + " [ 29, 748],\n", + " [ 30, 748],\n", + " [ 31, 748]], dtype=uint32), array([[227, 504],\n", + " [228, 504],\n", + " [229, 504],\n", + " ...,\n", + " [223, 573],\n", + " [224, 573],\n", + " [225, 573]], dtype=uint32), array([[198, 77],\n", + " [199, 77],\n", + " [238, 77],\n", + " ...,\n", + " [214, 142],\n", + " [215, 142],\n", + " [216, 142]], dtype=uint32), array([[989, 243],\n", + " [990, 243],\n", + " [991, 243],\n", + " ...,\n", + " [950, 352],\n", + " [951, 352],\n", + " [950, 353]], dtype=uint32), array([[343, 74],\n", + " [344, 74],\n", + " [345, 74],\n", + " ...,\n", + " [351, 134],\n", + " [352, 134],\n", + " [353, 134]], dtype=uint32), array([[397, 134],\n", + " [393, 135],\n", + " [394, 135],\n", + " ...,\n", + " [422, 238],\n", + " [423, 238],\n", + " [424, 238]], dtype=uint32), array([[154, 13],\n", + " [155, 13],\n", + " [156, 13],\n", + " ...,\n", + " [173, 75],\n", + " [174, 75],\n", + " [175, 75]], dtype=uint32), array([[899, 449],\n", + " [900, 449],\n", + " [910, 449],\n", + " ...,\n", + " [961, 523],\n", + " [962, 523],\n", + " [963, 523]], dtype=uint32), array([[256, 555],\n", + " [257, 555],\n", + " [255, 556],\n", + " ...,\n", + " [264, 633],\n", + " [265, 633],\n", + " [261, 634]], dtype=uint32), array([[593, 299],\n", + " [594, 299],\n", + " [591, 300],\n", + " ...,\n", + " [589, 356],\n", + " [585, 357],\n", + " [586, 357]], dtype=uint32), array([[862, 328],\n", + " [862, 329],\n", + " [862, 330],\n", + " ...,\n", + " [846, 414],\n", + " [847, 414],\n", + " [846, 415]], dtype=uint32), array([[300, 212],\n", + " [301, 212],\n", + " [302, 212],\n", + " ...,\n", + " [293, 280],\n", + " [288, 281],\n", + " [289, 281]], dtype=uint32), array([[ 47, 612],\n", + " [ 48, 612],\n", + " [ 47, 613],\n", + " ...,\n", + " [ 51, 678],\n", + " [ 52, 678],\n", + " [ 53, 678]], dtype=uint32), array([[ 88, 676],\n", + " [ 89, 676],\n", + " [ 90, 676],\n", + " ...,\n", + " [ 81, 724],\n", + " [ 82, 724],\n", + " [ 83, 724]], dtype=uint32), array([[354, 830],\n", + " [355, 830],\n", + " [356, 830],\n", + " ...,\n", + " [371, 895],\n", + " [373, 895],\n", + " [374, 895]], dtype=uint32), array([[673, 279],\n", + " [674, 279],\n", + " [675, 279],\n", + " ...,\n", + " [675, 337],\n", + " [676, 337],\n", + " [677, 337]], dtype=uint32), array([[184, 471],\n", + " [183, 472],\n", + " [184, 472],\n", + " ...,\n", + " [193, 528],\n", + " [194, 528],\n", + " [195, 528]], dtype=uint32), array([[760, 147],\n", + " [761, 147],\n", + " [756, 148],\n", + " ...,\n", + " [772, 209],\n", + " [773, 209],\n", + " [774, 209]], dtype=uint32), array([[655, 435],\n", + " [656, 435],\n", + " [657, 435],\n", + " ...,\n", + " [667, 514],\n", + " [666, 515],\n", + " [667, 515]], dtype=uint32), array([[194, 147],\n", + " [197, 147],\n", + " [198, 147],\n", + " ...,\n", + " [204, 234],\n", + " [205, 234],\n", + " [206, 234]], dtype=uint32), array([[103, 641],\n", + " [104, 641],\n", + " [105, 641],\n", + " ...,\n", + " [112, 715],\n", + " [113, 715],\n", + " [112, 716]], dtype=uint32), array([[679, 721],\n", + " [680, 721],\n", + " [678, 722],\n", + " ...,\n", + " [656, 780],\n", + " [657, 780],\n", + " [653, 781]], dtype=uint32), array([[762, 204],\n", + " [763, 204],\n", + " [760, 205],\n", + " ...,\n", + " [758, 283],\n", + " [759, 283],\n", + " [760, 283]], dtype=uint32), array([[444, 630],\n", + " [445, 630],\n", + " [446, 630],\n", + " ...,\n", + " [467, 687],\n", + " [461, 688],\n", + " [462, 688]], dtype=uint32), array([[704, 108],\n", + " [705, 108],\n", + " [706, 108],\n", + " ...,\n", + " [706, 174],\n", + " [707, 174],\n", + " [705, 175]], dtype=uint32), array([[684, 490],\n", + " [680, 491],\n", + " [681, 491],\n", + " ...,\n", + " [667, 583],\n", + " [668, 583],\n", + " [669, 583]], dtype=uint32), array([[421, 667],\n", + " [422, 667],\n", + " [423, 667],\n", + " ...,\n", + " [415, 751],\n", + " [416, 751],\n", + " [417, 751]], dtype=uint32), array([[637, 0],\n", + " [638, 0],\n", + " [639, 0],\n", + " ...,\n", + " [678, 113],\n", + " [679, 113],\n", + " [679, 114]], dtype=uint32), array([[409, 924],\n", + " [410, 924],\n", + " [411, 924],\n", + " ...,\n", + " [383, 989],\n", + " [384, 989],\n", + " [380, 990]], dtype=uint32), array([[405, 503],\n", + " [406, 503],\n", + " [401, 504],\n", + " ...,\n", + " [418, 567],\n", + " [419, 567],\n", + " [413, 568]], dtype=uint32), array([[ 71, 715],\n", + " [ 72, 715],\n", + " [ 71, 716],\n", + " ...,\n", + " [ 44, 793],\n", + " [ 39, 794],\n", + " [ 40, 794]], dtype=uint32), array([[841, 209],\n", + " [842, 209],\n", + " [840, 210],\n", + " ...,\n", + " [839, 280],\n", + " [840, 280],\n", + " [841, 280]], dtype=uint32), array([[504, 508],\n", + " [505, 508],\n", + " [506, 508],\n", + " ...,\n", + " [490, 561],\n", + " [491, 561],\n", + " [492, 561]], dtype=uint32), array([[378, 163],\n", + " [377, 164],\n", + " [378, 164],\n", + " ...,\n", + " [386, 247],\n", + " [387, 247],\n", + " [388, 247]], dtype=uint32), array([[774, 263],\n", + " [783, 263],\n", + " [784, 263],\n", + " ...,\n", + " [765, 330],\n", + " [766, 330],\n", + " [767, 330]], dtype=uint32), array([[683, 388],\n", + " [684, 388],\n", + " [685, 388],\n", + " ...,\n", + " [726, 457],\n", + " [727, 457],\n", + " [728, 457]], dtype=uint32), array([[107, 584],\n", + " [103, 585],\n", + " [104, 585],\n", + " ...,\n", + " [114, 641],\n", + " [115, 641],\n", + " [114, 642]], dtype=uint32), array([[475, 101],\n", + " [474, 102],\n", + " [475, 102],\n", + " ...,\n", + " [451, 186],\n", + " [449, 187],\n", + " [450, 187]], dtype=uint32), array([[427, 237],\n", + " [428, 237],\n", + " [429, 237],\n", + " ...,\n", + " [486, 304],\n", + " [487, 304],\n", + " [477, 305]], dtype=uint32), array([[207, 234],\n", + " [208, 234],\n", + " [209, 234],\n", + " ...,\n", + " [186, 289],\n", + " [187, 289],\n", + " [188, 289]], dtype=uint32), array([[512, 555],\n", + " [513, 555],\n", + " [511, 556],\n", + " ...,\n", + " [531, 606],\n", + " [532, 606],\n", + " [533, 606]], dtype=uint32), array([[519, 924],\n", + " [520, 924],\n", + " [521, 924],\n", + " ...,\n", + " [538, 990],\n", + " [539, 990],\n", + " [540, 990]], dtype=uint32), array([[208, 0],\n", + " [209, 0],\n", + " [210, 0],\n", + " ...,\n", + " [249, 43],\n", + " [245, 44],\n", + " [246, 44]], dtype=uint32), array([[409, 312],\n", + " [410, 312],\n", + " [405, 313],\n", + " ...,\n", + " [423, 379],\n", + " [424, 379],\n", + " [425, 379]], dtype=uint32), array([[158, 843],\n", + " [158, 844],\n", + " [159, 844],\n", + " ...,\n", + " [162, 912],\n", + " [164, 912],\n", + " [174, 912]], dtype=uint32), array([[884, 359],\n", + " [885, 359],\n", + " [886, 359],\n", + " ...,\n", + " [872, 435],\n", + " [873, 435],\n", + " [873, 436]], dtype=uint32), array([[943, 108],\n", + " [941, 109],\n", + " [942, 109],\n", + " ...,\n", + " [933, 167],\n", + " [932, 168],\n", + " [933, 168]], dtype=uint32), array([[952, 352],\n", + " [953, 352],\n", + " [954, 352],\n", + " ...,\n", + " [941, 429],\n", + " [942, 429],\n", + " [943, 429]], dtype=uint32), array([[392, 378],\n", + " [390, 379],\n", + " [391, 379],\n", + " ...,\n", + " [384, 437],\n", + " [385, 437],\n", + " [386, 437]], dtype=uint32), array([[922, 282],\n", + " [923, 282],\n", + " [924, 282],\n", + " ...,\n", + " [910, 355],\n", + " [911, 355],\n", + " [907, 356]], dtype=uint32), array([[394, 888],\n", + " [395, 888],\n", + " [391, 889],\n", + " ...,\n", + " [350, 931],\n", + " [351, 931],\n", + " [352, 931]], dtype=uint32), array([[594, 274],\n", + " [595, 274],\n", + " [596, 274],\n", + " ...,\n", + " [612, 315],\n", + " [613, 315],\n", + " [614, 315]], dtype=uint32), array([[223, 941],\n", + " [224, 941],\n", + " [225, 941],\n", + " ...,\n", + " [244, 999],\n", + " [245, 999],\n", + " [246, 999]], dtype=uint32), array([[587, 68],\n", + " [588, 68],\n", + " [586, 69],\n", + " ...,\n", + " [586, 143],\n", + " [587, 143],\n", + " [588, 143]], dtype=uint32), array([[219, 798],\n", + " [220, 798],\n", + " [219, 799],\n", + " ...,\n", + " [207, 884],\n", + " [208, 884],\n", + " [207, 885]], dtype=uint32), array([[160, 526],\n", + " [161, 526],\n", + " [162, 526],\n", + " ...,\n", + " [202, 574],\n", + " [203, 574],\n", + " [204, 574]], dtype=uint32), array([[781, 331],\n", + " [782, 331],\n", + " [773, 332],\n", + " ...,\n", + " [771, 405],\n", + " [772, 405],\n", + " [773, 405]], dtype=uint32), array([[729, 663],\n", + " [730, 663],\n", + " [731, 663],\n", + " ...,\n", + " [702, 704],\n", + " [703, 704],\n", + " [704, 704]], dtype=uint32), array([[216, 588],\n", + " [215, 589],\n", + " [216, 589],\n", + " ...,\n", + " [204, 632],\n", + " [206, 632],\n", + " [207, 632]], dtype=uint32), array([[334, 299],\n", + " [335, 299],\n", + " [330, 300],\n", + " ...,\n", + " [337, 381],\n", + " [338, 381],\n", + " [339, 381]], dtype=uint32), array([[357, 228],\n", + " [358, 228],\n", + " [355, 229],\n", + " ...,\n", + " [383, 303],\n", + " [384, 303],\n", + " [385, 303]], dtype=uint32), array([[573, 544],\n", + " [574, 544],\n", + " [572, 545],\n", + " ...,\n", + " [540, 622],\n", + " [541, 622],\n", + " [541, 623]], dtype=uint32), array([[563, 420],\n", + " [564, 420],\n", + " [565, 420],\n", + " ...,\n", + " [575, 483],\n", + " [576, 483],\n", + " [577, 483]], dtype=uint32), array([[428, 894],\n", + " [428, 895],\n", + " [429, 895],\n", + " ...,\n", + " [472, 987],\n", + " [473, 987],\n", + " [474, 987]], dtype=uint32), array([[641, 212],\n", + " [642, 212],\n", + " [643, 212],\n", + " ...,\n", + " [630, 283],\n", + " [631, 283],\n", + " [632, 283]], dtype=uint32), array([[506, 437],\n", + " [507, 437],\n", + " [502, 438],\n", + " ...,\n", + " [492, 517],\n", + " [493, 517],\n", + " [489, 518]], dtype=uint32), array([[364, 307],\n", + " [365, 307],\n", + " [366, 307],\n", + " ...,\n", + " [373, 390],\n", + " [374, 390],\n", + " [375, 390]], dtype=uint32), array([[930, 376],\n", + " [930, 377],\n", + " [931, 377],\n", + " ...,\n", + " [916, 451],\n", + " [914, 452],\n", + " [915, 452]], dtype=uint32), array([[404, 230],\n", + " [405, 230],\n", + " [406, 230],\n", + " ...,\n", + " [391, 303],\n", + " [386, 304],\n", + " [387, 304]], dtype=uint32), array([[477, 0],\n", + " [478, 0],\n", + " [479, 0],\n", + " ...,\n", + " [556, 50],\n", + " [557, 50],\n", + " [558, 50]], dtype=uint32), array([[564, 262],\n", + " [563, 263],\n", + " [564, 263],\n", + " ...,\n", + " [542, 343],\n", + " [541, 344],\n", + " [542, 344]], dtype=uint32), array([[122, 779],\n", + " [123, 779],\n", + " [122, 780],\n", + " ...,\n", + " [127, 857],\n", + " [128, 857],\n", + " [126, 858]], dtype=uint32), array([[350, 577],\n", + " [348, 578],\n", + " [349, 578],\n", + " ...,\n", + " [356, 662],\n", + " [357, 662],\n", + " [358, 662]], dtype=uint32), array([[617, 637],\n", + " [618, 637],\n", + " [619, 637],\n", + " ...,\n", + " [627, 685],\n", + " [628, 685],\n", + " [629, 685]], dtype=uint32), array([[499, 589],\n", + " [498, 590],\n", + " [499, 590],\n", + " ...,\n", + " [491, 669],\n", + " [492, 669],\n", + " [491, 670]], dtype=uint32), array([[337, 856],\n", + " [338, 856],\n", + " [336, 857],\n", + " ...,\n", + " [342, 931],\n", + " [343, 931],\n", + " [344, 931]], dtype=uint32), array([[473, 175],\n", + " [474, 175],\n", + " [475, 175],\n", + " ...,\n", + " [476, 219],\n", + " [477, 219],\n", + " [478, 219]], dtype=uint32), array([[459, 353],\n", + " [460, 353],\n", + " [458, 354],\n", + " ...,\n", + " [466, 406],\n", + " [467, 406],\n", + " [468, 406]], dtype=uint32), array([[102, 800],\n", + " [103, 800],\n", + " [104, 800],\n", + " ...,\n", + " [106, 882],\n", + " [105, 883],\n", + " [106, 883]], dtype=uint32), array([[191, 381],\n", + " [192, 381],\n", + " [193, 381],\n", + " ...,\n", + " [188, 425],\n", + " [188, 426],\n", + " [188, 427]], dtype=uint32), array([[231, 435],\n", + " [231, 436],\n", + " [232, 436],\n", + " ...,\n", + " [257, 518],\n", + " [258, 518],\n", + " [259, 518]], dtype=uint32), array([[968, 560],\n", + " [969, 560],\n", + " [963, 561],\n", + " ...,\n", + " [963, 610],\n", + " [964, 610],\n", + " [963, 611]], dtype=uint32), array([[479, 400],\n", + " [478, 401],\n", + " [479, 401],\n", + " ...,\n", + " [459, 451],\n", + " [454, 452],\n", + " [455, 452]], dtype=uint32), array([[504, 298],\n", + " [505, 298],\n", + " [502, 299],\n", + " ...,\n", + " [530, 358],\n", + " [531, 358],\n", + " [532, 358]], dtype=uint32), array([[156, 413],\n", + " [157, 413],\n", + " [158, 413],\n", + " ...,\n", + " [156, 487],\n", + " [157, 487],\n", + " [158, 487]], dtype=uint32), array([[557, 212],\n", + " [558, 212],\n", + " [555, 213],\n", + " ...,\n", + " [530, 250],\n", + " [531, 250],\n", + " [532, 250]], dtype=uint32), array([[664, 671],\n", + " [665, 671],\n", + " [666, 671],\n", + " ...,\n", + " [636, 739],\n", + " [637, 739],\n", + " [638, 739]], dtype=uint32), array([[618, 531],\n", + " [618, 532],\n", + " [619, 532],\n", + " ...,\n", + " [602, 597],\n", + " [603, 597],\n", + " [599, 598]], dtype=uint32), array([[617, 208],\n", + " [618, 208],\n", + " [619, 208],\n", + " ...,\n", + " [591, 274],\n", + " [592, 274],\n", + " [593, 274]], dtype=uint32), array([[542, 345],\n", + " [543, 345],\n", + " [544, 345],\n", + " ...,\n", + " [528, 402],\n", + " [529, 402],\n", + " [530, 402]], dtype=uint32), array([[468, 865],\n", + " [469, 865],\n", + " [464, 866],\n", + " ...,\n", + " [484, 928],\n", + " [485, 928],\n", + " [485, 929]], dtype=uint32), array([[538, 848],\n", + " [539, 848],\n", + " [537, 849],\n", + " ...,\n", + " [575, 939],\n", + " [576, 939],\n", + " [577, 939]], dtype=uint32), array([[888, 228],\n", + " [887, 229],\n", + " [888, 229],\n", + " ...,\n", + " [877, 297],\n", + " [878, 297],\n", + " [879, 297]], dtype=uint32), array([[494, 85],\n", + " [495, 85],\n", + " [496, 85],\n", + " ...,\n", + " [498, 145],\n", + " [499, 145],\n", + " [495, 146]], dtype=uint32), array([[153, 735],\n", + " [154, 735],\n", + " [152, 736],\n", + " ...,\n", + " [145, 786],\n", + " [146, 786],\n", + " [147, 786]], dtype=uint32), array([[257, 294],\n", + " [257, 295],\n", + " [281, 295],\n", + " ...,\n", + " [275, 344],\n", + " [276, 344],\n", + " [277, 344]], dtype=uint32), array([[938, 585],\n", + " [939, 585],\n", + " [937, 586],\n", + " ...,\n", + " [944, 638],\n", + " [945, 638],\n", + " [946, 638]], dtype=uint32), array([[949, 0],\n", + " [950, 0],\n", + " [951, 0],\n", + " ...,\n", + " [963, 77],\n", + " [964, 77],\n", + " [965, 77]], dtype=uint32), array([[244, 215],\n", + " [245, 215],\n", + " [243, 216],\n", + " ...,\n", + " [253, 257],\n", + " [254, 257],\n", + " [255, 257]], dtype=uint32), array([[658, 214],\n", + " [659, 214],\n", + " [660, 214],\n", + " ...,\n", + " [694, 283],\n", + " [695, 283],\n", + " [694, 284]], dtype=uint32), array([[549, 703],\n", + " [550, 703],\n", + " [551, 703],\n", + " ...,\n", + " [551, 779],\n", + " [552, 779],\n", + " [551, 780]], dtype=uint32), array([[205, 950],\n", + " [206, 950],\n", + " [203, 951],\n", + " ...,\n", + " [209, 999],\n", + " [210, 999],\n", + " [211, 999]], dtype=uint32), array([[135, 696],\n", + " [133, 697],\n", + " [134, 697],\n", + " ...,\n", + " [118, 764],\n", + " [119, 764],\n", + " [118, 765]], dtype=uint32), array([[157, 58],\n", + " [154, 59],\n", + " [155, 59],\n", + " ...,\n", + " [142, 109],\n", + " [143, 109],\n", + " [142, 110]], dtype=uint32), array([[966, 105],\n", + " [967, 105],\n", + " [964, 106],\n", + " ...,\n", + " [962, 147],\n", + " [982, 147],\n", + " [983, 147]], dtype=uint32), array([[678, 692],\n", + " [679, 692],\n", + " [678, 693],\n", + " ...,\n", + " [728, 747],\n", + " [729, 747],\n", + " [730, 747]], dtype=uint32), array([[166, 653],\n", + " [162, 654],\n", + " [163, 654],\n", + " ...,\n", + " [172, 712],\n", + " [173, 712],\n", + " [174, 712]], dtype=uint32), array([[717, 165],\n", + " [718, 165],\n", + " [746, 165],\n", + " ...,\n", + " [716, 236],\n", + " [717, 236],\n", + " [718, 236]], dtype=uint32), array([[974, 318],\n", + " [975, 318],\n", + " [976, 318],\n", + " ...,\n", + " [963, 366],\n", + " [962, 367],\n", + " [963, 367]], dtype=uint32), array([[176, 208],\n", + " [172, 209],\n", + " [173, 209],\n", + " ...,\n", + " [166, 282],\n", + " [167, 282],\n", + " [168, 282]], dtype=uint32), array([[824, 296],\n", + " [825, 296],\n", + " [820, 297],\n", + " ...,\n", + " [810, 359],\n", + " [808, 360],\n", + " [809, 360]], dtype=uint32), array([[219, 227],\n", + " [220, 227],\n", + " [221, 227],\n", + " ...,\n", + " [221, 295],\n", + " [222, 295],\n", + " [220, 296]], dtype=uint32), array([[227, 377],\n", + " [224, 378],\n", + " [225, 378],\n", + " ...,\n", + " [205, 452],\n", + " [202, 453],\n", + " [203, 453]], dtype=uint32), array([[206, 279],\n", + " [207, 279],\n", + " [208, 279],\n", + " ...,\n", + " [214, 356],\n", + " [215, 356],\n", + " [213, 357]], dtype=uint32), array([[701, 54],\n", + " [697, 55],\n", + " [698, 55],\n", + " ...,\n", + " [682, 113],\n", + " [683, 113],\n", + " [680, 114]], dtype=uint32), array([[384, 552],\n", + " [385, 552],\n", + " [386, 552],\n", + " ...,\n", + " [385, 607],\n", + " [386, 607],\n", + " [385, 608]], dtype=uint32), array([[433, 563],\n", + " [434, 563],\n", + " [435, 563],\n", + " ...,\n", + " [461, 636],\n", + " [458, 637],\n", + " [459, 637]], dtype=uint32), array([[545, 169],\n", + " [546, 169],\n", + " [547, 169],\n", + " ...,\n", + " [525, 222],\n", + " [526, 222],\n", + " [527, 222]], dtype=uint32), array([[175, 775],\n", + " [176, 775],\n", + " [177, 775],\n", + " ...,\n", + " [175, 847],\n", + " [176, 847],\n", + " [177, 847]], dtype=uint32), array([[849, 135],\n", + " [848, 136],\n", + " [849, 136],\n", + " ...,\n", + " [862, 193],\n", + " [860, 194],\n", + " [861, 194]], dtype=uint32), array([[450, 525],\n", + " [450, 526],\n", + " [451, 526],\n", + " ...,\n", + " [478, 586],\n", + " [462, 587],\n", + " [474, 587]], dtype=uint32), array([[911, 162],\n", + " [912, 162],\n", + " [910, 163],\n", + " ...,\n", + " [903, 213],\n", + " [904, 213],\n", + " [905, 213]], dtype=uint32), array([[923, 206],\n", + " [924, 206],\n", + " [925, 206],\n", + " ...,\n", + " [953, 256],\n", + " [954, 256],\n", + " [950, 257]], dtype=uint32), array([[974, 139],\n", + " [974, 140],\n", + " [975, 140],\n", + " ...,\n", + " [991, 238],\n", + " [992, 238],\n", + " [990, 239]], dtype=uint32), array([[771, 698],\n", + " [772, 698],\n", + " [773, 698],\n", + " ...,\n", + " [757, 750],\n", + " [758, 750],\n", + " [759, 750]], dtype=uint32), array([[719, 236],\n", + " [720, 236],\n", + " [721, 236],\n", + " ...,\n", + " [747, 320],\n", + " [748, 320],\n", + " [747, 321]], dtype=uint32), array([[430, 263],\n", + " [431, 263],\n", + " [432, 263],\n", + " ...,\n", + " [422, 322],\n", + " [423, 322],\n", + " [420, 323]], dtype=uint32), array([[224, 731],\n", + " [225, 731],\n", + " [226, 731],\n", + " ...,\n", + " [207, 790],\n", + " [208, 790],\n", + " [209, 790]], dtype=uint32), array([[946, 71],\n", + " [945, 72],\n", + " [946, 72],\n", + " ...,\n", + " [950, 110],\n", + " [951, 110],\n", + " [952, 110]], dtype=uint32), array([[155, 712],\n", + " [156, 712],\n", + " [157, 712],\n", + " ...,\n", + " [181, 757],\n", + " [182, 757],\n", + " [183, 757]], dtype=uint32), array([[148, 573],\n", + " [149, 573],\n", + " [150, 573],\n", + " ...,\n", + " [162, 622],\n", + " [163, 622],\n", + " [164, 622]], dtype=uint32), array([[138, 621],\n", + " [139, 621],\n", + " [140, 621],\n", + " ...,\n", + " [147, 671],\n", + " [142, 672],\n", + " [143, 672]], dtype=uint32), array([[468, 347],\n", + " [469, 347],\n", + " [467, 348],\n", + " ...,\n", + " [488, 405],\n", + " [488, 406],\n", + " [489, 406]], dtype=uint32), array([[545, 105],\n", + " [546, 105],\n", + " [547, 105],\n", + " ...,\n", + " [576, 155],\n", + " [574, 156],\n", + " [575, 156]], dtype=uint32), array([[191, 80],\n", + " [190, 81],\n", + " [191, 81],\n", + " ...,\n", + " [163, 148],\n", + " [164, 148],\n", + " [165, 148]], dtype=uint32), array([[594, 0],\n", + " [595, 0],\n", + " [596, 0],\n", + " ...,\n", + " [599, 70],\n", + " [600, 70],\n", + " [601, 70]], dtype=uint32), array([[570, 39],\n", + " [570, 40],\n", + " [571, 40],\n", + " ...,\n", + " [520, 128],\n", + " [521, 128],\n", + " [522, 128]], dtype=uint32), array([[146, 366],\n", + " [147, 366],\n", + " [145, 367],\n", + " ...,\n", + " [151, 414],\n", + " [152, 414],\n", + " [153, 414]], dtype=uint32), array([[890, 115],\n", + " [891, 115],\n", + " [888, 116],\n", + " ...,\n", + " [885, 193],\n", + " [886, 193],\n", + " [885, 194]], dtype=uint32), array([[151, 327],\n", + " [152, 327],\n", + " [153, 327],\n", + " ...,\n", + " [135, 390],\n", + " [136, 390],\n", + " [132, 391]], dtype=uint32), array([[999, 44],\n", + " [997, 45],\n", + " [998, 45],\n", + " ...,\n", + " [997, 108],\n", + " [998, 108],\n", + " [999, 108]], dtype=uint32), array([[405, 590],\n", + " [406, 590],\n", + " [407, 590],\n", + " ...,\n", + " [412, 664],\n", + " [413, 664],\n", + " [414, 664]], dtype=uint32), array([[827, 173],\n", + " [826, 174],\n", + " [827, 174],\n", + " ...,\n", + " [807, 235],\n", + " [808, 235],\n", + " [809, 235]], dtype=uint32), array([[771, 222],\n", + " [772, 222],\n", + " [773, 222],\n", + " ...,\n", + " [814, 277],\n", + " [815, 277],\n", + " [816, 277]], dtype=uint32), array([[867, 183],\n", + " [871, 183],\n", + " [872, 183],\n", + " ...,\n", + " [873, 242],\n", + " [874, 242],\n", + " [875, 242]], dtype=uint32), array([[277, 498],\n", + " [277, 499],\n", + " [278, 499],\n", + " ...,\n", + " [291, 581],\n", + " [292, 581],\n", + " [293, 581]], dtype=uint32), array([[324, 537],\n", + " [325, 537],\n", + " [326, 537],\n", + " ...,\n", + " [301, 613],\n", + " [299, 614],\n", + " [300, 614]], dtype=uint32), array([[654, 271],\n", + " [655, 271],\n", + " [659, 271],\n", + " ...,\n", + " [607, 359],\n", + " [604, 360],\n", + " [605, 360]], dtype=uint32), array([[184, 349],\n", + " [185, 349],\n", + " [183, 350],\n", + " ...,\n", + " [205, 390],\n", + " [206, 390],\n", + " [205, 391]], dtype=uint32), array([[609, 168],\n", + " [610, 168],\n", + " [611, 168],\n", + " ...,\n", + " [575, 214],\n", + " [576, 214],\n", + " [577, 214]], dtype=uint32), array([[282, 0],\n", + " [283, 0],\n", + " [284, 0],\n", + " ...,\n", + " [289, 34],\n", + " [290, 34],\n", + " [291, 34]], dtype=uint32), array([[360, 501],\n", + " [361, 501],\n", + " [356, 502],\n", + " ...,\n", + " [358, 558],\n", + " [359, 558],\n", + " [377, 558]], dtype=uint32), array([[597, 139],\n", + " [595, 140],\n", + " [596, 140],\n", + " ...,\n", + " [566, 184],\n", + " [567, 184],\n", + " [568, 184]], dtype=uint32), array([[531, 125],\n", + " [528, 126],\n", + " [529, 126],\n", + " ...,\n", + " [534, 172],\n", + " [535, 172],\n", + " [536, 172]], dtype=uint32), array([[279, 639],\n", + " [280, 639],\n", + " [281, 639],\n", + " ...,\n", + " [276, 680],\n", + " [277, 680],\n", + " [277, 681]], dtype=uint32), array([[617, 59],\n", + " [617, 60],\n", + " [616, 61],\n", + " ...,\n", + " [616, 172],\n", + " [617, 172],\n", + " [616, 173]], dtype=uint32), array([[463, 212],\n", + " [460, 213],\n", + " [461, 213],\n", + " ...,\n", + " [467, 249],\n", + " [468, 249],\n", + " [469, 249]], dtype=uint32), array([[500, 145],\n", + " [501, 145],\n", + " [502, 145],\n", + " ...,\n", + " [503, 196],\n", + " [504, 196],\n", + " [500, 197]], dtype=uint32), array([[524, 245],\n", + " [525, 245],\n", + " [522, 246],\n", + " ...,\n", + " [533, 278],\n", + " [534, 278],\n", + " [533, 279]], dtype=uint32), array([[501, 197],\n", + " [502, 197],\n", + " [503, 197],\n", + " ...,\n", + " [506, 255],\n", + " [507, 255],\n", + " [506, 256]], dtype=uint32), array([[237, 563],\n", + " [238, 563],\n", + " [239, 563],\n", + " ...,\n", + " [242, 610],\n", + " [243, 610],\n", + " [242, 611]], dtype=uint32), array([[742, 922],\n", + " [743, 922],\n", + " [744, 922],\n", + " ...,\n", + " [755, 999],\n", + " [756, 999],\n", + " [757, 999]], dtype=uint32), array([[507, 912],\n", + " [508, 912],\n", + " [506, 913],\n", + " ...,\n", + " [491, 937],\n", + " [492, 937],\n", + " [493, 937]], dtype=uint32), array([[174, 127],\n", + " [175, 127],\n", + " [176, 127],\n", + " ...,\n", + " [179, 151],\n", + " [180, 151],\n", + " [176, 152]], dtype=uint32), array([[301, 785],\n", + " [302, 785],\n", + " [303, 785],\n", + " ...,\n", + " [318, 820],\n", + " [317, 821],\n", + " [318, 821]], dtype=uint32)]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "dilating shapes: 0%| | 0/209 [00:00 22\u001b[0m shape_collection \u001b[38;5;241m=\u001b[39m \u001b[43msl\u001b[49m\u001b[43m(\u001b[49m\u001b[43msegmentation\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 23\u001b[0m \u001b[43m \u001b[49m\u001b[43mcell_sets\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 24\u001b[0m \u001b[43m \u001b[49m\u001b[43mcalibration_points\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/Documents/git/py-lmd/src/lmd/lib.py:666\u001b[0m, in \u001b[0;36mSegmentationLoader.__call__\u001b[0;34m(self, input_segmentation, cell_sets, calibration_points, coords_lookup)\u001b[0m\n\u001b[1;32m 664\u001b[0m collections \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m 665\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, cell_set \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(cell_sets):\n\u001b[0;32m--> 666\u001b[0m collections\u001b[38;5;241m.\u001b[39mappend(\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgenerate_cutting_data\u001b[49m\u001b[43m(\u001b[49m\u001b[43mi\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcell_set\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 668\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m reduce(\u001b[38;5;28;01mlambda\u001b[39;00m a, b: a\u001b[38;5;241m.\u001b[39mjoin(b), collections)\n", + "File \u001b[0;32m~/Documents/git/py-lmd/src/lmd/lib.py:707\u001b[0m, in \u001b[0;36mSegmentationLoader.generate_cutting_data\u001b[0;34m(self, i, cell_set)\u001b[0m\n\u001b[1;32m 705\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mlength\u001b[39m\u001b[38;5;124m'\u001b[39m, length)\n\u001b[1;32m 706\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mcoords\u001b[39m\u001b[38;5;124m'\u001b[39m, coords)\n\u001b[0;32m--> 707\u001b[0m center, length, coords \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmerge_dilated_shapes\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcenter\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlength\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcoords\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\n\u001b[1;32m 708\u001b[0m \u001b[43m \u001b[49m\u001b[43mdilation\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mshape_dilation\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 709\u001b[0m \u001b[43m \u001b[49m\u001b[43merosion\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mshape_erosion\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 711\u001b[0m \u001b[38;5;66;03m# Calculate dilation and erosion based on if merging was activated\u001b[39;00m\n\u001b[1;32m 712\u001b[0m dilation \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbinary_smoothing\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mjoin_intersecting\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mbinary_smoothing\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mshape_dilation\u001b[39m\u001b[38;5;124m'\u001b[39m]\n", + "File \u001b[0;32m~/Documents/git/py-lmd/src/lmd/lib.py:840\u001b[0m, in \u001b[0;36mSegmentationLoader.merge_dilated_shapes\u001b[0;34m(self, input_center, input_length, input_coords, dilation, erosion)\u001b[0m\n\u001b[1;32m 838\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mthreads\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[1;32m 839\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m coord \u001b[38;5;129;01min\u001b[39;00m tqdm(input_coords, desc \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdilating shapes\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[0;32m--> 840\u001b[0m dilated_coords\u001b[38;5;241m.\u001b[39mappend(\u001b[43mtranform_to_map\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcoord\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdilation\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mdilation\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 842\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 843\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m mp\u001b[38;5;241m.\u001b[39mget_context(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcontext)\u001b[38;5;241m.\u001b[39mPool(processes\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mprocesses\u001b[39m\u001b[38;5;124m'\u001b[39m]) \u001b[38;5;28;01mas\u001b[39;00m pool: \n", + "File \u001b[0;32m~/Documents/git/py-lmd/src/lmd/lib.py:1004\u001b[0m, in \u001b[0;36mtranform_to_map\u001b[0;34m(coords, dilation, erosion, coord_format, debug)\u001b[0m\n\u001b[1;32m 1000\u001b[0m coords \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray(coords)\u001b[38;5;241m.\u001b[39mastype(\u001b[38;5;28mint\u001b[39m)\n\u001b[1;32m 1003\u001b[0m \u001b[38;5;66;03m# top left offset used for creating the offset map\u001b[39;00m\n\u001b[0;32m-> 1004\u001b[0m offset \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmin\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcoords\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;241m-\u001b[39m safety_offset \u001b[38;5;241m-\u001b[39m dilation_offset\n\u001b[1;32m 1005\u001b[0m mat \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray([offset, [\u001b[38;5;241m0\u001b[39m,\u001b[38;5;241m0\u001b[39m]])\n\u001b[1;32m 1006\u001b[0m offset \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mmax(mat, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)\n", + "File \u001b[0;32m~/miniconda3/envs/pylmd/lib/python3.9/site-packages/numpy/_core/fromnumeric.py:3042\u001b[0m, in \u001b[0;36mmin\u001b[0;34m(a, axis, out, keepdims, initial, where)\u001b[0m\n\u001b[1;32m 2925\u001b[0m \u001b[38;5;129m@array_function_dispatch\u001b[39m(_min_dispatcher)\n\u001b[1;32m 2926\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmin\u001b[39m(a, axis\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, out\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m, keepdims\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39m_NoValue, initial\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39m_NoValue,\n\u001b[1;32m 2927\u001b[0m where\u001b[38;5;241m=\u001b[39mnp\u001b[38;5;241m.\u001b[39m_NoValue):\n\u001b[1;32m 2928\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 2929\u001b[0m \u001b[38;5;124;03m Return the minimum of an array or minimum along an axis.\u001b[39;00m\n\u001b[1;32m 2930\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3040\u001b[0m \u001b[38;5;124;03m 6\u001b[39;00m\n\u001b[1;32m 3041\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 3042\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_wrapreduction\u001b[49m\u001b[43m(\u001b[49m\u001b[43ma\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mminimum\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mmin\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 3043\u001b[0m \u001b[43m \u001b[49m\u001b[43mkeepdims\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mkeepdims\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43minitial\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minitial\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mwhere\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwhere\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m~/miniconda3/envs/pylmd/lib/python3.9/site-packages/numpy/_core/fromnumeric.py:86\u001b[0m, in \u001b[0;36m_wrapreduction\u001b[0;34m(obj, ufunc, method, axis, dtype, out, **kwargs)\u001b[0m\n\u001b[1;32m 83\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m reduction(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[39mpasskwargs)\n\u001b[0;32m---> 86\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mufunc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mreduce\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobj\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdtype\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mout\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[43mpasskwargs\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[0;31mValueError\u001b[0m: zero-size array to reduction operation minimum which has no identity" + ] + } + ], "source": [ + "%reload_ext autoreload\n", + "%autoreload 2\n", + "\n", "import numpy as np\n", "from PIL import Image\n", "from lmd.lib import SegmentationLoader\n", @@ -26,16 +1346,45 @@ "sl = SegmentationLoader(config = loader_config)\n", "shape_collection = sl(segmentation, \n", " cell_sets, \n", - " calibration_points)\n", - " \n", - "shape_collection.plot(fig_size = (10, 10))\n" + " calibration_points)\n" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "100%|██████████| 208/208 [00:00<00:00, 210.22it/s]\n" + ] + } + ], + "source": [ + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "ename": "FileNotFoundError", + "evalue": "[Errno 2] No such file or directory: 'channels.npy'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[2], line 9\u001b[0m\n\u001b[1;32m 6\u001b[0m im \u001b[38;5;241m=\u001b[39m Image\u001b[38;5;241m.\u001b[39mopen(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msegmentation_cytosol.tiff\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 7\u001b[0m segmentation \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39marray(im)\n\u001b[0;32m----> 9\u001b[0m im \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mchannels.npy\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 10\u001b[0m dapi \u001b[38;5;241m=\u001b[39m im[\u001b[38;5;241m0\u001b[39m]\n\u001b[1;32m 12\u001b[0m all_classes \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39munique(segmentation)\n", + "File \u001b[0;32m~/miniconda3/envs/pylmd/lib/python3.9/site-packages/numpy/lib/_npyio_impl.py:455\u001b[0m, in \u001b[0;36mload\u001b[0;34m(file, mmap_mode, allow_pickle, fix_imports, encoding, max_header_size)\u001b[0m\n\u001b[1;32m 453\u001b[0m own_fid \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[1;32m 454\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 455\u001b[0m fid \u001b[38;5;241m=\u001b[39m stack\u001b[38;5;241m.\u001b[39menter_context(\u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfspath\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mrb\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m)\n\u001b[1;32m 456\u001b[0m own_fid \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 458\u001b[0m \u001b[38;5;66;03m# Code to distinguish from NumPy binary files and pickles.\u001b[39;00m\n", + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'channels.npy'" + ] + } + ], "source": [ "import numpy as np\n", "from PIL import Image\n", @@ -546,7 +1895,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.2" + "version": "3.9.19" }, "orig_nbformat": 4 }, diff --git a/src/lmd/lib.py b/src/lmd/lib.py index b24e57b..6603f17 100755 --- a/src/lmd/lib.py +++ b/src/lmd/lib.py @@ -606,6 +606,7 @@ def __init__(self, config = {}, verbose = False, processes = 1): self.register_parameter('processes', 10) self.register_parameter('join_intersecting', True) self.register_parameter('orientation_transform', np.eye(2)) + self.register_parameter('threads', 1) self.coords_lookup = None self.processes = processes @@ -641,7 +642,6 @@ def __call__(self, input_segmentation, cell_sets, calibration_points, coords_loo self.coords_lookup = coords_lookup #try multithreading - if self.processes > 1: self.log("Processing cell sets in parallel") args = [] @@ -659,6 +659,8 @@ def __call__(self, input_segmentation, cell_sets, calibration_points, coords_loo n_threads = self.processes ) else: + print("Processing cell sets in serial") + print(cell_set) collections = [] for i, cell_set in enumerate(cell_sets): collections.append(self.generate_cutting_data(i, cell_set)) @@ -698,6 +700,10 @@ def generate_cutting_data(self, i, cell_set): self.log("Check failed, returned coordinates contain empty elements. Please check if all classes specified are present in your segmentation") if self.config['join_intersecting']: + print("Merging intersecting shapes") + print('center', center) + print('length', length) + print('coords', coords) center, length, coords = self.merge_dilated_shapes(center, length, coords, dilation = self.config['shape_dilation'], erosion = self.config['shape_erosion'])