deepliif 1.2.1__tar.gz → 1.2.2__tar.gz

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.
Files changed (48) hide show
  1. {deepliif-1.2.1/deepliif.egg-info → deepliif-1.2.2}/PKG-INFO +2 -2
  2. {deepliif-1.2.1 → deepliif-1.2.2}/README.md +1 -1
  3. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/postprocessing.py +36 -8
  4. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/__init__.py +6 -4
  5. {deepliif-1.2.1 → deepliif-1.2.2/deepliif.egg-info}/PKG-INFO +2 -2
  6. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif.egg-info/requires.txt +1 -1
  7. {deepliif-1.2.1 → deepliif-1.2.2}/setup.cfg +1 -1
  8. {deepliif-1.2.1 → deepliif-1.2.2}/setup.py +2 -2
  9. {deepliif-1.2.1 → deepliif-1.2.2}/LICENSE.md +0 -0
  10. {deepliif-1.2.1 → deepliif-1.2.2}/cli.py +0 -0
  11. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/__init__.py +0 -0
  12. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/__init__.py +0 -0
  13. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/aligned_dataset.py +0 -0
  14. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/base_dataset.py +0 -0
  15. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/colorization_dataset.py +0 -0
  16. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/image_folder.py +0 -0
  17. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/single_dataset.py +0 -0
  18. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/template_dataset.py +0 -0
  19. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/data/unaligned_dataset.py +0 -0
  20. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/CycleGAN_model.py +0 -0
  21. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/DeepLIIFExt_model.py +0 -0
  22. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/DeepLIIFKD_model.py +0 -0
  23. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/DeepLIIF_model.py +0 -0
  24. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/SDG_model.py +0 -0
  25. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/__init__.py +0 -0
  26. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/att_unet.py +0 -0
  27. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/base_model.py +0 -0
  28. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/models/networks.py +0 -0
  29. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/options/__init__.py +0 -0
  30. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/options/base_options.py +0 -0
  31. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/options/processing_options.py +0 -0
  32. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/options/test_options.py +0 -0
  33. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/options/train_options.py +0 -0
  34. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/checks.py +0 -0
  35. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/get_data.py +0 -0
  36. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/html.py +0 -0
  37. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/image_pool.py +0 -0
  38. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/util.py +0 -0
  39. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif/util/visualizer.py +0 -0
  40. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif.egg-info/SOURCES.txt +0 -0
  41. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif.egg-info/dependency_links.txt +0 -0
  42. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif.egg-info/entry_points.txt +0 -0
  43. {deepliif-1.2.1 → deepliif-1.2.2}/deepliif.egg-info/top_level.txt +0 -0
  44. {deepliif-1.2.1 → deepliif-1.2.2}/tests/test_args.py +0 -0
  45. {deepliif-1.2.1 → deepliif-1.2.2}/tests/test_cli_inference.py +0 -0
  46. {deepliif-1.2.1 → deepliif-1.2.2}/tests/test_cli_serialize.py +0 -0
  47. {deepliif-1.2.1 → deepliif-1.2.2}/tests/test_cli_train.py +0 -0
  48. {deepliif-1.2.1 → deepliif-1.2.2}/tests/test_cli_trainlaunch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deepliif
3
- Version: 1.2.1
3
+ Version: 1.2.2
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
@@ -53,7 +53,7 @@ segmentation.*
53
53
 
54
54
  © This code is made available for non-commercial academic purposes.
55
55
 
