[27c943]: / docs / old_docs / ybuild / latex / PathFlowAI.tex

Download this file

3590 lines (2543 with data), 197.2 kB

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
%% Generated by Sphinx.
\def\sphinxdocclass{report}
\documentclass[letterpaper,10pt,english]{sphinxmanual}
\ifdefined\pdfpxdimen
\let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=.75bp\relax
\PassOptionsToPackage{warn}{textcomp}
\usepackage[utf8]{inputenc}
\ifdefined\DeclareUnicodeCharacter
% support both utf8 and utf8x syntaxes
\ifdefined\DeclareUnicodeCharacterAsOptional
\def\sphinxDUC#1{\DeclareUnicodeCharacter{"#1}}
\else
\let\sphinxDUC\DeclareUnicodeCharacter
\fi
\sphinxDUC{00A0}{\nobreakspace}
\sphinxDUC{2500}{\sphinxunichar{2500}}
\sphinxDUC{2502}{\sphinxunichar{2502}}
\sphinxDUC{2514}{\sphinxunichar{2514}}
\sphinxDUC{251C}{\sphinxunichar{251C}}
\sphinxDUC{2572}{\textbackslash}
\fi
\usepackage{cmap}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb,amstext}
\usepackage{babel}
\usepackage{times}
\expandafter\ifx\csname T@LGR\endcsname\relax
\else
% LGR was declared as font encoding
\substitutefont{LGR}{\rmdefault}{cmr}
\substitutefont{LGR}{\sfdefault}{cmss}
\substitutefont{LGR}{\ttdefault}{cmtt}
\fi
\expandafter\ifx\csname T@X2\endcsname\relax
\expandafter\ifx\csname T@T2A\endcsname\relax
\else
% T2A was declared as font encoding
\substitutefont{T2A}{\rmdefault}{cmr}
\substitutefont{T2A}{\sfdefault}{cmss}
\substitutefont{T2A}{\ttdefault}{cmtt}
\fi
\else
% X2 was declared as font encoding
\substitutefont{X2}{\rmdefault}{cmr}
\substitutefont{X2}{\sfdefault}{cmss}
\substitutefont{X2}{\ttdefault}{cmtt}
\fi
\usepackage[Bjarne]{fncychap}
\usepackage{sphinx}
\fvset{fontsize=\small}
\usepackage{geometry}
% Include hyperref last.
\usepackage{hyperref}
% Fix anchor placement for figures with captions.
\usepackage{hypcap}% it must be loaded after hyperref.
% Set up styles of URL: it should be placed after hyperref.
\urlstyle{same}
\addto\captionsenglish{\renewcommand{\contentsname}{Contents:}}
\usepackage{sphinxmessages}
\setcounter{tocdepth}{1}
\title{PathFlowAI Documentation}
\date{Jul 31, 2019}
\release{0.1}
\author{Joshua Levy}
\newcommand{\sphinxlogo}{\vbox{}}
\renewcommand{\releasename}{Release}
\makeindex
\begin{document}
\pagestyle{empty}
\sphinxmaketitle
\pagestyle{plain}
\sphinxtableofcontents
\pagestyle{normal}
\phantomsection\label{\detokenize{index::doc}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{1}.jpeg}\hspace*{\fill}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{2}.jpeg}\hspace*{\fill}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{3}.jpeg}\hspace*{\fill}}
\noindent{\hspace*{\fill}\sphinxincludegraphics[width=480.00000\sphinxpxdimen,height=360.00000\sphinxpxdimen]{{4}.jpeg}\hspace*{\fill}}
\chapter{pathflowai-preprocess}
\label{\detokenize{index:pathflowai-preprocess}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess \PYG{o}{[}OPTIONS\PYG{o}{]} COMMAND \PYG{o}{[}ARGS\PYG{o}{]}...
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess command line option@\spxentry{pathflowai-preprocess command line option}!--version@\spxentry{--version}}\index{--version@\spxentry{--version}!pathflowai-preprocess command line option@\spxentry{pathflowai-preprocess command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-version}}\pysigline{\sphinxbfcode{\sphinxupquote{-{-}version}}\sphinxcode{\sphinxupquote{}}}
Show the version and exit.
\end{fulllineitems}
\section{alter\_masks}
\label{\detokenize{index:pathflowai-preprocess-alter-masks}}
Map list of values to other values in mask.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess alter\PYGZus{}masks \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-i, --mask\_dir \textless{}mask\_dir\textgreater{}@\spxentry{-i, --mask\_dir \textless{}mask\_dir\textgreater{}}}\index{-i, --mask\_dir \textless{}mask\_dir\textgreater{}@\spxentry{-i, --mask\_dir \textless{}mask\_dir\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}mask\_dir}}\sphinxcode{\sphinxupquote{~\textless{}mask\_dir\textgreater{}}}}
Input directory for masks. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-o, --output\_dir \textless{}output\_dir\textgreater{}@\spxentry{-o, --output\_dir \textless{}output\_dir\textgreater{}}}\index{-o, --output\_dir \textless{}output\_dir\textgreater{}@\spxentry{-o, --output\_dir \textless{}output\_dir\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}output\_dir}}\sphinxcode{\sphinxupquote{~\textless{}output\_dir\textgreater{}}}}
Output directory for new masks. {[}default: ./outputs/{]}
\end{fulllineitems}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}}\index{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-fr}}\pysigline{\sphinxbfcode{\sphinxupquote{-fr}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}from\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}from\_annotations\textgreater{}}}}
Annotations to switch from. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}!-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}}\index{-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}!pathflowai-preprocess-alter\_masks command line option@\spxentry{pathflowai-preprocess-alter\_masks command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-alter-masks-to}}\pysigline{\sphinxbfcode{\sphinxupquote{-to}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}to\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}to\_annotations\textgreater{}}}}
Annotations to switch to. {[}default: {]}
\end{fulllineitems}
\section{collapse\_annotations}
\label{\detokenize{index:pathflowai-preprocess-collapse-annotations}}
Adds annotation classes areas to other annotation classes in SQL DB when getting rid of some annotation classes.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess collapse\PYGZus{}annotations \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}}\index{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}input\_patch\_db\textgreater{}}}}
Input db. {[}default: patch\_info\_input.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}}\index{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}output\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}output\_patch\_db\textgreater{}}}}
Output db. {[}default: patch\_info\_output.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}}\index{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}@\spxentry{-fr, --from\_annotations \textless{}from\_annotations\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-fr}}\pysigline{\sphinxbfcode{\sphinxupquote{-fr}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}from\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}from\_annotations\textgreater{}}}}
Annotations to switch from. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}}\index{-to, --to\_annotations \textless{}to\_annotations\textgreater{}@\spxentry{-to, --to\_annotations \textless{}to\_annotations\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-to}}\pysigline{\sphinxbfcode{\sphinxupquote{-to}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}to\_annotations}}\sphinxcode{\sphinxupquote{~\textless{}to\_annotations\textgreater{}}}}
Annotations to switch to. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}}\index{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-rb}}\pysigline{\sphinxbfcode{\sphinxupquote{-rb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}remove\_background\_annotation}}\sphinxcode{\sphinxupquote{~\textless{}remove\_background\_annotation\textgreater{}}}}
If selected, removes 100\% background patches based on this annotation. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}!-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}}\index{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}!pathflowai-preprocess-collapse\_annotations command line option@\spxentry{pathflowai-preprocess-collapse\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-collapse-annotations-ma}}\pysigline{\sphinxbfcode{\sphinxupquote{-ma}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}max\_background\_area}}\sphinxcode{\sphinxupquote{~\textless{}max\_background\_area\textgreater{}}}}
Max background area before exclusion. {[}default: 0.05{]}
\end{fulllineitems}
\section{preprocess\_pipeline}
\label{\detokenize{index:pathflowai-preprocess-preprocess-pipeline}}
Preprocessing pipeline that accomplishes 3 things. 1: storage into ZARR format, 2: optional mask adjustment, 3: storage of patch-level information into SQL DB
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess preprocess\PYGZus{}pipeline \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-npy, --img2npy@\spxentry{-npy, --img2npy}}\index{-npy, --img2npy@\spxentry{-npy, --img2npy}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-npy}}\pysigline{\sphinxbfcode{\sphinxupquote{-npy}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}img2npy}}\sphinxcode{\sphinxupquote{}}}
Image to numpy for faster read. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}}\index{-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-a}}\pysigline{\sphinxbfcode{\sphinxupquote{-a}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotations}}\sphinxcode{\sphinxupquote{~\textless{}annotations\textgreater{}}}}
Annotations in image in order. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-pr, --preprocess@\spxentry{-pr, --preprocess}}\index{-pr, --preprocess@\spxentry{-pr, --preprocess}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-pr}}\pysigline{\sphinxbfcode{\sphinxupquote{-pr}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}preprocess}}\sphinxcode{\sphinxupquote{}}}
Run preprocessing pipeline. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-pa, --patches@\spxentry{-pa, --patches}}\index{-pa, --patches@\spxentry{-pa, --patches}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-pa}}\pysigline{\sphinxbfcode{\sphinxupquote{-pa}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patches}}\sphinxcode{\sphinxupquote{}}}
Add patches to SQL. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-t, --threshold \textless{}threshold\textgreater{}@\spxentry{-t, --threshold \textless{}threshold\textgreater{}}}\index{-t, --threshold \textless{}threshold\textgreater{}@\spxentry{-t, --threshold \textless{}threshold\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-t}}\pysigline{\sphinxbfcode{\sphinxupquote{-t}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}threshold}}\sphinxcode{\sphinxupquote{~\textless{}threshold\textgreater{}}}}
Threshold to remove non-purple slides. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}@\spxentry{-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}}}\index{-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}@\spxentry{-it, --intensity\_threshold \textless{}intensity\_threshold\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-it}}\pysigline{\sphinxbfcode{\sphinxupquote{-it}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}intensity\_threshold}}\sphinxcode{\sphinxupquote{~\textless{}intensity\_threshold\textgreater{}}}}
Intensity threshold to rate a pixel as non-white. {[}default: 100.0{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-g, --generate\_finetune\_segmentation@\spxentry{-g, --generate\_finetune\_segmentation}}\index{-g, --generate\_finetune\_segmentation@\spxentry{-g, --generate\_finetune\_segmentation}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-g}}\pysigline{\sphinxbfcode{\sphinxupquote{-g}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}generate\_finetune\_segmentation}}\sphinxcode{\sphinxupquote{}}}
Generate patches for one segmentation mask class for targeted finetuning. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}@\spxentry{-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}}}\index{-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}@\spxentry{-tc, --target\_segmentation\_class \textless{}target\_segmentation\_class\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-tc}}\pysigline{\sphinxbfcode{\sphinxupquote{-tc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}target\_segmentation\_class}}\sphinxcode{\sphinxupquote{~\textless{}target\_segmentation\_class\textgreater{}}}}
Segmentation Class to finetune on, output patches to another db. {[}default: 0{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-tt, --target\_threshold \textless{}target\_threshold\textgreater{}@\spxentry{-tt, --target\_threshold \textless{}target\_threshold\textgreater{}}}\index{-tt, --target\_threshold \textless{}target\_threshold\textgreater{}@\spxentry{-tt, --target\_threshold \textless{}target\_threshold\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-tt}}\pysigline{\sphinxbfcode{\sphinxupquote{-tt}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}target\_threshold}}\sphinxcode{\sphinxupquote{~\textless{}target\_threshold\textgreater{}}}}
Threshold to include target for segmentation if saving one class. {[}default: 0.0{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-odb, --out\_db \textless{}out\_db\textgreater{}@\spxentry{-odb, --out\_db \textless{}out\_db\textgreater{}}}\index{-odb, --out\_db \textless{}out\_db\textgreater{}@\spxentry{-odb, --out\_db \textless{}out\_db\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-odb}}\pysigline{\sphinxbfcode{\sphinxupquote{-odb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}out\_db}}\sphinxcode{\sphinxupquote{~\textless{}out\_db\textgreater{}}}}
Output patch database. {[}default: ./patch\_info.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-am, --adjust\_mask@\spxentry{-am, --adjust\_mask}}\index{-am, --adjust\_mask@\spxentry{-am, --adjust\_mask}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-am}}\pysigline{\sphinxbfcode{\sphinxupquote{-am}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}adjust\_mask}}\sphinxcode{\sphinxupquote{}}}
Remove additional background regions from annotation mask. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}}\index{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-nn}}\pysigline{\sphinxbfcode{\sphinxupquote{-nn}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_neighbors}}\sphinxcode{\sphinxupquote{~\textless{}n\_neighbors\textgreater{}}}}
If adjusting mask, number of neighbors connectivity to remove. {[}default: 5{]}
\end{fulllineitems}
\index{pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}!-bp, --basic\_preprocess@\spxentry{-bp, --basic\_preprocess}}\index{-bp, --basic\_preprocess@\spxentry{-bp, --basic\_preprocess}!pathflowai-preprocess-preprocess\_pipeline command line option@\spxentry{pathflowai-preprocess-preprocess\_pipeline command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-preprocess-pipeline-bp}}\pysigline{\sphinxbfcode{\sphinxupquote{-bp}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basic\_preprocess}}\sphinxcode{\sphinxupquote{}}}
Basic preprocessing pipeline, annotation areas are not saved. Used for benchmarking tool against comparable pipelines {[}default: False{]}
\end{fulllineitems}
\section{remove\_basename\_from\_db}
\label{\detokenize{index:pathflowai-preprocess-remove-basename-from-db}}
Removes basename/ID from SQL DB.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}preprocess remove\PYGZus{}basename\PYGZus{}from\PYGZus{}db \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}}\index{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}@\spxentry{-i, --input\_patch\_db \textless{}input\_patch\_db\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}input\_patch\_db\textgreater{}}}}
Input db. {[}default: patch\_info\_input.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}}\index{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}@\spxentry{-o, --output\_patch\_db \textless{}output\_patch\_db\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}output\_patch\_db}}\sphinxcode{\sphinxupquote{~\textless{}output\_patch\_db\textgreater{}}}}
Output db. {[}default: patch\_info\_output.db{]}
\end{fulllineitems}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-preprocess-remove\_basename\_from\_db command line option@\spxentry{pathflowai-preprocess-remove\_basename\_from\_db command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-preprocess-remove-basename-from-db-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\chapter{pathflowai-visualize}
\label{\detokenize{index:pathflowai-visualize}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize \PYG{o}{[}OPTIONS\PYG{o}{]} COMMAND \PYG{o}{[}ARGS\PYG{o}{]}...
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize command line option@\spxentry{pathflowai-visualize command line option}!--version@\spxentry{--version}}\index{--version@\spxentry{--version}!pathflowai-visualize command line option@\spxentry{pathflowai-visualize command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-version}}\pysigline{\sphinxbfcode{\sphinxupquote{-{-}version}}\sphinxcode{\sphinxupquote{}}}
Show the version and exit.
\end{fulllineitems}
\section{extract\_patch}
\label{\detokenize{index:pathflowai-visualize-extract-patch}}
Extract image of patch of any size/location and output to image file
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize extract\PYGZus{}patch \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}}\index{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-p}}\pysigline{\sphinxbfcode{\sphinxupquote{-p}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_info\_file}}\sphinxcode{\sphinxupquote{~\textless{}patch\_info\_file\textgreater{}}}}
Datbase containing all patches {[}default: patch\_info.db{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-x, --x \textless{}x\textgreater{}@\spxentry{-x, --x \textless{}x\textgreater{}}}\index{-x, --x \textless{}x\textgreater{}@\spxentry{-x, --x \textless{}x\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-x}}\pysigline{\sphinxbfcode{\sphinxupquote{-x}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}x}}\sphinxcode{\sphinxupquote{~\textless{}x\textgreater{}}}}
X Coordinate of patch. {[}default: 0{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-y, --y \textless{}y\textgreater{}@\spxentry{-y, --y \textless{}y\textgreater{}}}\index{-y, --y \textless{}y\textgreater{}@\spxentry{-y, --y \textless{}y\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-y}}\pysigline{\sphinxbfcode{\sphinxupquote{-y}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}y}}\sphinxcode{\sphinxupquote{~\textless{}y\textgreater{}}}}
Y coordinate of patch. {[}default: 0{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}}\index{-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfname}}\sphinxcode{\sphinxupquote{~\textless{}outputfname\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-s, --segmentation@\spxentry{-s, --segmentation}}\index{-s, --segmentation@\spxentry{-s, --segmentation}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-s}}\pysigline{\sphinxbfcode{\sphinxupquote{-s}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}segmentation}}\sphinxcode{\sphinxupquote{}}}
Plot segmentations. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}}\index{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-sc}}\pysigline{\sphinxbfcode{\sphinxupquote{-sc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_segmentation\_classes}}\sphinxcode{\sphinxupquote{~\textless{}n\_segmentation\_classes\textgreater{}}}}
Number segmentation classes {[}default: 4{]}
\end{fulllineitems}
\index{pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}!-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}}\index{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}!pathflowai-visualize-extract\_patch command line option@\spxentry{pathflowai-visualize-extract\_patch command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-extract-patch-c}}\pysigline{\sphinxbfcode{\sphinxupquote{-c}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}custom\_segmentation}}\sphinxcode{\sphinxupquote{~\textless{}custom\_segmentation\textgreater{}}}}
Add custom segmentation map from prediction, in npy {[}default: {]}
\end{fulllineitems}
\section{overlay\_new\_annotations}
\label{\detokenize{index:pathflowai-visualize-overlay-new-annotations}}
Custom annotations, in format {[}Point: x, y, Point: x, y … {]} one line like this per polygon, overlap these polygons on top of WSI.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize overlay\PYGZus{}new\PYGZus{}annotations \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-i, --img\_file \textless{}img\_file\textgreater{}@\spxentry{-i, --img\_file \textless{}img\_file\textgreater{}}}\index{-i, --img\_file \textless{}img\_file\textgreater{}@\spxentry{-i, --img\_file \textless{}img\_file\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}img\_file}}\sphinxcode{\sphinxupquote{~\textless{}img\_file\textgreater{}}}}
Input image. {[}default: image.txt{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}@\spxentry{-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}}}\index{-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}@\spxentry{-a, --annotation\_txt \textless{}annotation\_txt\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-a}}\pysigline{\sphinxbfcode{\sphinxupquote{-a}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotation\_txt}}\sphinxcode{\sphinxupquote{~\textless{}annotation\_txt\textgreater{}}}}
Column of annotations {[}default: annotation.txt{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}@\spxentry{-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}}}\index{-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}@\spxentry{-ocf, --original\_compression\_factor \textless{}original\_compression\_factor\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-ocf}}\pysigline{\sphinxbfcode{\sphinxupquote{-ocf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}original\_compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}original\_compression\_factor\textgreater{}}}}
How much compress image. {[}default: 1.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}}\index{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-cf}}\pysigline{\sphinxbfcode{\sphinxupquote{-cf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}compression\_factor\textgreater{}}}}
How much compress image. {[}default: 3.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}!-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}}\index{-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}!pathflowai-visualize-overlay\_new\_annotations command line option@\spxentry{pathflowai-visualize-overlay\_new\_annotations command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-overlay-new-annotations-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfilename}}\sphinxcode{\sphinxupquote{~\textless{}outputfilename\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\section{plot\_embeddings}
\label{\detokenize{index:pathflowai-visualize-plot-embeddings}}
Perform UMAP embeddings of patches and plot using plotly.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}embeddings \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}}}\index{-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-i, --embeddings\_file \textless{}embeddings\_file\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}embeddings\_file}}\sphinxcode{\sphinxupquote{~\textless{}embeddings\_file\textgreater{}}}}
Embeddings. {[}default: predictions/embeddings.pkl{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}@\spxentry{-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}}}\index{-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}@\spxentry{-o, --plotly\_output\_file \textless{}plotly\_output\_file\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}plotly\_output\_file}}\sphinxcode{\sphinxupquote{~\textless{}plotly\_output\_file\textgreater{}}}}
Plotly output file. {[}default: predictions/embeddings.html{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}}\index{-a, --annotations \textless{}annotations\textgreater{}@\spxentry{-a, --annotations \textless{}annotations\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-a}}\pysigline{\sphinxbfcode{\sphinxupquote{-a}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotations}}\sphinxcode{\sphinxupquote{~\textless{}annotations\textgreater{}}}}
Multiple annotations to color image. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}}\index{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-rb}}\pysigline{\sphinxbfcode{\sphinxupquote{-rb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}remove\_background\_annotation}}\sphinxcode{\sphinxupquote{~\textless{}remove\_background\_annotation\textgreater{}}}}
If selected, removes 100\% background patches based on this annotation. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}}\index{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-ma}}\pysigline{\sphinxbfcode{\sphinxupquote{-ma}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}max\_background\_area}}\sphinxcode{\sphinxupquote{~\textless{}max\_background\_area\textgreater{}}}}
Max background area before exclusion. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}!-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}}\index{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}!pathflowai-visualize-plot\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-embeddings-nn}}\pysigline{\sphinxbfcode{\sphinxupquote{-nn}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_neighbors}}\sphinxcode{\sphinxupquote{~\textless{}n\_neighbors\textgreater{}}}}
Number nearest neighbors. {[}default: 8{]}
\end{fulllineitems}
\section{plot\_image}
\label{\detokenize{index:pathflowai-visualize-plot-image}}
Plots the whole slide image supplied.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}image \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}!-i, --image\_file \textless{}image\_file\textgreater{}@\spxentry{-i, --image\_file \textless{}image\_file\textgreater{}}}\index{-i, --image\_file \textless{}image\_file\textgreater{}@\spxentry{-i, --image\_file \textless{}image\_file\textgreater{}}!pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}image\_file}}\sphinxcode{\sphinxupquote{~\textless{}image\_file\textgreater{}}}}
Input image file. {[}default: ./inputs/a.svs{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}!-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}}\index{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}!pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-cf}}\pysigline{\sphinxbfcode{\sphinxupquote{-cf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}compression\_factor\textgreater{}}}}
How much compress image. {[}default: 3.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}!-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}}\index{-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}!pathflowai-visualize-plot\_image command line option@\spxentry{pathflowai-visualize-plot\_image command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfname}}\sphinxcode{\sphinxupquote{~\textless{}outputfname\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\section{plot\_image\_umap\_embeddings}
\label{\detokenize{index:pathflowai-visualize-plot-image-umap-embeddings}}
Plots a UMAP embedding with each point as its corresponding patch image.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}image\PYGZus{}umap\PYGZus{}embeddings \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}}}\index{-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}@\spxentry{-e, --embeddings\_file \textless{}embeddings\_file\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-e}}\pysigline{\sphinxbfcode{\sphinxupquote{-e}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}embeddings\_file}}\sphinxcode{\sphinxupquote{~\textless{}embeddings\_file\textgreater{}}}}
Embeddings. {[}default: predictions/embeddings.pkl{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}}\index{-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfilename}}\sphinxcode{\sphinxupquote{~\textless{}outputfilename\textgreater{}}}}
Embedding visualization. {[}default: predictions/shap\_plots.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-mpl, --mpl\_scatter@\spxentry{-mpl, --mpl\_scatter}}\index{-mpl, --mpl\_scatter@\spxentry{-mpl, --mpl\_scatter}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-mpl}}\pysigline{\sphinxbfcode{\sphinxupquote{-mpl}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}mpl\_scatter}}\sphinxcode{\sphinxupquote{}}}
Plot segmentations. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}}\index{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}@\spxentry{-rb, --remove\_background\_annotation \textless{}remove\_background\_annotation\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-rb}}\pysigline{\sphinxbfcode{\sphinxupquote{-rb}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}remove\_background\_annotation}}\sphinxcode{\sphinxupquote{~\textless{}remove\_background\_annotation\textgreater{}}}}
If selected, removes 100\% background patches based on this annotation. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}}\index{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}@\spxentry{-ma, --max\_background\_area \textless{}max\_background\_area\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-ma}}\pysigline{\sphinxbfcode{\sphinxupquote{-ma}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}max\_background\_area}}\sphinxcode{\sphinxupquote{~\textless{}max\_background\_area\textgreater{}}}}
Max background area before exclusion. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-z, --zoom \textless{}zoom\textgreater{}@\spxentry{-z, --zoom \textless{}zoom\textgreater{}}}\index{-z, --zoom \textless{}zoom\textgreater{}@\spxentry{-z, --zoom \textless{}zoom\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-z}}\pysigline{\sphinxbfcode{\sphinxupquote{-z}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}zoom}}\sphinxcode{\sphinxupquote{~\textless{}zoom\textgreater{}}}}
Size of images. {[}default: 0.05{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}}\index{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}@\spxentry{-nn, --n\_neighbors \textless{}n\_neighbors\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-nn}}\pysigline{\sphinxbfcode{\sphinxupquote{-nn}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_neighbors}}\sphinxcode{\sphinxupquote{~\textless{}n\_neighbors\textgreater{}}}}
Number nearest neighbors. {[}default: 8{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-sc, --sort\_col \textless{}sort\_col\textgreater{}@\spxentry{-sc, --sort\_col \textless{}sort\_col\textgreater{}}}\index{-sc, --sort\_col \textless{}sort\_col\textgreater{}@\spxentry{-sc, --sort\_col \textless{}sort\_col\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-sc}}\pysigline{\sphinxbfcode{\sphinxupquote{-sc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}sort\_col}}\sphinxcode{\sphinxupquote{~\textless{}sort\_col\textgreater{}}}}
Sort samples on this column. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}!-sm, --sort\_mode \textless{}sort\_mode\textgreater{}@\spxentry{-sm, --sort\_mode \textless{}sort\_mode\textgreater{}}}\index{-sm, --sort\_mode \textless{}sort\_mode\textgreater{}@\spxentry{-sm, --sort\_mode \textless{}sort\_mode\textgreater{}}!pathflowai-visualize-plot\_image\_umap\_embeddings command line option@\spxentry{pathflowai-visualize-plot\_image\_umap\_embeddings command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-image-umap-embeddings-sm}}\pysigline{\sphinxbfcode{\sphinxupquote{-sm}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}sort\_mode}}\sphinxcode{\sphinxupquote{~\textless{}sort\_mode\textgreater{}}}}
Sort ascending or descending. {[}default: asc{]}
\begin{quote}\begin{description}
\item[{Options}] \leavevmode
asc\textbar{}desc
\end{description}\end{quote}
\end{fulllineitems}
\section{plot\_predictions}
\label{\detokenize{index:pathflowai-visualize-plot-predictions}}
Overlays classification, regression and segmentation patch level predictions on top of whole slide image.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize plot\PYGZus{}predictions \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}}\index{-i, --input\_dir \textless{}input\_dir\textgreater{}@\spxentry{-i, --input\_dir \textless{}input\_dir\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-i}}\pysigline{\sphinxbfcode{\sphinxupquote{-i}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}input\_dir}}\sphinxcode{\sphinxupquote{~\textless{}input\_dir\textgreater{}}}}
Input directory for patches. {[}default: ./inputs/{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}}\index{-b, --basename \textless{}basename\textgreater{}@\spxentry{-b, --basename \textless{}basename\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-b}}\pysigline{\sphinxbfcode{\sphinxupquote{-b}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}basename}}\sphinxcode{\sphinxupquote{~\textless{}basename\textgreater{}}}}
Basename of patches. {[}default: A01{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}}\index{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}@\spxentry{-p, --patch\_info\_file \textless{}patch\_info\_file\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-p}}\pysigline{\sphinxbfcode{\sphinxupquote{-p}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_info\_file}}\sphinxcode{\sphinxupquote{~\textless{}patch\_info\_file\textgreater{}}}}
Datbase containing all patches {[}default: patch\_info.db{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}}\index{-ps, --patch\_size \textless{}patch\_size\textgreater{}@\spxentry{-ps, --patch\_size \textless{}patch\_size\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-ps}}\pysigline{\sphinxbfcode{\sphinxupquote{-ps}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}patch\_size}}\sphinxcode{\sphinxupquote{~\textless{}patch\_size\textgreater{}}}}
Patch size. {[}default: 224{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}}\index{-o, --outputfname \textless{}outputfname\textgreater{}@\spxentry{-o, --outputfname \textless{}outputfname\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfname}}\sphinxcode{\sphinxupquote{~\textless{}outputfname\textgreater{}}}}
Output extracted image. {[}default: ./output\_image.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-an, --annotations@\spxentry{-an, --annotations}}\index{-an, --annotations@\spxentry{-an, --annotations}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-an}}\pysigline{\sphinxbfcode{\sphinxupquote{-an}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotations}}\sphinxcode{\sphinxupquote{}}}
Plot annotations instead of predictions. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}}\index{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}@\spxentry{-cf, --compression\_factor \textless{}compression\_factor\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-cf}}\pysigline{\sphinxbfcode{\sphinxupquote{-cf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}compression\_factor}}\sphinxcode{\sphinxupquote{~\textless{}compression\_factor\textgreater{}}}}
How much compress image. {[}default: 3.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-al, --alpha \textless{}alpha\textgreater{}@\spxentry{-al, --alpha \textless{}alpha\textgreater{}}}\index{-al, --alpha \textless{}alpha\textgreater{}@\spxentry{-al, --alpha \textless{}alpha\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-al}}\pysigline{\sphinxbfcode{\sphinxupquote{-al}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}alpha}}\sphinxcode{\sphinxupquote{~\textless{}alpha\textgreater{}}}}
How much to give annotations/predictions versus original image. {[}default: 0.8{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-s, --segmentation@\spxentry{-s, --segmentation}}\index{-s, --segmentation@\spxentry{-s, --segmentation}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-s}}\pysigline{\sphinxbfcode{\sphinxupquote{-s}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}segmentation}}\sphinxcode{\sphinxupquote{}}}
Plot segmentations. {[}default: False{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}}\index{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}@\spxentry{-sc, --n\_segmentation\_classes \textless{}n\_segmentation\_classes\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-sc}}\pysigline{\sphinxbfcode{\sphinxupquote{-sc}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_segmentation\_classes}}\sphinxcode{\sphinxupquote{~\textless{}n\_segmentation\_classes\textgreater{}}}}
Number segmentation classes {[}default: 4{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}}\index{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}@\spxentry{-c, --custom\_segmentation \textless{}custom\_segmentation\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-c}}\pysigline{\sphinxbfcode{\sphinxupquote{-c}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}custom\_segmentation}}\sphinxcode{\sphinxupquote{~\textless{}custom\_segmentation\textgreater{}}}}
Add custom segmentation map from prediction, npy format. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-ac, --annotation\_col \textless{}annotation\_col\textgreater{}@\spxentry{-ac, --annotation\_col \textless{}annotation\_col\textgreater{}}}\index{-ac, --annotation\_col \textless{}annotation\_col\textgreater{}@\spxentry{-ac, --annotation\_col \textless{}annotation\_col\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-ac}}\pysigline{\sphinxbfcode{\sphinxupquote{-ac}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}annotation\_col}}\sphinxcode{\sphinxupquote{~\textless{}annotation\_col\textgreater{}}}}
Column of annotations {[}default: annotation{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}@\spxentry{-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}}}\index{-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}@\spxentry{-sf, --scaling\_factor \textless{}scaling\_factor\textgreater{}}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-sf}}\pysigline{\sphinxbfcode{\sphinxupquote{-sf}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}scaling\_factor}}\sphinxcode{\sphinxupquote{~\textless{}scaling\_factor\textgreater{}}}}
Multiply all prediction scores by this amount. {[}default: 1.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}!-tif, --tif\_file@\spxentry{-tif, --tif\_file}}\index{-tif, --tif\_file@\spxentry{-tif, --tif\_file}!pathflowai-visualize-plot\_predictions command line option@\spxentry{pathflowai-visualize-plot\_predictions command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-plot-predictions-tif}}\pysigline{\sphinxbfcode{\sphinxupquote{-tif}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}tif\_file}}\sphinxcode{\sphinxupquote{}}}
Write to tiff file. {[}default: False{]}
\end{fulllineitems}
\section{shapley\_plot}
\label{\detokenize{index:pathflowai-visualize-shapley-plot}}
Run SHAPley attribution method on patches after classification task to see where model made prediction based on.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}visualize shapley\PYGZus{}plot \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-m, --model\_pkl \textless{}model\_pkl\textgreater{}@\spxentry{-m, --model\_pkl \textless{}model\_pkl\textgreater{}}}\index{-m, --model\_pkl \textless{}model\_pkl\textgreater{}@\spxentry{-m, --model\_pkl \textless{}model\_pkl\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-m}}\pysigline{\sphinxbfcode{\sphinxupquote{-m}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}model\_pkl}}\sphinxcode{\sphinxupquote{~\textless{}model\_pkl\textgreater{}}}}
Plotly output file. {[}default: {]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-bs, --batch\_size \textless{}batch\_size\textgreater{}@\spxentry{-bs, --batch\_size \textless{}batch\_size\textgreater{}}}\index{-bs, --batch\_size \textless{}batch\_size\textgreater{}@\spxentry{-bs, --batch\_size \textless{}batch\_size\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-bs}}\pysigline{\sphinxbfcode{\sphinxupquote{-bs}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}batch\_size}}\sphinxcode{\sphinxupquote{~\textless{}batch\_size\textgreater{}}}}
Batch size. {[}default: 32{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}}\index{-o, --outputfilename \textless{}outputfilename\textgreater{}@\spxentry{-o, --outputfilename \textless{}outputfilename\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-o}}\pysigline{\sphinxbfcode{\sphinxupquote{-o}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}outputfilename}}\sphinxcode{\sphinxupquote{~\textless{}outputfilename\textgreater{}}}}
SHAPley visualization. {[}default: predictions/shap\_plots.png{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-mth, --method \textless{}method\textgreater{}@\spxentry{-mth, --method \textless{}method\textgreater{}}}\index{-mth, --method \textless{}method\textgreater{}@\spxentry{-mth, --method \textless{}method\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-mth}}\pysigline{\sphinxbfcode{\sphinxupquote{-mth}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}method}}\sphinxcode{\sphinxupquote{~\textless{}method\textgreater{}}}}
Method of explaining. {[}default: deep{]}
\begin{quote}\begin{description}
\item[{Options}] \leavevmode
deep\textbar{}gradient
\end{description}\end{quote}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}@\spxentry{-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}}}\index{-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}@\spxentry{-l, --local\_smoothing \textless{}local\_smoothing\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-l}}\pysigline{\sphinxbfcode{\sphinxupquote{-l}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}local\_smoothing}}\sphinxcode{\sphinxupquote{~\textless{}local\_smoothing\textgreater{}}}}
Local smoothing of SHAP scores. {[}default: 0.0{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-ns, --n\_samples \textless{}n\_samples\textgreater{}@\spxentry{-ns, --n\_samples \textless{}n\_samples\textgreater{}}}\index{-ns, --n\_samples \textless{}n\_samples\textgreater{}@\spxentry{-ns, --n\_samples \textless{}n\_samples\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-ns}}\pysigline{\sphinxbfcode{\sphinxupquote{-ns}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}n\_samples}}\sphinxcode{\sphinxupquote{~\textless{}n\_samples\textgreater{}}}}
Number shapley samples for shapley regression (gradient explainer). {[}default: 32{]}
\end{fulllineitems}
\index{pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}!-p, --pred\_out \textless{}pred\_out\textgreater{}@\spxentry{-p, --pred\_out \textless{}pred\_out\textgreater{}}}\index{-p, --pred\_out \textless{}pred\_out\textgreater{}@\spxentry{-p, --pred\_out \textless{}pred\_out\textgreater{}}!pathflowai-visualize-shapley\_plot command line option@\spxentry{pathflowai-visualize-shapley\_plot command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-visualize-shapley-plot-p}}\pysigline{\sphinxbfcode{\sphinxupquote{-p}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}pred\_out}}\sphinxcode{\sphinxupquote{~\textless{}pred\_out\textgreater{}}}}
If not none, output prediction as shap label. {[}default: none{]}
\begin{quote}\begin{description}
\item[{Options}] \leavevmode
none\textbar{}sigmoid\textbar{}softmax
\end{description}\end{quote}
\end{fulllineitems}
\chapter{pathflowai-monitor}
\label{\detokenize{index:pathflowai-monitor}}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}monitor \PYG{o}{[}OPTIONS\PYG{o}{]} COMMAND \PYG{o}{[}ARGS\PYG{o}{]}...
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-monitor command line option@\spxentry{pathflowai-monitor command line option}!--version@\spxentry{--version}}\index{--version@\spxentry{--version}!pathflowai-monitor command line option@\spxentry{pathflowai-monitor command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-version}}\pysigline{\sphinxbfcode{\sphinxupquote{-{-}version}}\sphinxcode{\sphinxupquote{}}}
Show the version and exit.
\end{fulllineitems}
\section{monitor\_usage}
\label{\detokenize{index:pathflowai-monitor-monitor-usage}}
Monitor Usage over Time Interval.
\begin{sphinxVerbatim}[commandchars=\\\{\}]
pathflowai\PYGZhy{}monitor monitor\PYGZus{}usage \PYG{o}{[}OPTIONS\PYG{o}{]}
\end{sphinxVerbatim}
\subsubsection*{Options}
\index{pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}!-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}@\spxentry{-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}}}\index{-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}@\spxentry{-csv, --records\_output\_csv \textless{}records\_output\_csv\textgreater{}}!pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-monitor-usage-csv}}\pysigline{\sphinxbfcode{\sphinxupquote{-csv}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}records\_output\_csv}}\sphinxcode{\sphinxupquote{~\textless{}records\_output\_csv\textgreater{}}}}
Where to store records. {[}default: records.csv{]}
\end{fulllineitems}
\index{pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}!-tt, --total\_time \textless{}total\_time\textgreater{}@\spxentry{-tt, --total\_time \textless{}total\_time\textgreater{}}}\index{-tt, --total\_time \textless{}total\_time\textgreater{}@\spxentry{-tt, --total\_time \textless{}total\_time\textgreater{}}!pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-monitor-usage-tt}}\pysigline{\sphinxbfcode{\sphinxupquote{-tt}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}total\_time}}\sphinxcode{\sphinxupquote{~\textless{}total\_time\textgreater{}}}}
Total time to monitor for in minutes. {[}default: 1.0{]}
\end{fulllineitems}
\index{pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}!-dt, --delay\_time \textless{}delay\_time\textgreater{}@\spxentry{-dt, --delay\_time \textless{}delay\_time\textgreater{}}}\index{-dt, --delay\_time \textless{}delay\_time\textgreater{}@\spxentry{-dt, --delay\_time \textless{}delay\_time\textgreater{}}!pathflowai-monitor-monitor\_usage command line option@\spxentry{pathflowai-monitor-monitor\_usage command line option}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:cmdoption-pathflowai-monitor-monitor-usage-dt}}\pysigline{\sphinxbfcode{\sphinxupquote{-dt}}\sphinxcode{\sphinxupquote{}}\sphinxcode{\sphinxupquote{,~}}\sphinxbfcode{\sphinxupquote{-{-}delay\_time}}\sphinxcode{\sphinxupquote{~\textless{}delay\_time\textgreater{}}}}
Time between samples, in seconds. {[}default: 1.0{]}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.datasets}}\index{pathflowai.datasets (module)@\spxentry{pathflowai.datasets}\spxextra{module}}
\chapter{datasets.py}
\label{\detokenize{index:datasets-py}}
Houses the DynamicImageDataset class, also functions to help with image color channel normalization, transformers, etc..
\index{DynamicImageDataset (class in pathflowai.datasets)@\spxentry{DynamicImageDataset}\spxextra{class in pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{DynamicImageDataset}}}{\emph{dataset\_df}, \emph{set}, \emph{patch\_info\_file}, \emph{transformers}, \emph{input\_dir}, \emph{target\_names}, \emph{pos\_annotation\_class}, \emph{other\_annotations={[}{]}}, \emph{segmentation=False}, \emph{patch\_size=224}, \emph{fix\_names=True}, \emph{target\_segmentation\_class=-1}, \emph{target\_threshold=0.0}, \emph{oversampling\_factor=1.0}, \emph{n\_segmentation\_classes=4}, \emph{gdl=False}, \emph{mt\_bce=False}, \emph{classify\_annotations=False}}{}
Generate image dataset that accesses images and annotations via dask.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{dataset\_df:dataframe}}] \leavevmode
Dataframe with WSI, which set it is in (train/test/val) and corresponding WSI labels if applicable.
\item[{\sphinxstylestrong{set:str}}] \leavevmode
Whether train, test, val or pass (normalization) set.
\item[{\sphinxstylestrong{patch\_info\_file:str}}] \leavevmode
SQL db with positional and annotation information on each slide.
\item[{\sphinxstylestrong{transformers:dict}}] \leavevmode
Contains transformers to apply on images.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Directory where images comes from.
\item[{\sphinxstylestrong{target\_names:list/str}}] \leavevmode
Names of initial targets, which may be modified.
\item[{\sphinxstylestrong{pos\_annotation\_class:str}}] \leavevmode
If selected and predicting on WSI, this class is labeled as a positive from the WSI, while the other classes are not.
\item[{\sphinxstylestrong{other\_annotations:list}}] \leavevmode
Other annotations to consider from patch info db.
\item[{\sphinxstylestrong{segmentation:bool}}] \leavevmode
Conducting segmentation task?
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{fix\_names:bool}}] \leavevmode
Whether to change the names of dataset\_df.
\item[{\sphinxstylestrong{target\_segmentation\_class:list}}] \leavevmode
Now can be used for classification as well, matched with two below options, samples images only from this class. Can specify this and below two options multiple times.
\item[{\sphinxstylestrong{target\_threshold:list}}] \leavevmode
Sampled only if above this threshold of occurence in the patches.
\item[{\sphinxstylestrong{oversampling\_factor:list}}] \leavevmode
Over sample them at this amount.
\item[{\sphinxstylestrong{n\_segmentation\_classes:int}}] \leavevmode
Number classes to segment.
\item[{\sphinxstylestrong{gdl:bool}}] \leavevmode
Using generalized dice loss?
\item[{\sphinxstylestrong{mt\_bce:bool}}] \leavevmode
For multi-target prediction tasks.
\item[{\sphinxstylestrong{classify\_annotations:bool}}] \leavevmode
For classifying annotations.
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.binarize_annotations}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{binarize\_annotations}}}}}(self{[}, binarizer, …{]})
&
Label binarize some annotations or threshold them if classifying slide annotations.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.concat}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{concat}}}}}(self, other\_dataset)
&
Concatenate this dataset with others.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.get_class_weights}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_class\_weights}}}}}(self{[}, i{]})
&
Weight loss function with weights inversely proportional to the class appearence.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.retain_ID}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{retain\_ID}}}}}(self, ID)
&
Reduce the sample set to just images from one ID.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.split_by_ID}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{split\_by\_ID}}}}}(self)
&
Generator similar to groupby, but splits up by ID, generates (ID,data) using retain\_ID.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.datasets.DynamicImageDataset.subsample}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{subsample}}}}}(self, p)
&
Sample subset of dataset.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{binarize\_annotations() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{binarize\_annotations()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.binarize_annotations}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{binarize\_annotations}}}{\emph{self}, \emph{binarizer=None}, \emph{num\_targets=1}, \emph{binary\_threshold=0.0}}{}
Label binarize some annotations or threshold them if classifying slide annotations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{binarizer:LabelBinarizer}}] \leavevmode
Binarizes the labels of a column(s)
\item[{\sphinxstylestrong{num\_targets:int}}] \leavevmode
Number of desired targets to preidict on.
\item[{\sphinxstylestrong{binary\_threshold:float}}] \leavevmode
Amount of annotation in patch before positive annotation.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{binarizer}] \leavevmode
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{concat() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{concat()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.concat}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{concat}}}{\emph{self}, \emph{other\_dataset}}{}
Concatenate this dataset with others. Updates its own internal attributes.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{other\_dataset:DynamicImageDataset}}] \leavevmode
Other image dataset.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{get\_class\_weights() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{get\_class\_weights()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.get_class_weights}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_class\_weights}}}{\emph{self}, \emph{i=0}}{}
Weight loss function with weights inversely proportional to the class appearence.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{i:int}}] \leavevmode
If multi-target, class used for weighting.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{self}] \leavevmode
Dataset.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{retain\_ID() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{retain\_ID()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.retain_ID}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{retain\_ID}}}{\emph{self}, \emph{ID}}{}
Reduce the sample set to just images from one ID.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
Basename/ID to predict on.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{self}] \leavevmode
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{split\_by\_ID() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{split\_by\_ID()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.split_by_ID}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{split\_by\_ID}}}{\emph{self}}{}
Generator similar to groupby, but splits up by ID, generates (ID,data) using retain\_ID.
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{generator}] \leavevmode
ID, DynamicDataset
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{subsample() (pathflowai.datasets.DynamicImageDataset method)@\spxentry{subsample()}\spxextra{pathflowai.datasets.DynamicImageDataset method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.DynamicImageDataset.subsample}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{subsample}}}{\emph{self}, \emph{p}}{}
Sample subset of dataset.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{p:float}}] \leavevmode
Fraction to subsample.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\end{fulllineitems}
\index{RandomRotate90() (in module pathflowai.datasets)@\spxentry{RandomRotate90()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.RandomRotate90}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{RandomRotate90}}}{}{}
Transformer for random 90 degree rotation image.
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{function}] \leavevmode
Transformer function for operation.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{create\_transforms() (in module pathflowai.datasets)@\spxentry{create\_transforms()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.create_transforms}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{create\_transforms}}}{\emph{mean}, \emph{std}}{}
Create transformers.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{mean:list}}] \leavevmode
See get\_data\_transforms.
\item[{\sphinxstylestrong{std:list}}] \leavevmode
See get\_data\_transforms.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Transformers.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{get\_data\_transforms() (in module pathflowai.datasets)@\spxentry{get\_data\_transforms()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.get_data_transforms}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{get\_data\_transforms}}}{\emph{patch\_size=None}, \emph{mean={[}{]}}, \emph{std={[}{]}}, \emph{resize=False}, \emph{transform\_platform='torch'}, \emph{elastic=True}}{}
Get data transformers for training test and validation sets.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Original patch size being transformed.
\item[{\sphinxstylestrong{mean:list of float}}] \leavevmode
Mean RGB
\item[{\sphinxstylestrong{std:list of float}}] \leavevmode
Std RGB
\item[{\sphinxstylestrong{resize:int}}] \leavevmode
Which patch size to resize to.
\item[{\sphinxstylestrong{transform\_platform:str}}] \leavevmode
Use pytorch or albumentation transforms.
\item[{\sphinxstylestrong{elastic:bool}}] \leavevmode
Whether to add elastic deformations from albumentations.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Transformers.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{get\_normalizer() (in module pathflowai.datasets)@\spxentry{get\_normalizer()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.get_normalizer}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{get\_normalizer}}}{\emph{normalization\_file}, \emph{dataset\_opts}}{}
Find mean and standard deviation of images in batches.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{normalization\_file:str}}] \leavevmode
File to store normalization information.
\item[{\sphinxstylestrong{dataset\_opts:type}}] \leavevmode
Dictionary storing information to create DynamicDataset class.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Stores RGB mean, stdev.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{segmentation\_transform() (in module pathflowai.datasets)@\spxentry{segmentation\_transform()}\spxextra{in module pathflowai.datasets}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.datasets.segmentation_transform}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.datasets.}}\sphinxbfcode{\sphinxupquote{segmentation\_transform}}}{\emph{img}, \emph{mask}, \emph{transformer}}{}
Run albumentations and return an image and its segmentation mask.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{img:array}}] \leavevmode
Image as array
\item[{\sphinxstylestrong{mask:array}}] \leavevmode
Categorical pixel by pixel.
\item[{\sphinxstylestrong{transformer :}}] \leavevmode
Transformation object.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{tuple arrays}] \leavevmode
Image and mask array.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.losses}}\index{pathflowai.losses (module)@\spxentry{pathflowai.losses}\spxextra{module}}
\chapter{losses.py}
\label{\detokenize{index:losses-py}}
Some additional loss functions that can be called using the pipeline, some of which still to be implemented.
\index{FocalLoss (class in pathflowai.losses)@\spxentry{FocalLoss}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.FocalLoss}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{FocalLoss}}}{\emph{num\_class}, \emph{alpha=None}, \emph{gamma=2}, \emph{balance\_index=-1}, \emph{smooth=None}, \emph{size\_average=True}}{}
\# \sphinxurl{https://raw.githubusercontent.com/Hsuxu/Loss\_ToolBox-PyTorch/master/FocalLoss/FocalLoss.py}
This is a implementation of Focal Loss with smooth label cross entropy supported which is proposed in
‘Focal Loss for Dense Object Detection. (\sphinxurl{https://arxiv.org/abs/1708.02002})’
\begin{quote}
Focal\_Loss= -1*alpha*(1-pt)*log(pt)
\end{quote}
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{itemize}
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{num\_class}} \textendash{}
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{alpha}} \textendash{} (tensor) 3D or 4D the scalar factor for this criterion
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{gamma}} \textendash{} (float,double) gamma \textgreater{} 0 reduces the relative loss for well-classified examples (p\textgreater{}0.5) putting more
focus on hard misclassified example
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{smooth}} \textendash{} (float,double) smooth value when cross entropy
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{balance\_index}} \textendash{} (int) balance class index, should be specific when alpha is float
\item {}
\sphinxstyleliteralstrong{\sphinxupquote{size\_average}} \textendash{} (bool, optional) By default, the losses are averaged over each loss element in the batch.
\end{itemize}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, \textbackslash{}*input, \textbackslash{}*\textbackslash{}*kwargs)
&
Call self as a function.
\\
\hline
\sphinxcode{\sphinxupquote{add\_module}}(self, name, module)
&
Adds a child module to the current module.
\\
\hline
\sphinxcode{\sphinxupquote{apply}}(self, fn)
&
Applies \sphinxcode{\sphinxupquote{fn}} recursively to every submodule (as returned by \sphinxcode{\sphinxupquote{.children()}}) as well as self.
\\
\hline
\sphinxcode{\sphinxupquote{buffers}}(self{[}, recurse{]})
&
Returns an iterator over module buffers.
\\
\hline
\sphinxcode{\sphinxupquote{children}}(self)
&
Returns an iterator over immediate children modules.
\\
\hline
\sphinxcode{\sphinxupquote{cpu}}(self)
&
Moves all model parameters and buffers to the CPU.
\\
\hline
\sphinxcode{\sphinxupquote{cuda}}(self{[}, device{]})
&
Moves all model parameters and buffers to the GPU.
\\
\hline
\sphinxcode{\sphinxupquote{double}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{double}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{eval}}(self)
&
Sets the module in evaluation mode.
\\
\hline
\sphinxcode{\sphinxupquote{extra\_repr}}(self)
&
Set the extra representation of the module
\\
\hline
\sphinxcode{\sphinxupquote{float}}(self)
&
Casts all floating point parameters and buffers to float datatype.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.losses.FocalLoss.forward}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{forward}}}}}(self, logit, target)
&
Defines the computation performed at every call.
\\
\hline
\sphinxcode{\sphinxupquote{half}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{half}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{load\_state\_dict}}(self, state\_dict{[}, strict{]})
&
Copies parameters and buffers from \sphinxcode{\sphinxupquote{state\_dict}} into this module and its descendants.
\\
\hline
\sphinxcode{\sphinxupquote{modules}}(self)
&
Returns an iterator over all modules in the network.
\\
\hline
\sphinxcode{\sphinxupquote{named\_buffers}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_children}}(self)
&
Returns an iterator over immediate children modules, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_modules}}(self{[}, memo, prefix{]})
&
Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_parameters}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.
\\
\hline
\sphinxcode{\sphinxupquote{parameters}}(self{[}, recurse{]})
&
Returns an iterator over module parameters.
\\
\hline
\sphinxcode{\sphinxupquote{register\_backward\_hook}}(self, hook)
&
Registers a backward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_buffer}}(self, name, tensor)
&
Adds a persistent buffer to the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_hook}}(self, hook)
&
Registers a forward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_pre\_hook}}(self, hook)
&
Registers a forward pre-hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_parameter}}(self, name, param)
&
Adds a parameter to the module.
\\
\hline
\sphinxcode{\sphinxupquote{state\_dict}}(self{[}, destination, prefix, …{]})
&
Returns a dictionary containing a whole state of the module.
\\
\hline
\sphinxcode{\sphinxupquote{to}}(self, \textbackslash{}*args, \textbackslash{}*\textbackslash{}*kwargs)
&
Moves and/or casts the parameters and buffers.
\\
\hline
\sphinxcode{\sphinxupquote{train}}(self{[}, mode{]})
&
Sets the module in training mode.
\\
\hline
\sphinxcode{\sphinxupquote{type}}(self, dst\_type)
&
Casts all parameters and buffers to \sphinxcode{\sphinxupquote{dst\_type}}.
\\
\hline
\sphinxcode{\sphinxupquote{zero\_grad}}(self)
&
Sets gradients of all model parameters to zero.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstylestrong{share\_memory}
&\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}
\index{forward() (pathflowai.losses.FocalLoss method)@\spxentry{forward()}\spxextra{pathflowai.losses.FocalLoss method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.FocalLoss.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{\emph{self}, \emph{logit}, \emph{target}}{}
Defines the computation performed at every call.
Should be overridden by all subclasses.
\begin{sphinxadmonition}{note}{Note:}
Although the recipe for forward pass needs to be defined within
this function, one should call the \sphinxcode{\sphinxupquote{Module}} instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.
\end{sphinxadmonition}
\end{fulllineitems}
\end{fulllineitems}
\index{GeneralizedDice (class in pathflowai.losses)@\spxentry{GeneralizedDice}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.GeneralizedDice}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{GeneralizedDice}}}{\emph{**kwargs}}{}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/losses.py}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, probs, target, \_)
&
Call self as a function.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\end{fulllineitems}
\index{GeneralizedDiceLoss (class in pathflowai.losses)@\spxentry{GeneralizedDiceLoss}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.GeneralizedDiceLoss}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{GeneralizedDiceLoss}}}{\emph{weight=None}, \emph{channelwise=False}, \emph{eps=1e-06}, \emph{add\_softmax=False}}{}
\sphinxurl{https://raw.githubusercontent.com/inferno-pytorch/inferno/0561e8a95cde6bfc5e10a3609841b7b0ca5b03ca/inferno/extensions/criteria/set\_similarity\_measures.py}
Computes the scalar Generalized Dice Loss defined in \sphinxurl{https://arxiv.org/abs/1707.03237}
This version works for multiple classes and expects predictions for every class (e.g. softmax output) and
one-hot targets for every class.
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, \textbackslash{}*input, \textbackslash{}*\textbackslash{}*kwargs)
&
Call self as a function.
\\
\hline
\sphinxcode{\sphinxupquote{add\_module}}(self, name, module)
&
Adds a child module to the current module.
\\
\hline
\sphinxcode{\sphinxupquote{apply}}(self, fn)
&
Applies \sphinxcode{\sphinxupquote{fn}} recursively to every submodule (as returned by \sphinxcode{\sphinxupquote{.children()}}) as well as self.
\\
\hline
\sphinxcode{\sphinxupquote{buffers}}(self{[}, recurse{]})
&
Returns an iterator over module buffers.
\\
\hline
\sphinxcode{\sphinxupquote{children}}(self)
&
Returns an iterator over immediate children modules.
\\
\hline
\sphinxcode{\sphinxupquote{cpu}}(self)
&
Moves all model parameters and buffers to the CPU.
\\
\hline
\sphinxcode{\sphinxupquote{cuda}}(self{[}, device{]})
&
Moves all model parameters and buffers to the GPU.
\\
\hline
\sphinxcode{\sphinxupquote{double}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{double}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{eval}}(self)
&
Sets the module in evaluation mode.
\\
\hline
\sphinxcode{\sphinxupquote{extra\_repr}}(self)
&
Set the extra representation of the module
\\
\hline
\sphinxcode{\sphinxupquote{float}}(self)
&
Casts all floating point parameters and buffers to float datatype.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.losses.GeneralizedDiceLoss.forward}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{forward}}}}}(self, input, target)
&
input: torch.FloatTensor or torch.cuda.FloatTensor target: torch.FloatTensor or torch.cuda.FloatTensor
\\
\hline
\sphinxcode{\sphinxupquote{half}}(self)
&
Casts all floating point parameters and buffers to \sphinxcode{\sphinxupquote{half}} datatype.
\\
\hline
\sphinxcode{\sphinxupquote{load\_state\_dict}}(self, state\_dict{[}, strict{]})
&
Copies parameters and buffers from \sphinxcode{\sphinxupquote{state\_dict}} into this module and its descendants.
\\
\hline
\sphinxcode{\sphinxupquote{modules}}(self)
&
Returns an iterator over all modules in the network.
\\
\hline
\sphinxcode{\sphinxupquote{named\_buffers}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module buffers, yielding both the name of the buffer as well as the buffer itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_children}}(self)
&
Returns an iterator over immediate children modules, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_modules}}(self{[}, memo, prefix{]})
&
Returns an iterator over all modules in the network, yielding both the name of the module as well as the module itself.
\\
\hline
\sphinxcode{\sphinxupquote{named\_parameters}}(self{[}, prefix, recurse{]})
&
Returns an iterator over module parameters, yielding both the name of the parameter as well as the parameter itself.
\\
\hline
\sphinxcode{\sphinxupquote{parameters}}(self{[}, recurse{]})
&
Returns an iterator over module parameters.
\\
\hline
\sphinxcode{\sphinxupquote{register\_backward\_hook}}(self, hook)
&
Registers a backward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_buffer}}(self, name, tensor)
&
Adds a persistent buffer to the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_hook}}(self, hook)
&
Registers a forward hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_forward\_pre\_hook}}(self, hook)
&
Registers a forward pre-hook on the module.
\\
\hline
\sphinxcode{\sphinxupquote{register\_parameter}}(self, name, param)
&
Adds a parameter to the module.
\\
\hline
\sphinxcode{\sphinxupquote{state\_dict}}(self{[}, destination, prefix, …{]})
&
Returns a dictionary containing a whole state of the module.
\\
\hline
\sphinxcode{\sphinxupquote{to}}(self, \textbackslash{}*args, \textbackslash{}*\textbackslash{}*kwargs)
&
Moves and/or casts the parameters and buffers.
\\
\hline
\sphinxcode{\sphinxupquote{train}}(self{[}, mode{]})
&
Sets the module in training mode.
\\
\hline
\sphinxcode{\sphinxupquote{type}}(self, dst\_type)
&
Casts all parameters and buffers to \sphinxcode{\sphinxupquote{dst\_type}}.
\\
\hline
\sphinxcode{\sphinxupquote{zero\_grad}}(self)
&
Sets gradients of all model parameters to zero.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstylestrong{share\_memory}
&\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}
\index{forward() (pathflowai.losses.GeneralizedDiceLoss method)@\spxentry{forward()}\spxextra{pathflowai.losses.GeneralizedDiceLoss method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.GeneralizedDiceLoss.forward}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{forward}}}{\emph{self}, \emph{input}, \emph{target}}{}
input: torch.FloatTensor or torch.cuda.FloatTensor
target: torch.FloatTensor or torch.cuda.FloatTensor
\begin{description}
\item[{Expected shape of the inputs:}] \leavevmode\begin{itemize}
\item {}
if not channelwise: (batch\_size, nb\_classes, …)
\item {}
if channelwise: (batch\_size, nb\_channels, nb\_classes, …)
\end{itemize}
\end{description}
\end{fulllineitems}
\end{fulllineitems}
\index{ShapeError@\spxentry{ShapeError}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.ShapeError}}\pysigline{\sphinxbfcode{\sphinxupquote{exception }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{ShapeError}}}~
\end{fulllineitems}
\index{SurfaceLoss (class in pathflowai.losses)@\spxentry{SurfaceLoss}\spxextra{class in pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.SurfaceLoss}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{SurfaceLoss}}}{\emph{**kwargs}}{}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/losses.py}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{\_\_call\_\_}}(self, probs, dist\_maps, \_)
&
Call self as a function.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\end{fulllineitems}
\index{assert\_() (in module pathflowai.losses)@\spxentry{assert\_()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.assert_}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{assert\_}}}{\emph{condition}, \emph{message=''}, \emph{exception\_type=\textless{}class 'AssertionError'\textgreater{}}}{}
\sphinxurl{https://raw.githubusercontent.com/inferno-pytorch/inferno/0561e8a95cde6bfc5e10a3609841b7b0ca5b03ca/inferno/utils/exceptions.py}
Like assert, but with arbitrary exception types.
\end{fulllineitems}
\index{class2one\_hot() (in module pathflowai.losses)@\spxentry{class2one\_hot()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.class2one_hot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{class2one\_hot}}}{\emph{seg:torch.Tensor}, \emph{C:int}}{{ $\rightarrow$ torch.Tensor}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{eq() (in module pathflowai.losses)@\spxentry{eq()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.eq}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{eq}}}{\emph{a:torch.Tensor}, \emph{b}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{flatten\_samples() (in module pathflowai.losses)@\spxentry{flatten\_samples()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.flatten_samples}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{flatten\_samples}}}{\emph{input\_}}{}
\sphinxurl{https://raw.githubusercontent.com/inferno-pytorch/inferno/0561e8a95cde6bfc5e10a3609841b7b0ca5b03ca/inferno/utils/torch\_utils.py}
Flattens a tensor or a variable such that the channel axis is first and the sample axis
is second. The shapes are transformed as follows:
\begin{quote}
(N, C, H, W) \textendash{}\textgreater{} (C, N * H * W)
(N, C, D, H, W) \textendash{}\textgreater{} (C, N * D * H * W)
(N, C) \textendash{}\textgreater{} (C, N)
\end{quote}
The input must be atleast 2d.
\end{fulllineitems}
\index{one\_hot() (in module pathflowai.losses)@\spxentry{one\_hot()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.one_hot}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{one\_hot}}}{\emph{t:torch.Tensor}, \emph{axis=1}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{one\_hot2dist() (in module pathflowai.losses)@\spxentry{one\_hot2dist()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.one_hot2dist}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{one\_hot2dist}}}{\emph{seg:numpy.ndarray}}{{ $\rightarrow$ numpy.ndarray}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{simplex() (in module pathflowai.losses)@\spxentry{simplex()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.simplex}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{simplex}}}{\emph{t:torch.Tensor}, \emph{axis=1}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{sset() (in module pathflowai.losses)@\spxentry{sset()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.sset}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{sset}}}{\emph{a:torch.Tensor}, \emph{sub:Iterable}}{{ $\rightarrow$ bool}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\index{uniq() (in module pathflowai.losses)@\spxentry{uniq()}\spxextra{in module pathflowai.losses}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.losses.uniq}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.losses.}}\sphinxbfcode{\sphinxupquote{uniq}}}{\emph{a:torch.Tensor}}{{ $\rightarrow$ Set}}
\sphinxurl{https://raw.githubusercontent.com/LIVIAETS/surface-loss/master/utils.py}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.sampler}}\index{pathflowai.sampler (module)@\spxentry{pathflowai.sampler}\spxextra{module}}
\chapter{sampler.py}
\label{\detokenize{index:sampler-py}}
Balanced sampling based on one of the columns of the patch information.
\index{ImbalancedDatasetSampler (class in pathflowai.sampler)@\spxentry{ImbalancedDatasetSampler}\spxextra{class in pathflowai.sampler}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.sampler.ImbalancedDatasetSampler}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.sampler.}}\sphinxbfcode{\sphinxupquote{ImbalancedDatasetSampler}}}{\emph{dataset}, \emph{indices=None}, \emph{num\_samples=None}}{}
Samples elements randomly from a given list of indices for imbalanced dataset
\sphinxurl{https://raw.githubusercontent.com/ufoym/imbalanced-dataset-sampler/master/sampler.py}
Arguments:
\begin{quote}
indices (list, optional): a list of indices
num\_samples (int, optional): number of samples to draw
\end{quote}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.schedulers}}\index{pathflowai.schedulers (module)@\spxentry{pathflowai.schedulers}\spxextra{module}}
\chapter{schedulers.py}
\label{\detokenize{index:schedulers-py}}
Modulates the learning rate during the training process.
\index{CosineAnnealingWithRestartsLR (class in pathflowai.schedulers)@\spxentry{CosineAnnealingWithRestartsLR}\spxextra{class in pathflowai.schedulers}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.CosineAnnealingWithRestartsLR}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.schedulers.}}\sphinxbfcode{\sphinxupquote{CosineAnnealingWithRestartsLR}}}{\emph{optimizer}, \emph{T\_max}, \emph{eta\_min=0}, \emph{last\_epoch=-1}, \emph{T\_mult=1.0}, \emph{alpha\_decay=1.0}}{}
Set the learning rate of each parameter group using a cosine annealing
schedule, where \(\eta_{max}\) is set to the initial lr and
\(T_{cur}\) is the number of epochs since the last restart in SGDR:
\begin{quote}
\begin{equation*}
\begin{split}\eta_t = \eta_{min} + \frac{1}{2}(\eta_{max} - \eta_{min})(1 +
\cos(\frac{T_{cur}}{T_{max}}\pi))\end{split}
\end{equation*}
When last\_epoch=-1, sets initial lr as lr.
It has been proposed in
\end{quote}
\sphinxhref{https://arxiv.org/abs/1608.03983}{SGDR: Stochastic Gradient Descent with Warm Restarts}. This implements
the cosine annealing part of SGDR, the restarts and number of iterations multiplier.
\begin{quote}
\begin{description}
\item[{Args:}] \leavevmode
optimizer (Optimizer): Wrapped optimizer.
T\_max (int): Maximum number of iterations.
T\_mult (float): Multiply T\_max by this number after each restart. Default: 1.
eta\_min (float): Minimum learning rate. Default: 0.
last\_epoch (int): The index of last epoch. Default: -1.
\end{description}
\end{quote}
\begin{quote}\begin{description}
\item[{Attributes}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{step\_n}}] \leavevmode
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
\sphinxcode{\sphinxupquote{load\_state\_dict}}(self, state\_dict)
&
Loads the schedulers state.
\\
\hline
\sphinxcode{\sphinxupquote{state\_dict}}(self)
&
Returns the state of the scheduler as a \sphinxcode{\sphinxupquote{dict}}.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\begin{savenotes}\sphinxattablestart
\centering
\begin{tabulary}{\linewidth}[t]{|T|T|}
\hline
\sphinxstylestrong{cosine}
&\\
\hline
\sphinxstylestrong{get\_lr}
&\\
\hline
\sphinxstylestrong{restart}
&\\
\hline
\sphinxstylestrong{step}
&\\
\hline
\end{tabulary}
\par
\sphinxattableend\end{savenotes}
\end{fulllineitems}
\index{Scheduler (class in pathflowai.schedulers)@\spxentry{Scheduler}\spxextra{class in pathflowai.schedulers}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.Scheduler}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.schedulers.}}\sphinxbfcode{\sphinxupquote{Scheduler}}}{\emph{optimizer=None}, \emph{opts=\{'T\_max': 10}, \emph{'T\_mult': 2}, \emph{'eta\_min': 5e-08}, \emph{'lr\_scheduler\_decay': 0.5}, \emph{'scheduler': 'null'\}}}{}
Scheduler class that modulates learning rate of torch optimizers over epochs.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{optimizer}}] \leavevmode{[}type{]}
torch.Optimizer object
\item[{\sphinxstylestrong{opts}}] \leavevmode{[}type{]}
Options of setting the learning rate scheduler, see default.
\end{description}
\item[{Attributes}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{schedulers}}] \leavevmode{[}type{]}
Different types of schedulers to choose from.
\item[{\sphinxstylestrong{scheduler\_step\_fn}}] \leavevmode{[}type{]}
How scheduler updates learning rate.
\item[{\sphinxstylestrong{initial\_lr}}] \leavevmode{[}type{]}
Initial set learning rate.
\item[{\sphinxstylestrong{scheduler\_choice}}] \leavevmode{[}type{]}
What scheduler type was chosen.
\item[{\sphinxstylestrong{scheduler}}] \leavevmode{[}type{]}
Scheduler object chosen that will more directly update optimizer LR.
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.schedulers.Scheduler.get_lr}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{get\_lr}}}}}(self)
&
Return current learning rate.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.schedulers.Scheduler.step}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{step}}}}}(self)
&
Update optimizer learning rate
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{get\_lr() (pathflowai.schedulers.Scheduler method)@\spxentry{get\_lr()}\spxextra{pathflowai.schedulers.Scheduler method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.Scheduler.get_lr}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{get\_lr}}}{\emph{self}}{}
Return current learning rate.
\begin{quote}\begin{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{float}] \leavevmode
Current learning rate.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{step() (pathflowai.schedulers.Scheduler method)@\spxentry{step()}\spxextra{pathflowai.schedulers.Scheduler method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.schedulers.Scheduler.step}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{step}}}{\emph{self}}{}
Update optimizer learning rate
\end{fulllineitems}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.visualize}}\index{pathflowai.visualize (module)@\spxentry{pathflowai.visualize}\spxextra{module}}
\chapter{visualize.py}
\label{\detokenize{index:visualize-py}}
Plots SHAP outputs, UMAP embeddings, and overlays predictions on top of WSI.
\index{PlotlyPlot (class in pathflowai.visualize)@\spxentry{PlotlyPlot}\spxextra{class in pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PlotlyPlot}}\pysigline{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{PlotlyPlot}}}
Creates plotly html plots.
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.visualize.PlotlyPlot.add_plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_plot}}}}}(self, t\_data\_df{[}, G, color\_col, …{]})
&
Adds plotting data to be plotted.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PlotlyPlot.plot}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{plot}}}}}(self, output\_fname{[}, axes\_off{]})
&
Plot embedding of patches to html file.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{add\_plot() (pathflowai.visualize.PlotlyPlot method)@\spxentry{add\_plot()}\spxextra{pathflowai.visualize.PlotlyPlot method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PlotlyPlot.add_plot}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_plot}}}{\emph{self, t\_data\_df, G=None, color\_col='color', name\_col='name', xyz\_cols={[}'x', 'y', 'z'{]}, size=2, opacity=1.0, custom\_colors={[}{]}}}{}
Adds plotting data to be plotted.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{t\_data\_df:dataframe}}] \leavevmode
3-D transformed dataframe.
\item[{\sphinxstylestrong{G:nx.Graph}}] \leavevmode
Networkx graph.
\item[{\sphinxstylestrong{color\_col:str}}] \leavevmode
Column to use to color points.
\item[{\sphinxstylestrong{name\_col:str}}] \leavevmode
Column to use to name points.
\item[{\sphinxstylestrong{xyz\_cols:list}}] \leavevmode
3 columns that denote x,y,z coords.
\item[{\sphinxstylestrong{size:int}}] \leavevmode
Marker size.
\item[{\sphinxstylestrong{opacity:float}}] \leavevmode
Marker opacity.
\item[{\sphinxstylestrong{custom\_colors:list}}] \leavevmode
Custom colors to supply.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot() (pathflowai.visualize.PlotlyPlot method)@\spxentry{plot()}\spxextra{pathflowai.visualize.PlotlyPlot method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PlotlyPlot.plot}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{plot}}}{\emph{self}, \emph{output\_fname}, \emph{axes\_off=False}}{}
Plot embedding of patches to html file.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{output\_fname:str}}] \leavevmode
Output html file.
\item[{\sphinxstylestrong{axes\_off:bool}}] \leavevmode
Remove axes.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\end{fulllineitems}
\index{PredictionPlotter (class in pathflowai.visualize)@\spxentry{PredictionPlotter}\spxextra{class in pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{class }}\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{PredictionPlotter}}}{\emph{dask\_arr\_dict}, \emph{patch\_info\_db}, \emph{compression\_factor=3}, \emph{alpha=0.5}, \emph{patch\_size=224}, \emph{no\_db=False}, \emph{plot\_annotation=False}, \emph{segmentation=False}, \emph{n\_segmentation\_classes=4}, \emph{input\_dir=''}, \emph{annotation\_col='annotation'}, \emph{scaling\_factor=1.0}}{}
Plots predictions over entire image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{dask\_arr\_dict:dict}}] \leavevmode
Stores all dask arrays corresponding to all of the images.
\item[{\sphinxstylestrong{patch\_info\_db:str}}] \leavevmode
Patch level information, eg. prediction.
\item[{\sphinxstylestrong{compression\_factor:float}}] \leavevmode
How much to compress image by.
\item[{\sphinxstylestrong{alpha:float}}] \leavevmode
Low value assigns higher weight to prediction over original image.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{no\_db:bool}}] \leavevmode
Don’t use patch information.
\item[{\sphinxstylestrong{plot\_annotation:bool}}] \leavevmode
Plot annotations from patch information.
\item[{\sphinxstylestrong{segmentation:bool}}] \leavevmode
Plot segmentation mask.
\item[{\sphinxstylestrong{n\_segmentation\_classes:int}}] \leavevmode
Number segmentation classes.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Input directory.
\item[{\sphinxstylestrong{annotation\_col:str}}] \leavevmode
Annotation column to plot.
\item[{\sphinxstylestrong{scaling\_factor:float}}] \leavevmode
Multiplies the prediction scores to make them appear darker on the images when predicting.
\end{description}
\end{description}\end{quote}
\subsubsection*{Methods}
\begin{savenotes}\sphinxatlongtablestart\begin{longtable}[c]{\X{1}{2}\X{1}{2}}
\hline
\endfirsthead
\multicolumn{2}{c}%
{\makebox[0pt]{\sphinxtablecontinued{\tablename\ \thetable{} -- continued from previous page}}}\\
\hline
\endhead
\hline
\multicolumn{2}{r}{\makebox[0pt][r]{\sphinxtablecontinued{Continued on next page}}}\\
\endfoot
\endlastfoot
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.add_custom_segmentation}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{add\_custom\_segmentation}}}}}(self, basename, npy)
&
Replace segmentation mask with new custom segmentation.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.generate_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{generate\_image}}}}}(self, ID)
&
Generate the image array for the whole slide image with predictions overlaid.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.output_image}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{output\_image}}}}}(self, img, filename{[}, tif{]})
&
Output calculated image to file.
\\
\hline
{\hyperref[\detokenize{index:pathflowai.visualize.PredictionPlotter.return_patch}]{\sphinxcrossref{\sphinxcode{\sphinxupquote{return\_patch}}}}}(self, ID, x, y, patch\_size)
&
Return one single patch instead of entire image.
\\
\hline
\end{longtable}\sphinxatlongtableend\end{savenotes}
\index{add\_custom\_segmentation() (pathflowai.visualize.PredictionPlotter method)@\spxentry{add\_custom\_segmentation()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.add_custom_segmentation}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{add\_custom\_segmentation}}}{\emph{self}, \emph{basename}, \emph{npy}}{}
Replace segmentation mask with new custom segmentation.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Patient ID
\item[{\sphinxstylestrong{npy:str}}] \leavevmode
Numpy mask.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{generate\_image() (pathflowai.visualize.PredictionPlotter method)@\spxentry{generate\_image()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.generate_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{generate\_image}}}{\emph{self}, \emph{ID}}{}
Generate the image array for the whole slide image with predictions overlaid.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
patient ID.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Resulting overlaid whole slide image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{output\_image() (pathflowai.visualize.PredictionPlotter method)@\spxentry{output\_image()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.output_image}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{output\_image}}}{\emph{self}, \emph{img}, \emph{filename}, \emph{tif=False}}{}
Output calculated image to file.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{img:array}}] \leavevmode
Image.
\item[{\sphinxstylestrong{filename:str}}] \leavevmode
Output file name.
\item[{\sphinxstylestrong{tif:bool}}] \leavevmode
Store in TIF format?
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{return\_patch() (pathflowai.visualize.PredictionPlotter method)@\spxentry{return\_patch()}\spxextra{pathflowai.visualize.PredictionPlotter method}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.PredictionPlotter.return_patch}}\pysiglinewithargsret{\sphinxbfcode{\sphinxupquote{return\_patch}}}{\emph{self}, \emph{ID}, \emph{x}, \emph{y}, \emph{patch\_size}}{}
Return one single patch instead of entire image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
Patient ID
\item[{\sphinxstylestrong{x:int}}] \leavevmode
X coordinate.
\item[{\sphinxstylestrong{y:int}}] \leavevmode
Y coordinate.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\end{fulllineitems}
\index{annotation2rgb() (in module pathflowai.visualize)@\spxentry{annotation2rgb()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.annotation2rgb}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{annotation2rgb}}}{\emph{i}, \emph{palette}, \emph{arr}}{}
Go from annotation of patch to color.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{i:int}}] \leavevmode
Annotation index.
\item[{\sphinxstylestrong{palette:palette}}] \leavevmode
Index to color mapping.
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Image array.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Resulting image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{blend() (in module pathflowai.visualize)@\spxentry{blend()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.blend}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{blend}}}{\emph{arr1}, \emph{arr2}, \emph{alpha=0.5}}{}
Blend 2 arrays together, mixing with alpha.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr1:array}}] \leavevmode
Image 1.
\item[{\sphinxstylestrong{arr2:array}}] \leavevmode
Image 2.
\item[{\sphinxstylestrong{alpha:float}}] \leavevmode
Higher alpha makes image more like image 1.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Resulting image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot\_image\_() (in module pathflowai.visualize)@\spxentry{plot\_image\_()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.plot_image_}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{plot\_image\_}}}{\emph{image\_file}, \emph{compression\_factor=2.0}, \emph{test\_image\_name='test.png'}}{}
Plots entire SVS/other image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{image\_file:str}}] \leavevmode
Image file.
\item[{\sphinxstylestrong{compression\_factor:float}}] \leavevmode
Amount to shrink each dimension of image.
\item[{\sphinxstylestrong{test\_image\_name:str}}] \leavevmode
Output image file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot\_shap() (in module pathflowai.visualize)@\spxentry{plot\_shap()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.plot_shap}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{plot\_shap}}}{\emph{model}, \emph{dataset\_opts}, \emph{transform\_opts}, \emph{batch\_size}, \emph{outputfilename}, \emph{n\_outputs=1}, \emph{method='deep'}, \emph{local\_smoothing=0.0}, \emph{n\_samples=20}, \emph{pred\_out=False}}{}
Plot shapley attributions overlaid on images for classification tasks.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{model:nn.Module}}] \leavevmode
Pytorch model.
\item[{\sphinxstylestrong{dataset\_opts:dict}}] \leavevmode
Options used to configure dataset
\item[{\sphinxstylestrong{transform\_opts:dict}}] \leavevmode
Options used to configure transformers.
\item[{\sphinxstylestrong{batch\_size:int}}] \leavevmode
Batch size for training.
\item[{\sphinxstylestrong{outputfilename:str}}] \leavevmode
Output filename.
\item[{\sphinxstylestrong{n\_outputs:int}}] \leavevmode
Number of top outputs.
\item[{\sphinxstylestrong{method:str}}] \leavevmode
Gradient or deep explainer.
\item[{\sphinxstylestrong{local\_smoothing:float}}] \leavevmode
How much to smooth shapley map.
\item[{\sphinxstylestrong{n\_samples:int}}] \leavevmode
Number shapley samples to draw.
\item[{\sphinxstylestrong{pred\_out:bool}}] \leavevmode
Label images with binary prediction score?
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{plot\_umap\_images() (in module pathflowai.visualize)@\spxentry{plot\_umap\_images()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.plot_umap_images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{plot\_umap\_images}}}{\emph{dask\_arr\_dict}, \emph{embeddings\_file}, \emph{ID=None}, \emph{cval=1.0}, \emph{image\_res=300.0}, \emph{outputfname='output\_embedding.png'}, \emph{mpl\_scatter=True}, \emph{remove\_background\_annotation=''}, \emph{max\_background\_area=0.01}, \emph{zoom=0.05}, \emph{n\_neighbors=10}, \emph{sort\_col=''}, \emph{sort\_mode='asc'}}{}
Make UMAP embedding plot, overlaid with images.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{dask\_arr\_dict:dict}}] \leavevmode
Stored dask arrays for each WSI.
\item[{\sphinxstylestrong{embeddings\_file:str}}] \leavevmode
Embeddings pickle file stored from running using after trainign the model.
\item[{\sphinxstylestrong{ID:str}}] \leavevmode
Patient ID.
\item[{\sphinxstylestrong{cval:float}}] \leavevmode
Deprecated
\item[{\sphinxstylestrong{image\_res:float}}] \leavevmode
Image resolution.
\item[{\sphinxstylestrong{outputfname:str}}] \leavevmode
Output image file.
\item[{\sphinxstylestrong{mpl\_scatter:bool}}] \leavevmode
Recommended: Use matplotlib for scatter plot.
\item[{\sphinxstylestrong{remove\_background\_annotation:str}}] \leavevmode
Remove the background annotations. Enter for annotation to remove.
\item[{\sphinxstylestrong{max\_background\_area:float}}] \leavevmode
Maximum backgrund area in each tile for inclusion.
\item[{\sphinxstylestrong{zoom:float}}] \leavevmode
How much to zoom in on each patch, less than 1 is zoom out.
\item[{\sphinxstylestrong{n\_neighbors:int}}] \leavevmode
Number of neighbors for UMAP embedding.
\item[{\sphinxstylestrong{sort\_col:str}}] \leavevmode
Patch info column to sort on.
\item[{\sphinxstylestrong{sort\_mode:str}}] \leavevmode
Sort ascending or descending.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{type}] \leavevmode
Description of returned object.
\item[{Inspired by: \sphinxurl{https://gist.github.com/lukemetz/be6123c7ee3b366e333a}}] \leavevmode
\item[{WIP!! Needs testing.}] \leavevmode
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{prob2rbg() (in module pathflowai.visualize)@\spxentry{prob2rbg()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.prob2rbg}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{prob2rbg}}}{\emph{prob}, \emph{palette}, \emph{arr}}{}
Convert probability score to rgb image.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{prob:float}}] \leavevmode
Between 0 and 1 score.
\item[{\sphinxstylestrong{palette:palette}}] \leavevmode
Pallet converts between prob and color.
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Original array.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
New image colored by prediction score.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{seg2rgb() (in module pathflowai.visualize)@\spxentry{seg2rgb()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.seg2rgb}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{seg2rgb}}}{\emph{seg}, \emph{palette}, \emph{n\_segmentation\_classes}}{}
Color each pixel by segmentation class.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{seg:array}}] \leavevmode
Segmentation mask.
\item[{\sphinxstylestrong{palette:palette}}] \leavevmode
Color to RGB map.
\item[{\sphinxstylestrong{n\_segmentation\_classes:int}}] \leavevmode
Total number segmentation classes.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Returned segmentation image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{to\_pil() (in module pathflowai.visualize)@\spxentry{to\_pil()}\spxextra{in module pathflowai.visualize}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.visualize.to_pil}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.visualize.}}\sphinxbfcode{\sphinxupquote{to\_pil}}}{\emph{arr}}{}
Numpy array to pil.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Numpy array.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{Image}] \leavevmode
PIL Image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\phantomsection\label{\detokenize{index:module-pathflowai.utils}}\index{pathflowai.utils (module)@\spxentry{pathflowai.utils}\spxextra{module}}
\chapter{utils.py}
\label{\detokenize{index:utils-py}}
General utilities that still need to be broken up into preprocessing, machine learning input preparation, and output submodules.
\index{add\_purple\_mask() (in module pathflowai.utils)@\spxentry{add\_purple\_mask()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.add_purple_mask}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{add\_purple\_mask}}}{\emph{arr}}{}
Optional add intensity mask to the dask array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:dask.array}}] \leavevmode
Image data.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Image data with intensity added as forth channel.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{adjust\_mask() (in module pathflowai.utils)@\spxentry{adjust\_mask()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.adjust_mask}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{adjust\_mask}}}{\emph{mask\_file}, \emph{dask\_img\_array\_file}, \emph{out\_npy}, \emph{n\_neighbors}}{}
Fixes segmentation masks to reduce coarse annotations over empty regions.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{mask\_file:str}}] \leavevmode
NPY segmentation mask.
\item[{\sphinxstylestrong{dask\_img\_array\_file:str}}] \leavevmode
Dask image file.
\item[{\sphinxstylestrong{out\_npy:str}}] \leavevmode
Output numpy file.
\item[{\sphinxstylestrong{n\_neighbors:int}}] \leavevmode
Number nearest neighbors for dilation and erosion of mask from background to not background.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{str}] \leavevmode
Output numpy file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{boxes2interior() (in module pathflowai.utils)@\spxentry{boxes2interior()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.boxes2interior}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{boxes2interior}}}{\emph{img\_size}, \emph{polygons}}{}
Deprecated.
\end{fulllineitems}
\index{create\_purple\_mask() (in module pathflowai.utils)@\spxentry{create\_purple\_mask()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.create_purple_mask}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{create\_purple\_mask}}}{\emph{arr}, \emph{img\_size=None}, \emph{sparse=True}}{}
Create a gray scale intensity mask. This will be changed soon to support other thresholding QC methods.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:dask.array}}] \leavevmode
Dask array containing image information.
\item[{\sphinxstylestrong{img\_size:int}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{sparse:bool}}] \leavevmode
Deprecated
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Intensity, grayscale array over image.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{create\_sparse\_annotation\_arrays() (in module pathflowai.utils)@\spxentry{create\_sparse\_annotation\_arrays()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.create_sparse_annotation_arrays}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{create\_sparse\_annotation\_arrays}}}{\emph{xml\_file}, \emph{img\_size}, \emph{annotations={[}{]}}}{}
Convert annotation xml to shapely objects and store in dictionary.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
XML file containing annotations.
\item[{\sphinxstylestrong{img\_size:int}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
Annotations to look for in xml export.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Dictionary with annotation-shapely object pairs.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{create\_train\_val\_test() (in module pathflowai.utils)@\spxentry{create\_train\_val\_test()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.create_train_val_test}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{create\_train\_val\_test}}}{\emph{train\_val\_test\_pkl}, \emph{input\_info\_db}, \emph{patch\_size}}{}
Create dataframe that splits slides into training validation and test.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{train\_val\_test\_pkl:str}}] \leavevmode
Pickle for training validation and test slides.
\item[{\sphinxstylestrong{input\_info\_db:str}}] \leavevmode
Patch information SQL database.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size looking to access.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Train test validation splits.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{df2sql() (in module pathflowai.utils)@\spxentry{df2sql()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.df2sql}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{df2sql}}}{\emph{df}, \emph{sql\_file}, \emph{patch\_size}, \emph{mode='replace'}}{}
Write dataframe containing patch level information to SQL db.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{df:dataframe}}] \leavevmode
Dataframe containing patch information.
\item[{\sphinxstylestrong{sql\_file:str}}] \leavevmode
SQL database.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Size of patches.
\item[{\sphinxstylestrong{mode:str}}] \leavevmode
Replace or append.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{dir2images() (in module pathflowai.utils)@\spxentry{dir2images()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.dir2images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{dir2images}}}{\emph{image\_dir}}{}
Deprecated
\end{fulllineitems}
\index{extract\_patch\_information() (in module pathflowai.utils)@\spxentry{extract\_patch\_information()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.extract_patch_information}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{extract\_patch\_information}}}{\emph{basename}, \emph{input\_dir='./'}, \emph{annotations={[}{]}}, \emph{threshold=0.5}, \emph{patch\_size=224}, \emph{generate\_finetune\_segmentation=False}, \emph{target\_class=0}, \emph{intensity\_threshold=100.0}, \emph{target\_threshold=0.0}, \emph{adj\_mask=''}, \emph{basic\_preprocess=False}, \emph{tries=0}}{}
Final step of preprocessing pipeline. Break up image into patches, include if not background and of a certain intensity, find area of each annotation type in patch, spatial information, image ID and dump data to SQL table.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Patient ID.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Input directory.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations to record, these can be different tissue types, must correspond with XML labels.
\item[{\sphinxstylestrong{threshold:float}}] \leavevmode
Value between 0 and 1 that indicates the minimum amount of patch that musn’t be background for inclusion.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size of patches; this will become one of the tables.
\item[{\sphinxstylestrong{generate\_finetune\_segmentation:bool}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{target\_class:int}}] \leavevmode
Number of segmentation classes desired, from 0th class to target\_class-1 will be annotated in SQL.
\item[{\sphinxstylestrong{intensity\_threshold:float}}] \leavevmode
Value between 0 and 255 that represents minimum intensity to not include as background. Will be modified with new transforms.
\item[{\sphinxstylestrong{target\_threshold:float}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{adj\_mask:str}}] \leavevmode
Adjusted mask if performed binary opening operations in previous preprocessing step.
\item[{\sphinxstylestrong{basic\_preprocess:bool}}] \leavevmode
Do not store patch level information.
\item[{\sphinxstylestrong{tries:int}}] \leavevmode
Number of tries in case there is a Dask timeout, run again.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Patch information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{fix\_name() (in module pathflowai.utils)@\spxentry{fix\_name()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.fix_name}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{fix\_name}}}{\emph{basename}}{}
Fixes illegitimate basename, deprecated.
\end{fulllineitems}
\index{fix\_names() (in module pathflowai.utils)@\spxentry{fix\_names()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.fix_names}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{fix\_names}}}{\emph{file\_dir}}{}
Fixes basenames, deprecated.
\end{fulllineitems}
\index{generate\_patch\_pipeline() (in module pathflowai.utils)@\spxentry{generate\_patch\_pipeline()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.generate_patch_pipeline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{generate\_patch\_pipeline}}}{\emph{basename}, \emph{input\_dir='./'}, \emph{annotations={[}{]}}, \emph{threshold=0.5}, \emph{patch\_size=224}, \emph{out\_db='patch\_info.db'}, \emph{generate\_finetune\_segmentation=False}, \emph{target\_class=0}, \emph{intensity\_threshold=100.0}, \emph{target\_threshold=0.0}, \emph{adj\_mask=''}, \emph{basic\_preprocess=False}}{}
Short summary.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Patient ID.
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Input directory.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations to record, these can be different tissue types, must correspond with XML labels.
\item[{\sphinxstylestrong{threshold:float}}] \leavevmode
Value between 0 and 1 that indicates the minimum amount of patch that musn’t be background for inclusion.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size of patches; this will become one of the tables.
\item[{\sphinxstylestrong{out\_db:str}}] \leavevmode
Output SQL database.
\item[{\sphinxstylestrong{generate\_finetune\_segmentation:bool}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{target\_class:int}}] \leavevmode
Number of segmentation classes desired, from 0th class to target\_class-1 will be annotated in SQL.
\item[{\sphinxstylestrong{intensity\_threshold:float}}] \leavevmode
Value between 0 and 255 that represents minimum intensity to not include as background. Will be modified with new transforms.
\item[{\sphinxstylestrong{target\_threshold:float}}] \leavevmode
Deprecated.
\item[{\sphinxstylestrong{adj\_mask:str}}] \leavevmode
Adjusted mask if performed binary opening operations in previous preprocessing step.
\item[{\sphinxstylestrong{basic\_preprocess:bool}}] \leavevmode
Do not store patch level information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{grab\_interior\_points() (in module pathflowai.utils)@\spxentry{grab\_interior\_points()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.grab_interior_points}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{grab\_interior\_points}}}{\emph{xml\_file}, \emph{img\_size}, \emph{annotations={[}{]}}}{}
Deprecated.
\end{fulllineitems}
\index{image2coords() (in module pathflowai.utils)@\spxentry{image2coords()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.image2coords}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{image2coords}}}{\emph{image\_file}, \emph{output\_point=False}}{}
Deprecated.
\end{fulllineitems}
\index{images2coord\_dict() (in module pathflowai.utils)@\spxentry{images2coord\_dict()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.images2coord_dict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{images2coord\_dict}}}{\emph{images}, \emph{output\_point=False}}{}
Deprecated
\end{fulllineitems}
\index{img2npy\_() (in module pathflowai.utils)@\spxentry{img2npy\_()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.img2npy_}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{img2npy\_}}}{\emph{input\_dir}, \emph{basename}, \emph{svs\_file}}{}
Convert SVS, TIF, TIFF to NPY.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{input\_dir:str}}] \leavevmode
Output file dir.
\item[{\sphinxstylestrong{basename:str}}] \leavevmode
Basename of output file
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
SVS, TIF, TIFF file input.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{str}] \leavevmode
NPY output file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{is\_coords\_in\_box() (in module pathflowai.utils)@\spxentry{is\_coords\_in\_box()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.is_coords_in_box}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{is\_coords\_in\_box}}}{\emph{coords}, \emph{patch\_size}, \emph{boxes}}{}
Get area of annotation in patch.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{coords:array}}] \leavevmode
X,Y coordinates of patch.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{boxes:list}}] \leavevmode
Shapely objects for annotations.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{float}] \leavevmode
Area of annotation type.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{is\_image\_in\_boxes() (in module pathflowai.utils)@\spxentry{is\_image\_in\_boxes()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.is_image_in_boxes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{is\_image\_in\_boxes}}}{\emph{image\_coord\_dict}, \emph{boxes}}{}
Find if image intersects with annotations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{image\_coord\_dict:dict}}] \leavevmode
Dictionary of patches.
\item[{\sphinxstylestrong{boxes:list}}] \leavevmode
Shapely annotation shapes.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dict}] \leavevmode
Dictionary of whether image intersects with any of the annotations.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{is\_valid\_patch() (in module pathflowai.utils)@\spxentry{is\_valid\_patch()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.is_valid_patch}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{is\_valid\_patch}}}{\emph{xs}, \emph{ys}, \emph{patch\_size}, \emph{purple\_mask}, \emph{intensity\_threshold}, \emph{threshold=0.5}}{}
Deprecated, computes whether patch is valid.
\end{fulllineitems}
\index{load\_dataset() (in module pathflowai.utils)@\spxentry{load\_dataset()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_dataset}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_dataset}}}{\emph{in\_zarr}, \emph{in\_pkl}}{}
Load ZARR image and annotations pickle.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{in\_zarr:str}}] \leavevmode
Input image.
\item[{\sphinxstylestrong{in\_pkl:str}}] \leavevmode
Input annotations.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Image array.
\item[{dict}] \leavevmode
Annotations dictionary.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{load\_image() (in module pathflowai.utils)@\spxentry{load\_image()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_image}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_image}}}{\emph{svs\_file}}{}
Load SVS, TIF, TIFF
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:type}}] \leavevmode
Description of parameter \sphinxtitleref{svs\_file}.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{type}] \leavevmode
Description of returned object.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{load\_process\_image() (in module pathflowai.utils)@\spxentry{load\_process\_image()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_process_image}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_process\_image}}}{\emph{svs\_file}, \emph{xml\_file=None}, \emph{npy\_mask=None}, \emph{annotations={[}{]}}}{}
Load SVS-like image (including NPY), segmentation/classification annotations, generate dask array and dictionary of annotations.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Image file
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Annotation file.
\item[{\sphinxstylestrong{npy\_mask:array}}] \leavevmode
Numpy segmentation mask.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations in xml.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{array}] \leavevmode
Dask array of image.
\item[{dict}] \leavevmode
Annotation masks.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{load\_sql\_df() (in module pathflowai.utils)@\spxentry{load\_sql\_df()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.load_sql_df}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{load\_sql\_df}}}{\emph{sql\_file}, \emph{patch\_size}}{}
Load pandas dataframe from SQL, accessing particular patch size within SQL.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{sql\_file:str}}] \leavevmode
SQL db.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Patch level information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\begin{fulllineitems}
\pysigline{\sphinxbfcode{\sphinxupquote{modify\_patch\_info(input\_info\_db='patch\_info.db',~slide\_labels=Empty~DataFrame}}}\pysigline{\sphinxbfcode{\sphinxupquote{Columns:~{[}{]}}}}\pysigline{\sphinxbfcode{\sphinxupquote{Index:~{[}{]},~pos\_annotation\_class='{'},~patch\_size=224,~segmentation=False,~other\_annotations={[}{]},~target\_segmentation\_class=-1,~target\_threshold=0.0,~classify\_annotations=False)}}}
Modify the patch information to get ready for deep learning, incorporate whole slide labels if needed.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{input\_info\_db:str}}] \leavevmode
SQL DB file.
\item[{\sphinxstylestrong{slide\_labels:dataframe}}] \leavevmode
Dataframe with whole slide labels.
\item[{\sphinxstylestrong{pos\_annotation\_class:str}}] \leavevmode
Tissue/annotation label to label with whole slide image label, if not supplied, any slide’s patches receive the whole slide label.
\item[{\sphinxstylestrong{patch\_size:int}}] \leavevmode
Patch size.
\item[{\sphinxstylestrong{segmentation:bool}}] \leavevmode
Segmentation?
\item[{\sphinxstylestrong{other\_annotations:list}}] \leavevmode
Other annotations to access from patch information.
\item[{\sphinxstylestrong{target\_segmentation\_class:int}}] \leavevmode
Segmentation class to threshold.
\item[{\sphinxstylestrong{target\_threshold:float}}] \leavevmode
Include patch if patch has target area greater than this.
\item[{\sphinxstylestrong{classify\_annotations:bool}}] \leavevmode
Classifying annotations for pretraining, or final model?
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dataframe}] \leavevmode
Modified patch information.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{npy2da() (in module pathflowai.utils)@\spxentry{npy2da()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.npy2da}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{npy2da}}}{\emph{npy\_file}}{}
Numpy to dask array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{npy\_file:str}}] \leavevmode
Input npy file.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Converted numpy array to dask.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{parse\_coord\_return\_boxes() (in module pathflowai.utils)@\spxentry{parse\_coord\_return\_boxes()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.parse_coord_return_boxes}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{parse\_coord\_return\_boxes}}}{\emph{xml\_file}, \emph{annotation\_name=''}, \emph{return\_coords=False}}{}
Get list of shapely objects for each annotation in the XML object.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Annotation file.
\item[{\sphinxstylestrong{annotation\_name:str}}] \leavevmode
Name of xml annotation.
\item[{\sphinxstylestrong{return\_coords:bool}}] \leavevmode
Just return list of coords over shapes.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{list}] \leavevmode
List of shapely objects.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{process\_svs() (in module pathflowai.utils)@\spxentry{process\_svs()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.process_svs}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{process\_svs}}}{\emph{svs\_file}, \emph{xml\_file}, \emph{annotations={[}{]}}, \emph{output\_dir='./'}}{}
Store images into npy format and store annotations into pickle dictionary.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Image file.
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Annotations file.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations in image.
\item[{\sphinxstylestrong{output\_dir:str}}] \leavevmode
Output directory.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{retain\_images() (in module pathflowai.utils)@\spxentry{retain\_images()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.retain_images}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{retain\_images}}}{\emph{image\_dir}, \emph{xml\_file}, \emph{annotation=''}}{}
Deprecated
\end{fulllineitems}
\index{return\_image\_coord() (in module pathflowai.utils)@\spxentry{return\_image\_coord()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.return_image_coord}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{return\_image\_coord}}}{\emph{nx=0}, \emph{ny=0}, \emph{xl=3333}, \emph{yl=3333}, \emph{xi=0}, \emph{yi=0}, \emph{xc=3}, \emph{yc=3}, \emph{dimx=224}, \emph{dimy=224}, \emph{output\_point=False}}{}
Deprecated
\end{fulllineitems}
\index{return\_image\_in\_boxes\_dict() (in module pathflowai.utils)@\spxentry{return\_image\_in\_boxes\_dict()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.return_image_in_boxes_dict}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{return\_image\_in\_boxes\_dict}}}{\emph{image\_dir}, \emph{xml\_file}, \emph{annotation=''}}{}
Deprecated
\end{fulllineitems}
\index{run\_preprocessing\_pipeline() (in module pathflowai.utils)@\spxentry{run\_preprocessing\_pipeline()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.run_preprocessing_pipeline}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{run\_preprocessing\_pipeline}}}{\emph{svs\_file}, \emph{xml\_file=None}, \emph{npy\_mask=None}, \emph{annotations={[}{]}}, \emph{out\_zarr='output\_zarr.zarr'}, \emph{out\_pkl='output.pkl'}}{}
Run preprocessing pipeline. Store image into zarr format, segmentations maintain as npy, and xml annotations as pickle.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Input image file.
\item[{\sphinxstylestrong{xml\_file:str}}] \leavevmode
Input annotation file.
\item[{\sphinxstylestrong{npy\_mask:str}}] \leavevmode
NPY segmentation mask.
\item[{\sphinxstylestrong{annotations:list}}] \leavevmode
List of annotations.
\item[{\sphinxstylestrong{out\_zarr:str}}] \leavevmode
Output zarr for image.
\item[{\sphinxstylestrong{out\_pkl:str}}] \leavevmode
Output pickle for annotations.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{save\_all\_patch\_info() (in module pathflowai.utils)@\spxentry{save\_all\_patch\_info()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.save_all_patch_info}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{save\_all\_patch\_info}}}{\emph{basenames}, \emph{input\_dir='./'}, \emph{annotations={[}{]}}, \emph{threshold=0.5}, \emph{patch\_size=224}, \emph{output\_pkl='patch\_info.pkl'}}{}
Deprecated.
\end{fulllineitems}
\index{save\_dataset() (in module pathflowai.utils)@\spxentry{save\_dataset()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.save_dataset}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{save\_dataset}}}{\emph{arr}, \emph{masks}, \emph{out\_zarr}, \emph{out\_pkl}}{}
Saves dask array image, dictionary of annotations to zarr and pickle respectively.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{arr:array}}] \leavevmode
Image.
\item[{\sphinxstylestrong{masks:dict}}] \leavevmode
Dictionary of annotation shapes.
\item[{\sphinxstylestrong{out\_zarr:str}}] \leavevmode
Zarr output file for image.
\item[{\sphinxstylestrong{out\_pkl:str}}] \leavevmode
Pickle output file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{segmentation\_predictions2npy() (in module pathflowai.utils)@\spxentry{segmentation\_predictions2npy()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.segmentation_predictions2npy}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{segmentation\_predictions2npy}}}{\emph{y\_pred}, \emph{patch\_info}, \emph{segmentation\_map}, \emph{npy\_output}}{}
Convert segmentation predictions from model to numpy masks.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{y\_pred:list}}] \leavevmode
List of patch segmentation masks
\item[{\sphinxstylestrong{patch\_info:dataframe}}] \leavevmode
Patch information from DB.
\item[{\sphinxstylestrong{segmentation\_map:array}}] \leavevmode
Existing segmentation mask.
\item[{\sphinxstylestrong{npy\_output:str}}] \leavevmode
Output npy file.
\end{description}
\end{description}\end{quote}
\end{fulllineitems}
\index{svs2dask\_array() (in module pathflowai.utils)@\spxentry{svs2dask\_array()}\spxextra{in module pathflowai.utils}}
\begin{fulllineitems}
\phantomsection\label{\detokenize{index:pathflowai.utils.svs2dask_array}}\pysiglinewithargsret{\sphinxcode{\sphinxupquote{pathflowai.utils.}}\sphinxbfcode{\sphinxupquote{svs2dask\_array}}}{\emph{svs\_file}, \emph{tile\_size=1000}, \emph{overlap=0}, \emph{remove\_last=True}, \emph{allow\_unknown\_chunksizes=False}}{}
Convert SVS, TIF or TIFF to dask array.
\begin{quote}\begin{description}
\item[{Parameters}] \leavevmode\begin{description}
\item[{\sphinxstylestrong{svs\_file:str}}] \leavevmode
Image file.
\item[{\sphinxstylestrong{tile\_size:int}}] \leavevmode
Size of chunk to be read in.
\item[{\sphinxstylestrong{overlap:int}}] \leavevmode
Do not modify, overlap between neighboring tiles.
\item[{\sphinxstylestrong{remove\_last:bool}}] \leavevmode
Remove last tile because it has a custom size.
\item[{\sphinxstylestrong{allow\_unknown\_chunksizes: bool}}] \leavevmode
Allow different chunk sizes, more flexible, but slowdown.
\end{description}
\item[{Returns}] \leavevmode\begin{description}
\item[{dask.array}] \leavevmode
Dask Array.
\end{description}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr}\PYG{o}{=}\PYG{n}{svs2dask\PYGZus{}array}\PYG{p}{(}\PYG{n}{svs\PYGZus{}file}\PYG{p}{,} \PYG{n}{tile\PYGZus{}size}\PYG{o}{=}\PYG{l+m+mi}{1000}\PYG{p}{,} \PYG{n}{overlap}\PYG{o}{=}\PYG{l+m+mi}{0}\PYG{p}{,} \PYG{n}{remove\PYGZus{}last}\PYG{o}{=}\PYG{k+kc}{True}\PYG{p}{,} \PYG{n}{allow\PYGZus{}unknown\PYGZus{}chunksizes}\PYG{o}{=}\PYG{k+kc}{False}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr2}\PYG{o}{=}\PYG{n}{arr}\PYG{o}{.}\PYG{n}{compute}\PYG{p}{(}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr3}\PYG{o}{=}\PYG{n}{to\PYGZus{}pil}\PYG{p}{(}\PYG{n}{cv2}\PYG{o}{.}\PYG{n}{resize}\PYG{p}{(}\PYG{n}{arr2}\PYG{p}{,} \PYG{n}{dsize}\PYG{o}{=}\PYG{p}{(}\PYG{l+m+mi}{1440}\PYG{p}{,}\PYG{l+m+mi}{700}\PYG{p}{)}\PYG{p}{,} \PYG{n}{interpolation}\PYG{o}{=}\PYG{n}{cv2}\PYG{o}{.}\PYG{n}{INTER\PYGZus{}CUBIC}\PYG{p}{)}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\begin{sphinxVerbatim}[commandchars=\\\{\}]
\PYG{g+gp}{\PYGZgt{}\PYGZgt{}\PYGZgt{} }\PYG{n}{arr3}\PYG{o}{.}\PYG{n}{save}\PYG{p}{(}\PYG{n}{test\PYGZus{}image\PYGZus{}name}\PYG{p}{)}
\PYG{g+go}{ ..}
\end{sphinxVerbatim}
\end{description}\end{quote}
\end{fulllineitems}
\chapter{Indices and tables}
\label{\detokenize{index:indices-and-tables}}\begin{itemize}
\item {}
\DUrole{xref,std,std-ref}{genindex}
\item {}
\DUrole{xref,std,std-ref}{modindex}
\item {}
\DUrole{xref,std,std-ref}{search}
\end{itemize}
\renewcommand{\indexname}{Python Module Index}
\begin{sphinxtheindex}
\let\bigletter\sphinxstyleindexlettergroup
\bigletter{p}
\item\relax\sphinxstyleindexentry{pathflowai.datasets}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.datasets}}
\item\relax\sphinxstyleindexentry{pathflowai.losses}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.losses}}
\item\relax\sphinxstyleindexentry{pathflowai.sampler}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.sampler}}
\item\relax\sphinxstyleindexentry{pathflowai.schedulers}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.schedulers}}
\item\relax\sphinxstyleindexentry{pathflowai.utils}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.utils}}
\item\relax\sphinxstyleindexentry{pathflowai.visualize}\sphinxstyleindexpageref{index:\detokenize{module-pathflowai.visualize}}
\end{sphinxtheindex}
\renewcommand{\indexname}{Index}
\printindex
\end{document}