deepliif 1.1.12__py3-none-any.whl → 1.1.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,7 +33,6 @@ Image.MAX_IMAGE_PIXELS = None
33
33
 
34
34
  import numpy as np
35
35
  from dask import delayed, compute
36
- import openslide
37
36
 
38
37
  from deepliif.util import *
39
38
  from deepliif.util.util import tensor_to_pil
@@ -592,10 +591,13 @@ def infer_results_for_wsi(input_dir, filename, output_dir, model_dir, tile_size,
592
591
 
593
592
  def get_wsi_resolution(filename):
594
593
  """
595
- Use OpenSlide to get the resolution (magnification) of the slide
596
- and the corresponding tile size to use by default for DeepLIIF.
594
+ Try to get the resolution (magnification) of the slide and
595
+ the corresponding tile size to use by default for DeepLIIF.
597
596
  If it cannot be found, return (None, None) instead.
598
597
 
598
+ Note: This will start the javabridge VM, but not kill it.
599
+ It must be killed elsewhere.
600
+
599
601
  Parameters
600
602
  ----------
601
603
  filename : str
@@ -604,13 +606,42 @@ def get_wsi_resolution(filename):
604
606
  Returns
605
607
  -------
606
608
  str :
607
- Magnification (objective power) as found by OpenSlide.
609
+ Magnification (objective power) from image metadata.
608
610
  int :
609
611
  Corresponding tile size for DeepLIIF.
610
612
  """
613
+
614
+ # make sure javabridge is already set up from with call to get_information()
615
+ size_x, size_y, size_z, size_c, size_t, pixel_type = get_information(filename)
616
+
617
+ mag = None
618
+ metadata = bioformats.get_omexml_metadata(filename)
619
+ try:
620
+ omexml = bioformats.OMEXML(metadata)
621
+ mag = omexml.instrument().Objective.NominalMagnification
622
+ except Exception as e:
623
+ fields = ['AppMag', 'NominalMagnification']
624
+ try:
625
+ for field in fields:
626
+ idx = metadata.find(field)
627
+ if idx >= 0:
628
+ for i in range(idx, len(metadata)):
629
+ if metadata[i].isdigit() or metadata[i] == '.':
630
+ break
631
+ for j in range(i, len(metadata)):
632
+ if not metadata[j].isdigit() and metadata[j] != '.':
633
+ break
634
+ if i == j:
635
+ continue
636
+ mag = metadata[i:j]
637
+ break
638
+ except Exception as e:
639
+ pass
640
+
641
+ if mag is None:
642
+ return None, None
643
+
611
644
  try:
612
- image = openslide.OpenSlide(filename)
613
- mag = image.properties.get(openslide.PROPERTY_NAME_OBJECTIVE_POWER)
614
645
  tile_size = round((float(mag) / 40) * 512)
615
646
  return mag, tile_size
616
647
  except Exception as e:
deepliif/util/__init__.py CHANGED
@@ -437,7 +437,7 @@ def get_information(filename):
437
437
  omexml.image().Pixels.SizeC, \
438
438
  omexml.image().Pixels.SizeT, \
439
439
  omexml.image().Pixels.PixelType
440
- print('SizeX:', size_x, ' SizeY:', size_y, ' SizeZ:', size_z, ' SizeC:', size_c, ' SizeT:', size_t, ' PixelType:', pixel_type)
440
+ #print('SizeX:', size_x, ' SizeY:', size_y, ' SizeZ:', size_z, ' SizeC:', size_c, ' SizeT:', size_t, ' PixelType:', pixel_type)
441
441
  return size_x, size_y, size_z, size_c, size_t, pixel_type
442
442
 
443
443
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deepliif
3
- Version: 1.1.12
3
+ Version: 1.1.13
4
4
  Summary: DeepLIIF: Deep-Learning Inferred Multiplex Immunofluorescence for Immunohistochemical Image Quantification
5
5
  Home-page: https://github.com/nadeemlab/DeepLIIF
6
6
  Author: Parmida93
@@ -9,7 +9,8 @@ Keywords: DeepLIIF,IHC,Segmentation,Classification
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE.md
11
11
  Requires-Dist: opencv-python (==4.8.1.78)
12
- Requires-Dist: torchvision (==0.10.0)
12
+ Requires-Dist: torch (==1.13.1)
13
+ Requires-Dist: torchvision (==0.14.1)
13
14
  Requires-Dist: scikit-image (==0.18.3)
14
15
  Requires-Dist: dominate (==2.6.0)
15
16
  Requires-Dist: numba (==0.57.1)
@@ -18,8 +19,6 @@ Requires-Dist: requests (==2.32.2)
18
19
  Requires-Dist: dask (==2021.11.2)
19
20
  Requires-Dist: visdom (>=0.1.8.3)
20
21
  Requires-Dist: python-bioformats (>=4.0.6)
21
- Requires-Dist: openslide-bin (==4.0.0.6)
22
- Requires-Dist: openslide-python (==1.4.1)
23
22
 
24
23
 
25
24
  <!-- PROJECT LOGO -->
@@ -65,7 +64,7 @@ segmentation.*
65
64
 
66
65
  © This code is made available for non-commercial academic purposes.
67
66
 
68
- ![Version](https://img.shields.io/static/v1?label=latest&message=v1.1.12&color=darkgreen)
67
+ ![Version](https://img.shields.io/static/v1?label=latest&message=v1.1.13&color=darkgreen)
69
68
  [![Total Downloads](https://static.pepy.tech/personalized-badge/deepliif?period=total&units=international_system&left_color=grey&right_color=blue&left_text=total%20downloads)](https://pepy.tech/project/deepliif?&left_text=totalusers)
70
69
 
71
70
  ![overview_image](./images/overview.png)*Overview of DeepLIIF pipeline and sample input IHCs (different
@@ -15,9 +15,11 @@ deepliif/models/CycleGAN_model.py,sha256=WDEa-Zgz57mVc9HbcVDXL5vfHvUDWdWXNLyz8Re
15
15
  deepliif/models/DeepLIIFExt_model.py,sha256=HZaX9Z2ue0HQCFFN3guLkBcByCP70i8JvmPY02oOMyU,15022
16
16
  deepliif/models/DeepLIIF_model.py,sha256=6vmsXcBcoALrhJLa7XGhDmLamO_WCzTDYEyVUBE482o,23857
17
17
  deepliif/models/SDG_model.py,sha256=3opz7uEyhvVJ8fF4_Jw4ho1MBcc9OVye-ByZD_KF2j0,10142
18
+ deepliif/models/__init__ - different weighted.py,sha256=Oe6ichU-Qia2mODGUtQTh1OBZZnv5N-93AzOfzQiHlw,32227
18
19
  deepliif/models/__init__ - run_dask_multi dev.py,sha256=vt8X8qeiJr2aPhFi6muZEJLUSsr8XChfI45NSwL8Rfg,39449
20
+ deepliif/models/__init__ - time gens.py,sha256=mRUtxNaGDZuhlQtKdA-OvGWTQwl7z2yMWc-9l0QrgaY,32922
19
21
  deepliif/models/__init__ - timings.py,sha256=S_wFImwxzGKx8STqbpcYCPOlbb_84WLMRDSnaWC8qFg,31750
20
- deepliif/models/__init__.py,sha256=-R9Em7TVGl36nKzlEI894T0WEONGVMV60aTucqLab5k,30846
22
+ deepliif/models/__init__.py,sha256=EZkZu28f5ju_YiEz4yAMHQ5GAzl1-Mi6AK4kfWe20UA,31934
21
23
  deepliif/models/att_unet.py,sha256=tqaFMNbGQUjXObOG309P76c7sIPxEvFR38EyuyHY40o,7116
22
24
  deepliif/models/base_model.py,sha256=ezWkmbuuNLGDMjyXe3VzJroj7QR1h0M9ByouzpfCrQg,16843
23
25
  deepliif/models/networks.py,sha256=Ijeb7nGf-YFgc_sBR-sIsk--0rTeiUqKZd01k4DMsuM,36614
@@ -26,15 +28,15 @@ deepliif/options/base_options.py,sha256=m5UXY8MvjNcDisUWuiP228yoT27SsCh1bXS_Td6S
26
28
  deepliif/options/processing_options.py,sha256=OnNT-ytoTQzetFiMEKrWvrsrhZlupRK4smcnIk0MbqY,2947
27
29
  deepliif/options/test_options.py,sha256=4ZbQC5U-nTbUz8jvdDIbse5TK_mjw4D5yNjpVevWD5M,1114
28
30
  deepliif/options/train_options.py,sha256=5eA_oxpRj2-HiuMMvC5-HLapxNFG_JXOQ3K132JjpR8,3580
29
- deepliif/util/__init__.py,sha256=-3t8kNolblI33XwpMaRbOPwVkKg1jjtVE8s0DvA2DNs,29145
31
+ deepliif/util/__init__.py,sha256=_b7-t5Z54CJJIy-moeKPPLFHg5BRCKgWo5V18WqRZVo,29146
30
32
  deepliif/util/get_data.py,sha256=HaRoQYb2u0LUgLT7ES-w35AmJ4BrlBEJWU4Cok29pxI,3749
31
33
  deepliif/util/html.py,sha256=RNAONZ4opP-bViahgmpSbHwOc6jXKQRnWRAVIaeIvac,3309
32
34
  deepliif/util/image_pool.py,sha256=M89Hc7DblRWroNP71S9mAdRn7h3DrhPFPjqFxxZYSgw,2280
33
35
  deepliif/util/util.py,sha256=9MNgqthJZYjl5-TJm5-sjWvMfPBz8F4P5K0RHXRQhfY,5241
34
36
  deepliif/util/visualizer.py,sha256=6E1sPbXdgLFB9mnPwtfEjm9O40viG4dfv5MyTpOQQpo,20210
35
- deepliif-1.1.12.dist-info/LICENSE.md,sha256=HlZw_UPS6EtJimJ_Ci7xKh-S5Iubs0Z8y8E6EZ3ZNyE,956
36
- deepliif-1.1.12.dist-info/METADATA,sha256=VX20mfKaSJkgH_OdGJOCbKSp3iahnE3_dnn_MUAMR5Y,35247
37
- deepliif-1.1.12.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
38
- deepliif-1.1.12.dist-info/entry_points.txt,sha256=f70-10j2q68o_rDlsE3hspnv4ejlDnXwwGZ9JJ-3yF4,37
39
- deepliif-1.1.12.dist-info/top_level.txt,sha256=vLDK5YKmDz08E7PywuvEjAo7dM5rnIpsjR4c0ubQCnc,13
40
- deepliif-1.1.12.dist-info/RECORD,,
37
+ deepliif-1.1.13.dist-info/LICENSE.md,sha256=HlZw_UPS6EtJimJ_Ci7xKh-S5Iubs0Z8y8E6EZ3ZNyE,956
38
+ deepliif-1.1.13.dist-info/METADATA,sha256=Ff0QjUBwpZGJcU1YgHfaixVAW6IYyHjV0FUi7QiGaRo,35195
39
+ deepliif-1.1.13.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
40
+ deepliif-1.1.13.dist-info/entry_points.txt,sha256=f70-10j2q68o_rDlsE3hspnv4ejlDnXwwGZ9JJ-3yF4,37
41
+ deepliif-1.1.13.dist-info/top_level.txt,sha256=vLDK5YKmDz08E7PywuvEjAo7dM5rnIpsjR4c0ubQCnc,13
42
+ deepliif-1.1.13.dist-info/RECORD,,