56
- ![Version](https://img.shields.io/static/v1?label=latest&message=v1.2.1&color=darkgreen)
56
+ ![Version](https://img.shields.io/static/v1?label=latest&message=v1.2.2&color=darkgreen)
57
57
  [![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)
58
58
 
59
59
  ![overview_image](./images/overview.png)*Overview of DeepLIIF pipeline and sample input IHCs (different
@@ -42,7 +42,7 @@ segmentation.*
42
42
 
43
43
  © This code is made available for non-commercial academic purposes.
44
44
 
45
- ![Version](https://img.shields.io/static/v1?label=latest&message=v1.2.1&color=darkgreen)
45
+ ![Version](https://img.shields.io/static/v1?label=latest&message=v1.2.2&color=darkgreen)
46
46
  [![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)
47
47
 
48
48
  ![overview_image](./images/overview.png)*Overview of DeepLIIF pipeline and sample input IHCs (different
@@ -938,16 +938,11 @@ def create_cell_classification(mask, cellsinfo,
938
938
  idx = (seed[0] + n[0], seed[1] + n[1])
939
939
  if in_bounds(mask, idx) and mask[idx] == LABEL_CELL:
940
940
  seeds.append(idx)
941
- is_boundary = False
942
941
  for n in border_neighbors:
943
942
  idx2 = (idx[0] + n[0], idx[1] + n[1])
944
943
  if in_bounds(mask, idx2) and mask[idx2] == LABEL_BACKGROUND:
945
- is_boundary = True
946
- break
947
- if is_boundary:
948
- mask[idx] = label_border
949
- else:
950
- mask[idx] = label
944
+ mask[idx2] = label_border
945
+ mask[idx] = label
951
946
 
952
947
  num_total = num_pos + num_neg
953
948
  return {
@@ -976,7 +971,7 @@ def enlarge_cell_boundaries(mask):
976
971
  value = LABEL_BORDER_POS2 if mask[y, x] == LABEL_BORDER_POS else LABEL_BORDER_NEG2
977
972
  for n in neighbors:
978
973
  idx = (y + n[0], x + n[1])
979
- if in_bounds(mask, idx) and mask[idx] != LABEL_BORDER_POS and mask[idx] != LABEL_BORDER_NEG:
974
+ if in_bounds(mask, idx) and mask[idx] == LABEL_BACKGROUND:
980
975
  mask[idx] = value
981
976
 
982
977
  for y in range(mask.shape[0]):
@@ -1048,6 +1043,36 @@ def fill_cells(mask):
1048
1043
  else:
1049
1044
  mask[y, x] = LABEL_NEGATIVE
1050
1045
 
1046
+ for y in range(mask.shape[0]):
1047
+ for x in range(mask.shape[1]):
1048
+ if mask[y, x] == LABEL_BORDER_POS:
1049
+ mask[y, x] = LABEL_POSITIVE
1050
+ elif mask[y, x] == LABEL_BORDER_NEG:
1051
+ mask[y, x] = LABEL_NEGATIVE
1052
+
1053
+
1054
+ @jit(nopython=True)
1055
+ def create_outer_boundary(mask):
1056
+ """
1057
+ For a mask with positive and negative cell labels,
1058
+ set pixels neighboring the cells in-place to border labels.
1059
+
1060
+ Parameters
1061
+ ----------
1062
+ mask : ndarray
1063
+ 2D uint8 label map.
1064
+ """
1065
+
1066
+ border_neighbors = [(0, -1), (-1, 0), (1, 0), (0, 1)]
1067
+
1068
+ for y in range(mask.shape[0]):
1069
+ for x in range(mask.shape[1]):
1070
+ if mask[y, x] == LABEL_POSITIVE or mask[y, x] == LABEL_NEGATIVE:
1071
+ for n in border_neighbors:
1072
+ idx2 = (y + n[0], x + n[1])
1073
+ if in_bounds(mask, idx2) and mask[idx2] == LABEL_BACKGROUND:
1074
+ mask[idx2] = LABEL_BORDER_POS if mask[y, x] == LABEL_POSITIVE else LABEL_BORDER_NEG
1075
+
1051
1076
 
1052
1077
  def calculate_large_noise_thresh(large_noise_thresh, resolution):
1053
1078
  if large_noise_thresh != 'default':
@@ -1184,6 +1209,7 @@ def compute_final_results(orig, seg, marker, resolution,
1184
1209
 
1185
1210
  counts = create_cell_classification(mask, cellsinfo, size_thresh, marker_thresh, size_thresh_upper)
1186
1211
  enlarge_cell_boundaries(mask)
1212
+ enlarge_cell_boundaries(mask)
1187
1213
  overlay, refined = create_final_images(np.array(orig), mask)
1188
1214
 
1189
1215
  scoring = {
@@ -1260,6 +1286,8 @@ def cells_to_final_results(data, orig,
1260
1286
  mark_background(mask)
1261
1287
  fill_cells(mask)
1262
1288
 
1289
+ create_outer_boundary(mask)
1290
+ enlarge_cell_boundaries(mask)
1263
1291
  enlarge_cell_boundaries(mask)
1264
1292
  overlay, refined = create_final_images(np.array(orig), mask)
1265
1293
 
@@ -489,9 +489,8 @@ class WSIReader:
489
489
  self._file.close()
490
490
 
491
491
  self._bfreader = None
492
- if self._tif is None:
493
- self._rescale = (self._pixel_type != 'uint8')
494
- self._bfreader = bioformats.ImageReader(path)
492
+ self._rescale = (self._pixel_type != 'uint8')
493
+ self._bfreader = bioformats.ImageReader(path)
495
494
 
496
495
  if self._tif is None and self._bfreader is None:
497
496
  raise Exception('Cannot read WSI file.')
@@ -520,7 +519,10 @@ class WSIReader:
520
519
  def read(self, xywh):
521
520
  if self._tif is not None:
522
521
  x, y, w, h = xywh
523
- return self._zarr[y:y+h, x:x+w]
522
+ try:
523
+ return self._zarr[y:y+h, x:x+w]
524
+ except Exception as e:
525
+ pass
524
526
 
525
527
  px = self._bfreader.read(XYWH=xywh, rescale=self._rescale)
526
528
  if self._rescale:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deepliif
3
- Version: 1.2.1
3
+ Version: 1.2.2
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
@@ -53,7 +53,7 @@ segmentation.*
53
53
 
54
54
  © This code is made available for non-commercial academic purposes.
55
55
 
56
- ![Version](https://img.shields.io/static/v1?label=latest&message=v1.2.1&color=darkgreen)
56
+ ![Version](https://img.shields.io/static/v1?label=latest&message=v1.2.2&color=darkgreen)
57
57
  [![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)
58
58
 
59
59
  ![overview_image](./images/overview.png)*Overview of DeepLIIF pipeline and sample input IHCs (different
@@ -1,5 +1,5 @@
1
1
  opencv-python==4.8.1.78
2
- torch==1.13.1
2
+ torch==2.8.0
3
3
  torchvision==0.14.1
4
4
  scikit-image==0.18.3
5
5
  dominate==2.6.0
@@ -3,7 +3,7 @@ name = deepliif
3
3
  description_file = README.md
4
4
  author = Parmida93
5
5
  author_email = ghahremani.parmida@gmail.com
6
- version = 1.2.1
6
+ version = 1.2.2
7
7
  url = https://github.com/nadeemlab/DeepLIIF
8
8
 
9
9
  [egg_info]
@@ -6,7 +6,7 @@ README = (HERE / "README.md").read_text()
6
6
 
7
7
  setup(
8
8
  name='deepliif',
9
- version='1.2.1',
9
+ version='1.2.2',
10
10
  packages=['deepliif', 'deepliif.data', 'deepliif.models', 'deepliif.util', 'deepliif.options'],
11
11
 
12
12
  description='DeepLIIF: Deep-Learning Inferred Multiplex Immunofluorescence for Immunohistochemical Image Quantification',
@@ -21,7 +21,7 @@ setup(
21
21
  py_modules=['cli'],
22
22
  install_requires=[
23
23
  "opencv-python==4.8.1.78",
24
- "torch==1.13.1",
24
+ "torch==2.8.0",
25
25
  "torchvision==0.14.1",
26
26
  "scikit-image==0.18.3",
27
27
  "dominate==2.6.0",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes