cellfinder 1.1.3__py3-none-any.whl → 1.3.0rc0__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.
Files changed (185) hide show
  1. cellfinder/__init__.py +20 -11
  2. cellfinder/__pycache__/__init__.cpython-310.pyc +0 -0
  3. cellfinder/__pycache__/__init__.cpython-311.pyc +0 -0
  4. cellfinder/__pycache__/__init__.cpython-312.pyc +0 -0
  5. cellfinder/core/__pycache__/__init__.cpython-310.pyc +0 -0
  6. cellfinder/core/__pycache__/__init__.cpython-311.pyc +0 -0
  7. cellfinder/core/__pycache__/__init__.cpython-312.pyc +0 -0
  8. cellfinder/core/__pycache__/main.cpython-310.pyc +0 -0
  9. cellfinder/core/__pycache__/main.cpython-311.pyc +0 -0
  10. cellfinder/core/__pycache__/main.cpython-312.pyc +0 -0
  11. cellfinder/core/__pycache__/types.cpython-310.pyc +0 -0
  12. cellfinder/core/__pycache__/types.cpython-311.pyc +0 -0
  13. cellfinder/core/__pycache__/types.cpython-312.pyc +0 -0
  14. cellfinder/core/classify/__pycache__/__init__.cpython-310.pyc +0 -0
  15. cellfinder/core/classify/__pycache__/__init__.cpython-311.pyc +0 -0
  16. cellfinder/core/classify/__pycache__/__init__.cpython-312.pyc +0 -0
  17. cellfinder/core/classify/__pycache__/augment.cpython-310.pyc +0 -0
  18. cellfinder/core/classify/__pycache__/augment.cpython-311.pyc +0 -0
  19. cellfinder/core/classify/__pycache__/augment.cpython-312.pyc +0 -0
  20. cellfinder/core/classify/__pycache__/classify.cpython-310.pyc +0 -0
  21. cellfinder/core/classify/__pycache__/classify.cpython-311.pyc +0 -0
  22. cellfinder/core/classify/__pycache__/classify.cpython-312.pyc +0 -0
  23. cellfinder/core/classify/__pycache__/cube_generator.cpython-310.pyc +0 -0
  24. cellfinder/core/classify/__pycache__/cube_generator.cpython-311.pyc +0 -0
  25. cellfinder/core/classify/__pycache__/cube_generator.cpython-312.pyc +0 -0
  26. cellfinder/core/classify/__pycache__/resnet.cpython-310.pyc +0 -0
  27. cellfinder/core/classify/__pycache__/resnet.cpython-311.pyc +0 -0
  28. cellfinder/core/classify/__pycache__/resnet.cpython-312.pyc +0 -0
  29. cellfinder/core/classify/__pycache__/tools.cpython-310.pyc +0 -0
  30. cellfinder/core/classify/__pycache__/tools.cpython-311.pyc +0 -0
  31. cellfinder/core/classify/__pycache__/tools.cpython-312.pyc +0 -0
  32. cellfinder/core/classify/classify.py +5 -6
  33. cellfinder/core/classify/cube_generator.py +25 -9
  34. cellfinder/core/classify/resnet.py +9 -6
  35. cellfinder/core/classify/tools.py +13 -11
  36. cellfinder/core/config/cellfinder.conf.custom +3 -0
  37. cellfinder/core/detect/__pycache__/__init__.cpython-310.pyc +0 -0
  38. cellfinder/core/detect/__pycache__/__init__.cpython-311.pyc +0 -0
  39. cellfinder/core/detect/__pycache__/__init__.cpython-312.pyc +0 -0
  40. cellfinder/core/detect/__pycache__/detect.cpython-310.pyc +0 -0
  41. cellfinder/core/detect/__pycache__/detect.cpython-311.pyc +0 -0
  42. cellfinder/core/detect/__pycache__/detect.cpython-312.pyc +0 -0
  43. cellfinder/core/detect/detect.py +12 -1
  44. cellfinder/core/detect/filters/__pycache__/__init__.cpython-310.pyc +0 -0
  45. cellfinder/core/detect/filters/__pycache__/__init__.cpython-311.pyc +0 -0
  46. cellfinder/core/detect/filters/__pycache__/__init__.cpython-312.pyc +0 -0
  47. cellfinder/core/detect/filters/__pycache__/setup_filters.cpython-310.pyc +0 -0
  48. cellfinder/core/detect/filters/__pycache__/setup_filters.cpython-311.pyc +0 -0
  49. cellfinder/core/detect/filters/__pycache__/setup_filters.cpython-312.pyc +0 -0
  50. cellfinder/core/detect/filters/plane/__pycache__/__init__.cpython-310.pyc +0 -0
  51. cellfinder/core/detect/filters/plane/__pycache__/__init__.cpython-311.pyc +0 -0
  52. cellfinder/core/detect/filters/plane/__pycache__/__init__.cpython-312.pyc +0 -0
  53. cellfinder/core/detect/filters/plane/__pycache__/classical_filter.cpython-310.pyc +0 -0
  54. cellfinder/core/detect/filters/plane/__pycache__/classical_filter.cpython-311.pyc +0 -0
  55. cellfinder/core/detect/filters/plane/__pycache__/classical_filter.cpython-312.pyc +0 -0
  56. cellfinder/core/detect/filters/plane/__pycache__/plane_filter.cpython-310.pyc +0 -0
  57. cellfinder/core/detect/filters/plane/__pycache__/plane_filter.cpython-311.pyc +0 -0
  58. cellfinder/core/detect/filters/plane/__pycache__/plane_filter.cpython-312.pyc +0 -0
  59. cellfinder/core/detect/filters/plane/__pycache__/tile_walker.cpython-310.pyc +0 -0
  60. cellfinder/core/detect/filters/plane/__pycache__/tile_walker.cpython-311.pyc +0 -0
  61. cellfinder/core/detect/filters/plane/__pycache__/tile_walker.cpython-312.pyc +0 -0
  62. cellfinder/core/detect/filters/volume/__pycache__/__init__.cpython-310.pyc +0 -0
  63. cellfinder/core/detect/filters/volume/__pycache__/__init__.cpython-311.pyc +0 -0
  64. cellfinder/core/detect/filters/volume/__pycache__/__init__.cpython-312.pyc +0 -0
  65. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-199.py310.1.nbc +0 -0
  66. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-199.py310.nbi +0 -0
  67. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py310.1.nbc +0 -0
  68. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py310.2.nbc +0 -0
  69. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py310.nbi +0 -0
  70. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py311.1.nbc +0 -0
  71. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py311.2.nbc +0 -0
  72. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py311.nbi +0 -0
  73. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py312.1.nbc +0 -0
  74. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py312.2.nbc +0 -0
  75. cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py312.nbi +0 -0
  76. cellfinder/core/detect/filters/volume/__pycache__/ball_filter.cpython-310.pyc +0 -0
  77. cellfinder/core/detect/filters/volume/__pycache__/ball_filter.cpython-311.pyc +0 -0
  78. cellfinder/core/detect/filters/volume/__pycache__/ball_filter.cpython-312.pyc +0 -0
  79. cellfinder/core/detect/filters/volume/__pycache__/structure_detection.cpython-310.pyc +0 -0
  80. cellfinder/core/detect/filters/volume/__pycache__/structure_detection.cpython-311.pyc +0 -0
  81. cellfinder/core/detect/filters/volume/__pycache__/structure_detection.cpython-312.pyc +0 -0
  82. cellfinder/core/detect/filters/volume/__pycache__/structure_splitting.cpython-310.pyc +0 -0
  83. cellfinder/core/detect/filters/volume/__pycache__/structure_splitting.cpython-311.pyc +0 -0
  84. cellfinder/core/detect/filters/volume/__pycache__/structure_splitting.cpython-312.pyc +0 -0
  85. cellfinder/core/detect/filters/volume/__pycache__/volume_filter.cpython-310.pyc +0 -0
  86. cellfinder/core/detect/filters/volume/__pycache__/volume_filter.cpython-311.pyc +0 -0
  87. cellfinder/core/detect/filters/volume/__pycache__/volume_filter.cpython-312.pyc +0 -0
  88. cellfinder/core/detect/filters/volume/ball_filter.py +198 -113
  89. cellfinder/core/detect/filters/volume/structure_detection.py +105 -41
  90. cellfinder/core/detect/filters/volume/structure_splitting.py +1 -1
  91. cellfinder/core/detect/filters/volume/volume_filter.py +48 -49
  92. cellfinder/core/download/__pycache__/__init__.cpython-310.pyc +0 -0
  93. cellfinder/core/download/__pycache__/__init__.cpython-311.pyc +0 -0
  94. cellfinder/core/download/__pycache__/__init__.cpython-312.pyc +0 -0
  95. cellfinder/core/download/__pycache__/cli.cpython-310.pyc +0 -0
  96. cellfinder/core/download/__pycache__/cli.cpython-312.pyc +0 -0
  97. cellfinder/core/download/__pycache__/download.cpython-310.pyc +0 -0
  98. cellfinder/core/download/__pycache__/download.cpython-311.pyc +0 -0
  99. cellfinder/core/download/__pycache__/download.cpython-312.pyc +0 -0
  100. cellfinder/core/download/cli.py +39 -32
  101. cellfinder/core/download/download.py +44 -56
  102. cellfinder/core/main.py +52 -67
  103. cellfinder/core/tools/__pycache__/IO.cpython-310.pyc +0 -0
  104. cellfinder/core/tools/__pycache__/__init__.cpython-310.pyc +0 -0
  105. cellfinder/core/tools/__pycache__/__init__.cpython-311.pyc +0 -0
  106. cellfinder/core/tools/__pycache__/__init__.cpython-312.pyc +0 -0
  107. cellfinder/core/tools/__pycache__/array_operations.cpython-310.pyc +0 -0
  108. cellfinder/core/tools/__pycache__/array_operations.cpython-311.pyc +0 -0
  109. cellfinder/core/tools/__pycache__/array_operations.cpython-312.pyc +0 -0
  110. cellfinder/core/tools/__pycache__/geometry.cpython-310.pyc +0 -0
  111. cellfinder/core/tools/__pycache__/geometry.cpython-311.pyc +0 -0
  112. cellfinder/core/tools/__pycache__/geometry.cpython-312.pyc +0 -0
  113. cellfinder/core/tools/__pycache__/image_processing.cpython-310.pyc +0 -0
  114. cellfinder/core/tools/__pycache__/image_processing.cpython-312.pyc +0 -0
  115. cellfinder/core/tools/__pycache__/prep.cpython-310.pyc +0 -0
  116. cellfinder/core/tools/__pycache__/prep.cpython-311.pyc +0 -0
  117. cellfinder/core/tools/__pycache__/prep.cpython-312.pyc +0 -0
  118. cellfinder/core/tools/__pycache__/source_files.cpython-310.pyc +0 -0
  119. cellfinder/core/tools/__pycache__/source_files.cpython-311.pyc +0 -0
  120. cellfinder/core/tools/__pycache__/source_files.cpython-312.pyc +0 -0
  121. cellfinder/core/tools/__pycache__/system.cpython-310.pyc +0 -0
  122. cellfinder/core/tools/__pycache__/system.cpython-312.pyc +0 -0
  123. cellfinder/core/tools/__pycache__/tf.cpython-310.pyc +0 -0
  124. cellfinder/core/tools/__pycache__/tiff.cpython-310.pyc +0 -0
  125. cellfinder/core/tools/__pycache__/tiff.cpython-312.pyc +0 -0
  126. cellfinder/core/tools/__pycache__/tools.cpython-310.pyc +0 -0
  127. cellfinder/core/tools/__pycache__/tools.cpython-311.pyc +0 -0
  128. cellfinder/core/tools/__pycache__/tools.cpython-312.pyc +0 -0
  129. cellfinder/core/tools/prep.py +12 -20
  130. cellfinder/core/tools/source_files.py +5 -3
  131. cellfinder/core/train/__pycache__/__init__.cpython-310.pyc +0 -0
  132. cellfinder/core/train/__pycache__/__init__.cpython-311.pyc +0 -0
  133. cellfinder/core/train/__pycache__/__init__.cpython-312.pyc +0 -0
  134. cellfinder/core/train/__pycache__/train_yml.cpython-310.pyc +0 -0
  135. cellfinder/core/train/__pycache__/train_yml.cpython-311.pyc +0 -0
  136. cellfinder/core/train/__pycache__/train_yml.cpython-312.pyc +0 -0
  137. cellfinder/core/train/train_yml.py +29 -27
  138. cellfinder/napari/__pycache__/__init__.cpython-310.pyc +0 -0
  139. cellfinder/napari/__pycache__/__init__.cpython-311.pyc +0 -0
  140. cellfinder/napari/__pycache__/__init__.cpython-312.pyc +0 -0
  141. cellfinder/napari/__pycache__/curation.cpython-310.pyc +0 -0
  142. cellfinder/napari/__pycache__/curation.cpython-312.pyc +0 -0
  143. cellfinder/napari/__pycache__/input_container.cpython-310.pyc +0 -0
  144. cellfinder/napari/__pycache__/input_container.cpython-311.pyc +0 -0
  145. cellfinder/napari/__pycache__/input_container.cpython-312.pyc +0 -0
  146. cellfinder/napari/__pycache__/sample_data.cpython-310.pyc +0 -0
  147. cellfinder/napari/__pycache__/sample_data.cpython-312.pyc +0 -0
  148. cellfinder/napari/__pycache__/utils.cpython-310.pyc +0 -0
  149. cellfinder/napari/__pycache__/utils.cpython-311.pyc +0 -0
  150. cellfinder/napari/__pycache__/utils.cpython-312.pyc +0 -0
  151. cellfinder/napari/detect/__pycache__/__init__.cpython-310.pyc +0 -0
  152. cellfinder/napari/detect/__pycache__/__init__.cpython-311.pyc +0 -0
  153. cellfinder/napari/detect/__pycache__/__init__.cpython-312.pyc +0 -0
  154. cellfinder/napari/detect/__pycache__/detect.cpython-310.pyc +0 -0
  155. cellfinder/napari/detect/__pycache__/detect.cpython-311.pyc +0 -0
  156. cellfinder/napari/detect/__pycache__/detect.cpython-312.pyc +0 -0
  157. cellfinder/napari/detect/__pycache__/detect_containers.cpython-310.pyc +0 -0
  158. cellfinder/napari/detect/__pycache__/detect_containers.cpython-311.pyc +0 -0
  159. cellfinder/napari/detect/__pycache__/detect_containers.cpython-312.pyc +0 -0
  160. cellfinder/napari/detect/__pycache__/thread_worker.cpython-310.pyc +0 -0
  161. cellfinder/napari/detect/__pycache__/thread_worker.cpython-311.pyc +0 -0
  162. cellfinder/napari/detect/__pycache__/thread_worker.cpython-312.pyc +0 -0
  163. cellfinder/napari/detect/detect.py +252 -57
  164. cellfinder/napari/detect/detect_containers.py +9 -1
  165. cellfinder/napari/detect/thread_worker.py +14 -0
  166. cellfinder/napari/train/__pycache__/__init__.cpython-310.pyc +0 -0
  167. cellfinder/napari/train/__pycache__/__init__.cpython-312.pyc +0 -0
  168. cellfinder/napari/train/__pycache__/train.cpython-310.pyc +0 -0
  169. cellfinder/napari/train/__pycache__/train.cpython-312.pyc +0 -0
  170. cellfinder/napari/train/__pycache__/train_containers.cpython-310.pyc +0 -0
  171. cellfinder/napari/train/__pycache__/train_containers.cpython-312.pyc +0 -0
  172. cellfinder/napari/train/train.py +2 -9
  173. cellfinder/napari/train/train_containers.py +3 -3
  174. cellfinder/napari/utils.py +88 -47
  175. {cellfinder-1.1.3.dist-info → cellfinder-1.3.0rc0.dist-info}/METADATA +11 -11
  176. cellfinder-1.3.0rc0.dist-info/RECORD +211 -0
  177. cellfinder/core/download/models.py +0 -49
  178. cellfinder/core/tools/IO.py +0 -48
  179. cellfinder/core/tools/tf.py +0 -46
  180. cellfinder/napari/images/brainglobe.png +0 -0
  181. cellfinder-1.1.3.dist-info/RECORD +0 -63
  182. {cellfinder-1.1.3.dist-info → cellfinder-1.3.0rc0.dist-info}/LICENSE +0 -0
  183. {cellfinder-1.1.3.dist-info → cellfinder-1.3.0rc0.dist-info}/WHEEL +0 -0
  184. {cellfinder-1.1.3.dist-info → cellfinder-1.3.0rc0.dist-info}/entry_points.txt +0 -0
  185. {cellfinder-1.1.3.dist-info → cellfinder-1.3.0rc0.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,10 @@
1
1
  from typing import List, Tuple
2
2
 
3
3
  import napari
4
+ import napari.layers
4
5
  import numpy as np
5
- import pandas as pd
6
6
  from brainglobe_utils.cells.cells import Cell
7
- from pkg_resources import resource_filename
8
-
9
- brainglobe_logo = resource_filename(
10
- "cellfinder", "napari/images/brainglobe.png"
11
- )
12
-
13
-
14
- widget_header = """
15
- <p>Efficient cell detection in large images.</p>
16
- <p><a href="https://brainglobe.info" style="color:gray;">Website</a></p>
17
- <p><a href="https://brainglobe.info/documentation/cellfinder/user-guide/napari-plugin/index.html" style="color:gray;">Documentation</a></p>
18
- <p><a href="https://github.com/brainglobe/cellfinder" style="color:gray;">Source</a></p>
19
- <p><a href="https://doi.org/10.1371/journal.pcbi.1009074" style="color:gray;">Citation</a></p>
20
- <p><small>For help, hover the cursor over each parameter.</small>
21
- """ # noqa: E501
7
+ from brainglobe_utils.qtpy.logo import header_widget
22
8
 
23
9
 
24
10
  def html_label_widget(label: str, *, tag: str = "b") -> dict:
@@ -31,25 +17,42 @@ def html_label_widget(label: str, *, tag: str = "b") -> dict:
31
17
  )
32
18
 
33
19
 
34
- header_label_widget = html_label_widget(
35
- f"""
36
- <img src="{brainglobe_logo}"width="100">
37
- <p>cellfinder</p>
38
- """,
39
- tag="h1",
40
- )
20
+ def cellfinder_header():
21
+ """
22
+ Create the header containing the brainglobe logo and documentation links
23
+ for all cellfinder widgets.
24
+ """
25
+ return header_widget(
26
+ "cellfinder",
27
+ "Efficient cell detection in large images.",
28
+ documentation_path="cellfinder/user-guide/napari-plugin/index.html",
29
+ citation_doi="https://doi.org/10.1371/journal.pcbi.1009074",
30
+ help_text="For help, hover the cursor over each parameter.",
31
+ )
32
+
33
+
34
+ # the xyz axis order in napari relative to ours. I.e. our zeroth axis is the
35
+ # napari last axis. Ours is XYZ.
36
+ napari_points_axis_order = 2, 1, 0
37
+ # the xyz axis order in brainglobe relative to napari. I.e. napari's zeroth
38
+ # axis is our last axis - it's just flipped
39
+ brainglobe_points_axis_order = napari_points_axis_order
41
40
 
42
41
 
43
- def add_layers(points: List[Cell], viewer: napari.Viewer) -> None:
42
+ def add_classified_layers(
43
+ points: List[Cell],
44
+ viewer: napari.Viewer,
45
+ unknown_name: str = "Rejected",
46
+ cell_name: str = "Detected",
47
+ ) -> None:
44
48
  """
45
- Adds classified cell candidates as two separate point layers to the napari
46
- viewer.
49
+ Adds cell candidates as two separate point layers - unknowns and cells, to
50
+ the napari viewer. Does not add any other cell types, only Cell.UNKNOWN
51
+ and Cell.CELL from the list of cells.
47
52
  """
48
- detected, rejected = cells_to_array(points)
49
-
50
53
  viewer.add_points(
51
- rejected,
52
- name="Rejected",
54
+ cells_to_array(points, Cell.UNKNOWN, napari_order=True),
55
+ name=unknown_name,
53
56
  size=15,
54
57
  n_dimensional=True,
55
58
  opacity=0.6,
@@ -59,8 +62,8 @@ def add_layers(points: List[Cell], viewer: napari.Viewer) -> None:
59
62
  metadata=dict(point_type=Cell.UNKNOWN),
60
63
  )
61
64
  viewer.add_points(
62
- detected,
63
- name="Detected",
65
+ cells_to_array(points, Cell.CELL, napari_order=True),
66
+ name=cell_name,
64
67
  size=15,
65
68
  n_dimensional=True,
66
69
  opacity=0.6,
@@ -70,23 +73,61 @@ def add_layers(points: List[Cell], viewer: napari.Viewer) -> None:
70
73
  )
71
74
 
72
75
 
73
- def cells_df_as_np(
74
- cells_df: pd.DataFrame,
75
- new_order: List[int] = [2, 1, 0],
76
- type_column: str = "type",
76
+ def add_single_layer(
77
+ points: List[Cell],
78
+ viewer: napari.Viewer,
79
+ name: str,
80
+ cell_type: int,
81
+ ) -> None:
82
+ """
83
+ Adds all cells of cell_type Cell.TYPE to a new point layer in the napari
84
+ viewer, with given name.
85
+ """
86
+ viewer.add_points(
87
+ cells_to_array(points, cell_type, napari_order=True),
88
+ name=name,
89
+ size=15,
90
+ n_dimensional=True,
91
+ opacity=0.6,
92
+ symbol="ring",
93
+ face_color="lightskyblue",
94
+ visible=True,
95
+ metadata=dict(point_type=cell_type),
96
+ )
97
+
98
+
99
+ def cells_to_array(
100
+ cells: List[Cell], cell_type: int, napari_order: bool = True
77
101
  ) -> np.ndarray:
78
102
  """
79
- Convert a dataframe to an array, dropping *type_column* and re-ordering
80
- the columns with *new_order*.
103
+ Converts all the cells of the given type as a 2D pos array.
104
+ The column order is either XYZ, otherwise it's the napari ordering
105
+ of the 3 axes (napari_points_axis_order).
81
106
  """
82
- cells_df = cells_df.drop(columns=[type_column])
83
- cells = cells_df[cells_df.columns[new_order]]
84
- cells = cells.to_numpy()
85
- return cells
107
+ cells = [c for c in cells if c.type == cell_type]
108
+ if not cells:
109
+ # make sure we return 2d array if cells is empty
110
+ return np.zeros((0, 3), dtype=np.int_)
111
+ points = np.array([(c.x, c.y, c.z) for c in cells])
86
112
 
113
+ if napari_order:
114
+ return points[:, napari_points_axis_order]
115
+ return points
87
116
 
88
- def cells_to_array(cells: List[Cell]) -> Tuple[np.ndarray, np.ndarray]:
89
- df = pd.DataFrame([c.to_dict() for c in cells])
90
- points = cells_df_as_np(df[df["type"] == Cell.CELL])
91
- rejected = cells_df_as_np(df[df["type"] == Cell.UNKNOWN])
92
- return points, rejected
117
+
118
+ def napari_array_to_cells(
119
+ points: napari.layers.Points,
120
+ cell_type: int,
121
+ brainglobe_order: Tuple[int, int, int] = brainglobe_points_axis_order,
122
+ ) -> List[Cell]:
123
+ """
124
+ Takes a napari Points layer and returns a list of cell objects, one for
125
+ each point in the layer.
126
+ """
127
+ data = np.asarray(points.data)[:, brainglobe_order].tolist()
128
+
129
+ cells = []
130
+ for row in data:
131
+ cells.append(Cell(pos=row, cell_type=cell_type))
132
+
133
+ return cells
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cellfinder
3
- Version: 1.1.3
3
+ Version: 1.3.0rc0
4
4
  Summary: Automated 3D cell detection in large microscopy images
5
5
  Author-email: "Adam Tyson, Christian Niedworok, Charly Rousseau" <code@adamltyson.com>
6
6
  License: BSD-3-Clause
@@ -22,7 +22,7 @@ Classifier: Topic :: Scientific/Engineering :: Image Recognition
22
22
  Requires-Python: >=3.9
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
- Requires-Dist: brainglobe-utils >=0.4.2
25
+ Requires-Dist: brainglobe-utils >=0.5.0
26
26
  Requires-Dist: brainglobe-napari-io >=0.3.4
27
27
  Requires-Dist: dask[array]
28
28
  Requires-Dist: fancylog >=0.0.7
@@ -31,10 +31,10 @@ Requires-Dist: numba
31
31
  Requires-Dist: numpy
32
32
  Requires-Dist: scikit-image
33
33
  Requires-Dist: scikit-learn
34
+ Requires-Dist: keras >=3.0.0
35
+ Requires-Dist: torch >=2.1.0
34
36
  Requires-Dist: tifffile
35
37
  Requires-Dist: tqdm
36
- Requires-Dist: tensorflow <2.12.0,>=2.5.0 ; platform_system != "Darwin" or platform_machine != "arm64"
37
- Requires-Dist: tensorflow-macos <2.12.0,>=2.5.0 ; platform_system == "Darwin" and platform_machine == "arm64"
38
38
  Provides-Extra: dev
39
39
  Requires-Dist: black ; extra == 'dev'
40
40
  Requires-Dist: pre-commit ; extra == 'dev'
@@ -54,17 +54,17 @@ Requires-Dist: napari[pyqt5] ; extra == 'napari'
54
54
  Requires-Dist: pooch >=1 ; extra == 'napari'
55
55
  Requires-Dist: qtpy ; extra == 'napari'
56
56
 
57
- [![Python Version](https://img.shields.io/pypi/pyversions/cellfinder-core.svg)](https://pypi.org/project/cellfinder)
58
- [![PyPI](https://img.shields.io/pypi/v/cellfinder-core.svg)](https://pypi.org/project/cellfinder)
59
- [![Downloads](https://pepy.tech/badge/cellfinder-core)](https://pepy.tech/project/cellfinder)
60
- [![Wheel](https://img.shields.io/pypi/wheel/cellfinder-core.svg)](https://pypi.org/project/cellfinder)
61
- [![Development Status](https://img.shields.io/pypi/status/cellfinder-core.svg)](https://github.com/brainglobe/cellfinder)
57
+ [![Python Version](https://img.shields.io/pypi/pyversions/cellfinder.svg)](https://pypi.org/project/cellfinder)
58
+ [![PyPI](https://img.shields.io/pypi/v/cellfinder.svg)](https://pypi.org/project/cellfinder)
59
+ [![Downloads](https://pepy.tech/badge/cellfinder)](https://pepy.tech/project/cellfinder)
60
+ [![Wheel](https://img.shields.io/pypi/wheel/cellfinder.svg)](https://pypi.org/project/cellfinder)
61
+ [![Development Status](https://img.shields.io/pypi/status/cellfinder.svg)](https://github.com/brainglobe/cellfinder)
62
62
  [![Tests](https://img.shields.io/github/actions/workflow/status/brainglobe/cellfinder/test_and_deploy.yml?branch=main)](https://github.com/brainglobe/cellfinder/actions)
63
- [![codecov](https://codecov.io/gh/brainglobe/cellfinder-core/branch/main/graph/badge.svg?token=nx1lhNI7ox)](https://codecov.io/gh/brainglobe/cellfinder)
63
+ [![codecov](https://codecov.io/gh/brainglobe/cellfinder/branch/main/graph/badge.svg?token=nx1lhNI7ox)](https://codecov.io/gh/brainglobe/cellfinder)
64
64
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
65
65
  [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
66
66
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
67
- [![Contributions](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](https://brainglobe.info/developers/index.html)
67
+ [![Contributions](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](https://brainglobe.info/community/developers/index.html)
68
68
  [![Twitter](https://img.shields.io/twitter/follow/brain_globe?style=social)](https://twitter.com/brain_globe)
69
69
 
70
70
  # cellfinder
@@ -0,0 +1,211 @@
1
+ cellfinder/__init__.py,sha256=LZxnlkVAIVu3A7ooY0dmzq__ipbNKdphdlba_9DtMdQ,1182
2
+ cellfinder/cli_migration_warning.py,sha256=gPtNrtnXvWpl5q0k_EGAQZg0DwcpCmuBTgpg56n5NfA,1578
3
+ cellfinder/__pycache__/__init__.cpython-310.pyc,sha256=XXMMEG2ShEH1bRCuDfQKRNfz57JI9XxHnsIxuCKKxDU,1336
4
+ cellfinder/__pycache__/__init__.cpython-311.pyc,sha256=CKfmAJ8Hx9efF01xENnmbUXKspFPT4n7s_X2QBKC7Y0,2087
5
+ cellfinder/__pycache__/__init__.cpython-312.pyc,sha256=Suc9rjm42y2Fu83aciIL7YkOETUdUKYwxR6UUbFEHlM,1302
6
+ cellfinder/core/__init__.py,sha256=pRFuQsl78HEK0S6gvhJw70QLbjjSBzP-GFO0AtVaGtk,62
7
+ cellfinder/core/main.py,sha256=6Uby8WuJ-U6_XBzHIla-fm3WQ2q6Vu7rYjme5Igfp_8,3625
8
+ cellfinder/core/types.py,sha256=lTqWE4v0SMM0qLAZJdyAzqV1nLgDtobEpglNJcXt160,106
9
+ cellfinder/core/__pycache__/__init__.cpython-310.pyc,sha256=wIdaX3Bxste3jYLsUDWP-HMOf0MhDfhiV0bTeOYmQX8,229
10
+ cellfinder/core/__pycache__/__init__.cpython-311.pyc,sha256=3LfRJeCQHBOTOL3STxLhVlum_xwnB09sfqx9BCdPMak,287
11
+ cellfinder/core/__pycache__/__init__.cpython-312.pyc,sha256=gPGTWBQnD2WpQl4W84gl-JHbY7GNzHcOmhm1OvYD1PU,279
12
+ cellfinder/core/__pycache__/main.cpython-310.pyc,sha256=UXMkOEqy0K1gRon0BejZtxg6ce5znYuI8ABqaCdu_lU,3097
13
+ cellfinder/core/__pycache__/main.cpython-311.pyc,sha256=tMpClnvd2SiQma24WJtZvaH0tGDLJcHDvkScTPAriM4,4249
14
+ cellfinder/core/__pycache__/main.cpython-312.pyc,sha256=GmKHLMHK8MH_PjZ7kVMEuQKCXvjgFJApUjEsJOaXzx4,3866
15
+ cellfinder/core/__pycache__/types.cpython-310.pyc,sha256=n8gQNOSNR2MDqLJO6-C3y44ZdF9UBKpjB8n4irVN_f4,287
16
+ cellfinder/core/__pycache__/types.cpython-311.pyc,sha256=weJcbu6YoumtXOU5hRc8DyDs1nRFViCQEg6elDrOfZI,382
17
+ cellfinder/core/__pycache__/types.cpython-312.pyc,sha256=kHDapjUbMnR2JcUWGNEYXTOb8hc0i560HQHNmNqLOC8,355
18
+ cellfinder/core/classify/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ cellfinder/core/classify/augment.py,sha256=8dMbM7KhimM6NMgdMC53oHoCfYj1CIB-h3Yk8CZAxPw,6321
20
+ cellfinder/core/classify/classify.py,sha256=aL2kNojKb4wsk7Zm26yq2QRiazRbwUO_cbbC2BJN0uc,3061
21
+ cellfinder/core/classify/cube_generator.py,sha256=L5BvTDiHbkJ6VFeApALGtCV7Ws--jXR1foYY-bL0Buc,17125
22
+ cellfinder/core/classify/resnet.py,sha256=vGa85y_NcQnOXwAt5EtatLx5mrO8IoShCcNKtJ5-EFg,10034
23
+ cellfinder/core/classify/tools.py,sha256=s5PEKAsZVbVuoferZ_nqMUM0f2bV_8WEKsdKe3SXEuE,2560
24
+ cellfinder/core/classify/__pycache__/__init__.cpython-310.pyc,sha256=JHvb8x5ZMRoq0oj0p9eaaXNuqCkDBVrs94JNhaSngtI,171
25
+ cellfinder/core/classify/__pycache__/__init__.cpython-311.pyc,sha256=GrFrn55bHgRGDvoAciOBr_m1JJuguiX9YRVCfaV0lVU,187
26
+ cellfinder/core/classify/__pycache__/__init__.cpython-312.pyc,sha256=YUKT5bN3UPLPVTf6unqeHVY1ttFroOrjNkfBlm0qcCE,175
27
+ cellfinder/core/classify/__pycache__/augment.cpython-310.pyc,sha256=caxUbA_09VEreXpe4qL3uLZ72USV3zPZ9y0yxgdU-cs,4335
28
+ cellfinder/core/classify/__pycache__/augment.cpython-311.pyc,sha256=qAViOxezOUcVTlJPA0jkW5MUEOsVrmT3FLi6ASuOL8Q,7771
29
+ cellfinder/core/classify/__pycache__/augment.cpython-312.pyc,sha256=3MlXSNEzOqQehb6XVWAGAX0yPiSP8W6KgmULB-p9NO0,7149
30
+ cellfinder/core/classify/__pycache__/classify.cpython-310.pyc,sha256=RUrhL3PTIMVZyrpCSxqJM8TO4iMv2QA4yQrQHRFRMdg,3016
31
+ cellfinder/core/classify/__pycache__/classify.cpython-311.pyc,sha256=x3l7XdRHlr_YY98EWsYKjrJOtZvWfXwE9jOxIcWAeYk,4579
32
+ cellfinder/core/classify/__pycache__/classify.cpython-312.pyc,sha256=YZjtsbtNFHXKDA_YB0WWoC6kQtZbgULN7e3gt9qKVE8,4128
33
+ cellfinder/core/classify/__pycache__/cube_generator.cpython-310.pyc,sha256=lxCKS0RwNdYUpliIkDYrlLJzQ9Gf_XAuh0r57YpQ2Uw,14282
34
+ cellfinder/core/classify/__pycache__/cube_generator.cpython-311.pyc,sha256=g4YehoWroIBcRV1iuRFPGhMEXoZGZmo_HMkc1K_QYo0,24420
35
+ cellfinder/core/classify/__pycache__/cube_generator.cpython-312.pyc,sha256=6zKaVFei9skBRkcw8-Zi8vHdzNKrJuzsA5B3VnGSU6s,22810
36
+ cellfinder/core/classify/__pycache__/resnet.cpython-310.pyc,sha256=_ajjlvu0-j5Rt5DI4RoKACGKM_6aNJT_7Ps_H0so7CM,7352
37
+ cellfinder/core/classify/__pycache__/resnet.cpython-311.pyc,sha256=xWcW1TlWM-3mD_4pMLCAxozc_2-uzuetXVT2AoIl_Os,11288
38
+ cellfinder/core/classify/__pycache__/resnet.cpython-312.pyc,sha256=p9tshaLX2mMvKMuVhOjxUNNdasiY3NlrsvJVfPdOA-U,9766
39
+ cellfinder/core/classify/__pycache__/tools.cpython-310.pyc,sha256=57b0wDksoPPcGoFxgRTQPyHsQxWrFdWyETxCSOr-MXM,2364
40
+ cellfinder/core/classify/__pycache__/tools.cpython-311.pyc,sha256=A2CAIVzA0WnYNpnKQasVfyRyD32gS0dFNXvea241H2A,3544
41
+ cellfinder/core/classify/__pycache__/tools.cpython-312.pyc,sha256=bFn3WQ2ACxOetZiw3OBKoh08kGs35p7brEnpPlBSnmE,3259
42
+ cellfinder/core/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
+ cellfinder/core/config/cellfinder.conf,sha256=5i8axif7ekMutKDiVnZRs-LiJrgVQljg_beltidqtNk,56
44
+ cellfinder/core/config/cellfinder.conf.custom,sha256=x_AUt2qpLPxQlA9uWDwVs583CXIQz577VVQYbIXRwPo,107
45
+ cellfinder/core/detect/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
+ cellfinder/core/detect/detect.py,sha256=iEYaYuYCSR4VJXmlFbEE1ti9Pjpv6m4rSfFILSOYmhE,9592
47
+ cellfinder/core/detect/__pycache__/__init__.cpython-310.pyc,sha256=Fc2wzTmwgf315cDBh4gdra2fS6nBr97PGQpNZ3szWvA,169
48
+ cellfinder/core/detect/__pycache__/__init__.cpython-311.pyc,sha256=INH7F52Hn_GdvMvnPGMie0Oi4iplTtqL6lxUD-XHsFk,185
49
+ cellfinder/core/detect/__pycache__/__init__.cpython-312.pyc,sha256=BS4iPzdzb5BTIpBAnomQ-0MumYp3zH9I1W6KnQTPuyc,173
50
+ cellfinder/core/detect/__pycache__/detect.cpython-310.pyc,sha256=RRf4BpjgdXFXG1Ea6JckeUB4dRJjBN411jwOSaCvWxY,7846
51
+ cellfinder/core/detect/__pycache__/detect.cpython-311.pyc,sha256=NiWxtPzJvoVC3JhE1aHUc-XyTJzKdDXFxokUCTm5s_8,11736
52
+ cellfinder/core/detect/__pycache__/detect.cpython-312.pyc,sha256=_gmifKbu2BS6-miPQlA86hjlVKSId807uzfVbXnTjiw,10384
53
+ cellfinder/core/detect/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
+ cellfinder/core/detect/filters/setup_filters.py,sha256=sUyZ2dKbfwhn4YTq3kLVTHkckZZ460AVozLfoz7hJK8,2084
55
+ cellfinder/core/detect/filters/__pycache__/__init__.cpython-310.pyc,sha256=UWdEcuiRmNZfwhnexWHHosie_yab8CHSH-ha9HVoTew,177
56
+ cellfinder/core/detect/filters/__pycache__/__init__.cpython-311.pyc,sha256=ba8lTbVpLLyM7tITvwNtiWrTp69uOig7MUZaRVsIR4c,193
57
+ cellfinder/core/detect/filters/__pycache__/__init__.cpython-312.pyc,sha256=Ep4vBXdLXOT74sOIp8l1CpDllGEFsGKjbtuFjoT6O_M,181
58
+ cellfinder/core/detect/filters/__pycache__/setup_filters.cpython-310.pyc,sha256=fSQ8-zPDHv_AqDCaSueY2bR3XbGNO1ZDDEleSwWQdwU,2038
59
+ cellfinder/core/detect/filters/__pycache__/setup_filters.cpython-311.pyc,sha256=mVaL1NHqrF4LOdMBDND5JS3bqGBjhYnmLf3173k9npc,2707
60
+ cellfinder/core/detect/filters/__pycache__/setup_filters.cpython-312.pyc,sha256=ZnAht_Uhd4e_hcHHB8lgNlSgaguirBdEpRjPRzBx6Ts,2500
61
+ cellfinder/core/detect/filters/plane/__init__.py,sha256=lybcPbVDnurEQeq2FiLq0zR8p_ztarQOlajhdh1Q2-4,40
62
+ cellfinder/core/detect/filters/plane/classical_filter.py,sha256=Nton_nrvv6LhNlK10HnS0TIHsjapBiMJPURgzYh2myY,1331
63
+ cellfinder/core/detect/filters/plane/plane_filter.py,sha256=PWcAHDKB3qn3i9aSmQzUTEi3tgmccrf24DipjnYbOg0,2746
64
+ cellfinder/core/detect/filters/plane/tile_walker.py,sha256=lhKrq-MB35bR0_JYgj7WMR4otuaZ6XRDDhJhKyH1yS8,3001
65
+ cellfinder/core/detect/filters/plane/__pycache__/__init__.cpython-310.pyc,sha256=-saXzeC6GBjEeH2RLBduMKuz6UdoDzfKnYIe2_Sq3Jw,233
66
+ cellfinder/core/detect/filters/plane/__pycache__/__init__.cpython-311.pyc,sha256=2k5TNX7NQueHLMMVupZZ42M1MXZMlGwqpS2xjtxsAQg,263
67
+ cellfinder/core/detect/filters/plane/__pycache__/__init__.cpython-312.pyc,sha256=jrecDaZV1rkgKYqtlJgc8H_kWFP4-uvTGtgpc7EK4HA,240
68
+ cellfinder/core/detect/filters/plane/__pycache__/classical_filter.cpython-310.pyc,sha256=NOn9bkFL-BGPMjSZ4EuWK8qYfXml7dgsNIxX-3O0-Cc,1449
69
+ cellfinder/core/detect/filters/plane/__pycache__/classical_filter.cpython-311.pyc,sha256=f19zGweOTw6hPuVlLANdBecM47hrGjajhHrnJ4WiI-g,1942
70
+ cellfinder/core/detect/filters/plane/__pycache__/classical_filter.cpython-312.pyc,sha256=AI66cV1pNVPoMzX_4IGtr2BG7x10KJA7qpeuAflHgTc,1829
71
+ cellfinder/core/detect/filters/plane/__pycache__/plane_filter.cpython-310.pyc,sha256=Va2BbgjhL3nj6VxnwYP5JrdZaRpPy4DGNqImp9W6VdQ,2808
72
+ cellfinder/core/detect/filters/plane/__pycache__/plane_filter.cpython-311.pyc,sha256=iwkbeckAQshg6cKv9sxOS-e01UREr1EN_beIZwDv0Wo,3857
73
+ cellfinder/core/detect/filters/plane/__pycache__/plane_filter.cpython-312.pyc,sha256=PtHvjL9czIktnRxcLYXjIu_xK_f63PToIEFA1IrvEn4,3665
74
+ cellfinder/core/detect/filters/plane/__pycache__/tile_walker.cpython-310.pyc,sha256=x1pr1XaXjSPN2hZGOJty4DHuGrJW7USrLnV0EPkyErU,3082
75
+ cellfinder/core/detect/filters/plane/__pycache__/tile_walker.cpython-311.pyc,sha256=rJ9NeDe0VT7Pe78sAAS31nlkvege5dL9tFFMsHiU21U,4520
76
+ cellfinder/core/detect/filters/plane/__pycache__/tile_walker.cpython-312.pyc,sha256=zdODH_EmNOFT5eL1gpONI1ANsU3Q4_RwsobZ_vlk2Us,4496
77
+ cellfinder/core/detect/filters/volume/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
+ cellfinder/core/detect/filters/volume/ball_filter.py,sha256=ZEg8FNty-VD5N9j4FLZ18G-BuSvxjHs2-QTblwKcZgw,13894
79
+ cellfinder/core/detect/filters/volume/structure_detection.py,sha256=mTHi0_A9FCK39I6fZm2dfMpDxIkfaidOIf6eCjTw-70,11307
80
+ cellfinder/core/detect/filters/volume/structure_splitting.py,sha256=XzTYguVT8VdTu2h4-Jdt5Yyeu8VBYmdRo5jmwwLwuck,7660
81
+ cellfinder/core/detect/filters/volume/volume_filter.py,sha256=BJ8bStlNvMWsGlBekeqXpS8d9YKoLe3ifMfrEPpva2Q,7035
82
+ cellfinder/core/detect/filters/volume/__pycache__/__init__.cpython-310.pyc,sha256=m78ZmujdhwUYHU9N6WVFooBd2MplkS0GLkhg0mgUlJo,184
83
+ cellfinder/core/detect/filters/volume/__pycache__/__init__.cpython-311.pyc,sha256=kZleoguQB6nd32wP_J2djzEo17nd7N4txD5Oy9_G0K8,200
84
+ cellfinder/core/detect/filters/volume/__pycache__/__init__.cpython-312.pyc,sha256=zuphGWXFtJb8krkdYmEWps1OooEsaYdTutbVZc9lg5M,188
85
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-199.py310.1.nbc,sha256=0xUu3xCmchTlHuwyHViZWS1Q9Fke74cAnXPg1l7wd1w,31524
86
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-199.py310.nbi,sha256=Z71vu73I3URBSXNPnHwNjYpAr7isSvSNx8C7enA5Q5s,1478
87
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py310.1.nbc,sha256=E5RLp9BwZvKT7coaCTJ8kQX7U8d7YvNuzz-JoRf9O1Y,33890
88
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py310.2.nbc,sha256=B4Zufwxm6aGBw95v2ttuS89ZOvOvAoZQM_QHifG0-r8,34146
89
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py310.nbi,sha256=gkTzTUxJLo3xYDep2ZTABVwJA2RWz1Q14jV5bbzzcqs,2498
90
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py311.1.nbc,sha256=kI8BY8jAnxzzkLAtxXh1qbFNMGgTMTjEbpCKLR_OmA8,33846
91
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py311.2.nbc,sha256=_0-R9cOelyL9lqqGx8W3fHgoJbYJ6Z-YPE-w8qbUfbg,34102
92
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py311.nbi,sha256=OlVjWTPETVYN1DlUbGDQohVTJI_3DhdVE_Ckb9AEHxA,2498
93
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py312.1.nbc,sha256=87niOZnAPy4qlN2W5h3vBQkE865zFxUQTwEeTwn1NO4,33929
94
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py312.2.nbc,sha256=J-D23W8qXuuu7f5s4jsrG_oGGmscGJo0jl4SZuAWavM,34185
95
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter._cube_overlaps-263.py312.nbi,sha256=Px7rBZzJzJclXdpcPvCyvynOHaB6nI-eFGtG8Z24EJ0,2498
96
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter.cpython-310.pyc,sha256=KJ3GhJzhp-rnw09iEMONohbMYeJhrIZOmROeC-1Agig,9803
97
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter.cpython-311.pyc,sha256=qUO57zGeqa3-D0DkanAvkIxGCazsyuHZTMmJ3rDyFiA,15888
98
+ cellfinder/core/detect/filters/volume/__pycache__/ball_filter.cpython-312.pyc,sha256=NXKUZPJmgh8vEW_JSvHL2BZ0AEqdH3zCPZqY3ePcGrY,14649
99
+ cellfinder/core/detect/filters/volume/__pycache__/structure_detection.cpython-310.pyc,sha256=vv2nOeSF9dlzcsXToLG0i4ayRHl_nVfqzKHIlmqET7M,9893
100
+ cellfinder/core/detect/filters/volume/__pycache__/structure_detection.cpython-311.pyc,sha256=uuCZgxDv2cOeLEN4B7V46Bg8MQ4mzmo_iVUTeT3oVdI,15465
101
+ cellfinder/core/detect/filters/volume/__pycache__/structure_detection.cpython-312.pyc,sha256=oJyE2veVjJSZ-mzy6c3dPZ7M9YKUSHNZARoLDaxCMMA,14790
102
+ cellfinder/core/detect/filters/volume/__pycache__/structure_splitting.cpython-310.pyc,sha256=mCyHdfAB2QvRto8nYSLz_kQFYJDgOqhyzC0VC-dSnk4,6806
103
+ cellfinder/core/detect/filters/volume/__pycache__/structure_splitting.cpython-311.pyc,sha256=UCLra7wjWamYdIUmBwYq9AYeTAMtJUx-zW5k5Qsz9n4,11313
104
+ cellfinder/core/detect/filters/volume/__pycache__/structure_splitting.cpython-312.pyc,sha256=4us7ZvtSl0XNryhrUCVVxBzmMMntBYVvgztgI_kCiX8,10217
105
+ cellfinder/core/detect/filters/volume/__pycache__/volume_filter.cpython-310.pyc,sha256=VlI6R5rhmMcnecbT3yWFE_b-bHX0RKIOSxPNm-KzvvU,5437
106
+ cellfinder/core/detect/filters/volume/__pycache__/volume_filter.cpython-311.pyc,sha256=_ED9c0OoZez71DiBkVFujCaIGS1Ivq5-w79YhTs8yq4,10104
107
+ cellfinder/core/detect/filters/volume/__pycache__/volume_filter.cpython-312.pyc,sha256=tYVKY34JowwwQYEHAGHeBTsgSgdrLNyZLe4IRn2xQVw,9349
108
+ cellfinder/core/download/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
+ cellfinder/core/download/cli.py,sha256=X9L9ZIkWqs58hX8G8q_0AKN4gk8BhydGxI9nLpdHQQE,1764
110
+ cellfinder/core/download/download.py,sha256=YQP4NMM9Xt0rECRJEV5z6RCZNi5uCFhohFnDreH0qHA,3277
111
+ cellfinder/core/download/__pycache__/__init__.cpython-310.pyc,sha256=rEdD0Hq5bj9IH9455o3fnt6IYW4BBN-DhXSXppg5Xls,171
112
+ cellfinder/core/download/__pycache__/__init__.cpython-311.pyc,sha256=9ZEKLhqt6u1EAcAIvKnX4YnfDDXbB8dGPOvL-NZF7ig,187
113
+ cellfinder/core/download/__pycache__/__init__.cpython-312.pyc,sha256=rGJkdzaLGswdztZT25j60nZLjaJZfAfMJ8xJj5jd_PY,175
114
+ cellfinder/core/download/__pycache__/cli.cpython-310.pyc,sha256=YA8eu60BV8CSVXRF66oIXpy94YtPOrlPLGTUy8XRSUs,1857
115
+ cellfinder/core/download/__pycache__/cli.cpython-312.pyc,sha256=TF7-MOYdrV00iS3cmquotNxw6XXNhPOtcqRHimmjsyw,2316
116
+ cellfinder/core/download/__pycache__/download.cpython-310.pyc,sha256=Q2PeTD7PHK4ZqYS-iw9WSJtfit8-liv4ZYTUIqFlV_k,3264
117
+ cellfinder/core/download/__pycache__/download.cpython-311.pyc,sha256=SkNWM_FgWmRvd-kkKZR4UAqEJmTgHJaQ5uxI1G9rOzA,4608
118
+ cellfinder/core/download/__pycache__/download.cpython-312.pyc,sha256=_m_VX6s9xCevcZFhHC--4_eyXcYfAzkVBP0GNI5K4is,4057
119
+ cellfinder/core/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
+ cellfinder/core/tools/array_operations.py,sha256=LDbqWA_N2YtxeKS877QYdJRL2FCMC1R1ExJtdb6-vEA,3371
121
+ cellfinder/core/tools/geometry.py,sha256=xlEQQmVQ9jcXqRzUqU554P8VxkaWkc5J_YhjkkKlI0Q,1124
122
+ cellfinder/core/tools/image_processing.py,sha256=z27bGjf3Iv3G4Nt1OYzpEnIYQNc4nNomj_QitqvZB78,2269
123
+ cellfinder/core/tools/prep.py,sha256=YU4VDyjEsOXn3S3gymEfPUzka-WYiHmR4Q4XdRebhDI,2175
124
+ cellfinder/core/tools/source_files.py,sha256=vvwsIMe1ULKvXg_x22L75iqvCyMjEbUjJsDFQk3GYzY,856
125
+ cellfinder/core/tools/system.py,sha256=6iSOLrz2mtKgOIdwjp_VS0-74XQCuaQYCvWAViJgEus,2232
126
+ cellfinder/core/tools/tiff.py,sha256=NzIz6wq2GzxmcIhawFMwZADe-uQO2rIG46H7xkpGKLs,2899
127
+ cellfinder/core/tools/tools.py,sha256=G8oDGNRuWkzEJDnnC4r3SNGgpVbqbelCZR5ODk9JRzs,4867
128
+ cellfinder/core/tools/__pycache__/IO.cpython-310.pyc,sha256=OkxzRfVJeVMoJ5ciOL6wahHqygB7ecqKDP3YnQ0zBAM,2743
129
+ cellfinder/core/tools/__pycache__/__init__.cpython-310.pyc,sha256=5yo1eDRfIOCWnuM_pePoALW35iD8Umq2avuaV9xcqSE,168
130
+ cellfinder/core/tools/__pycache__/__init__.cpython-311.pyc,sha256=GbC2zQCWpvhtPdsLuMFZC4wWrw9waX1UM1y1nzfQdO8,184
131
+ cellfinder/core/tools/__pycache__/__init__.cpython-312.pyc,sha256=h7Np6PzLhJXd4hQEpl20o3MLmWeCgNS7ppZdrWvxmu4,172
132
+ cellfinder/core/tools/__pycache__/array_operations.cpython-310.pyc,sha256=ee8hHrSc2E4ThHKP_REGWxQRukInz8afbdjqXSJ1PfQ,3065
133
+ cellfinder/core/tools/__pycache__/array_operations.cpython-311.pyc,sha256=qB4lQtMsRySakT1Fi6Yap7UU_cxGLtSopcZlcjgD4Jg,4786
134
+ cellfinder/core/tools/__pycache__/array_operations.cpython-312.pyc,sha256=IosRGVyF7r-taLmSuxIPNnGc5L9uokfyQAYZfJewO3w,4433
135
+ cellfinder/core/tools/__pycache__/geometry.cpython-310.pyc,sha256=GYVLrxj1Y71-TWJOH7UkKyEdWLr1lVSnhKF0Npiz0dI,1325
136
+ cellfinder/core/tools/__pycache__/geometry.cpython-311.pyc,sha256=LMkxs-hNXdBloeUU4fwm6LP4sATHH3KA-LED5pUgYcA,1924
137
+ cellfinder/core/tools/__pycache__/geometry.cpython-312.pyc,sha256=Y9vshWlJsnv_SdpysUyqcZS31DflKIEBZfBTydjhx5c,1694
138
+ cellfinder/core/tools/__pycache__/image_processing.cpython-310.pyc,sha256=xzK-JnboQKSg9Gpbere2aM5AWXGPzSaO5fBb0JO6aK0,1869
139
+ cellfinder/core/tools/__pycache__/image_processing.cpython-312.pyc,sha256=bg-mwbQhQQURBy-ZAcLB3PuPVUTNWZZ29EgnDXzAZjg,2434
140
+ cellfinder/core/tools/__pycache__/prep.cpython-310.pyc,sha256=kpQAqj5HcT5wM3sYEQ7_DlVSH88f-XF9Mwv8y2DWF5o,1831
141
+ cellfinder/core/tools/__pycache__/prep.cpython-311.pyc,sha256=HJ-4e1OFogUbZWvz2JVmAE1aUWKgyP-OzSEpua9kTPk,2982
142
+ cellfinder/core/tools/__pycache__/prep.cpython-312.pyc,sha256=TsY3BiA1JIS4B2x2chVqHhGy_ZaQqUV180x--eIgzaU,2640
143
+ cellfinder/core/tools/__pycache__/source_files.cpython-310.pyc,sha256=FCsp5ccYrn2v6Fo4PtHu_TJhu3hx_Sl6KNY3PwCMCEo,1153
144
+ cellfinder/core/tools/__pycache__/source_files.cpython-311.pyc,sha256=zygqewoVCzXlGPJtSp-8GPn9skX5LoLcxFEb94KJE00,1338
145
+ cellfinder/core/tools/__pycache__/source_files.cpython-312.pyc,sha256=f6xOmBBH17PE321hYlTrpT4wBjbzsRu0_ZbAf0o9t3M,1282
146
+ cellfinder/core/tools/__pycache__/system.cpython-310.pyc,sha256=jJAm9DBIHM8LUZcdV4k3SFT3Rrg6HRaLhl5r7zpt9Lc,2738
147
+ cellfinder/core/tools/__pycache__/system.cpython-312.pyc,sha256=HSNF9iawS1qljw_Nr5Gxu2SFRwfBINAWMTvKJVB2ZWU,3303
148
+ cellfinder/core/tools/__pycache__/tf.cpython-310.pyc,sha256=mkGFwUTz4etlvtYk748kqgKOnz1eAm-FPDHa9cyyxsk,1590
149
+ cellfinder/core/tools/__pycache__/tiff.cpython-310.pyc,sha256=J331iJkPenlMS2gsHOBx3nVARD5TCi11MIMwwtagHl4,4167
150
+ cellfinder/core/tools/__pycache__/tiff.cpython-312.pyc,sha256=G4rMtWPjHhDF8pf2O4ZV8we8YBaP--4R2fsqRTcQAOg,4889
151
+ cellfinder/core/tools/__pycache__/tools.cpython-310.pyc,sha256=a_-U-vqjZedj5WrllKdvgUoDKLZhOD5KQmw4Q0Be7qQ,5418
152
+ cellfinder/core/tools/__pycache__/tools.cpython-311.pyc,sha256=prnmcrSmosJM2PTqGK6p0DScpwcwH_CTQzTfue4A2n4,7524
153
+ cellfinder/core/tools/__pycache__/tools.cpython-312.pyc,sha256=P4ORpu0fIdgw3ZvZlM8eVbXmct_NFFAw6dVWsoD7EN4,6614
154
+ cellfinder/core/train/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
+ cellfinder/core/train/train_yml.py,sha256=9QXv2wk24G8hYskMnBij7OngEELUWySK2fH4NFbYWw4,13260
156
+ cellfinder/core/train/__pycache__/__init__.cpython-310.pyc,sha256=NeRYBhVG-cdUFYv51CCxXZb8HdfTRX8arjsMrrn-P4Q,168
157
+ cellfinder/core/train/__pycache__/__init__.cpython-311.pyc,sha256=RhoSnMhtr7cbFvs5cykiH416ndw4pybU85_XyGt6Mvc,184
158
+ cellfinder/core/train/__pycache__/__init__.cpython-312.pyc,sha256=LyXrb0XF_JVeT4jPsGlsjAyLjKP8GxbmvezVC2b7wKY,172
159
+ cellfinder/core/train/__pycache__/train_yml.cpython-310.pyc,sha256=1dGO7jl6WFl51aZ1LmAseeX4zJ3klZWLpUQiE3ytFs0,9635
160
+ cellfinder/core/train/__pycache__/train_yml.cpython-311.pyc,sha256=49hFZE-mjMQ0gnrQseQTaqYIH2ezBjOM8OKA8BxMGoA,15619
161
+ cellfinder/core/train/__pycache__/train_yml.cpython-312.pyc,sha256=r6pAZ1jlWcsJvnwDOOLRokLbYLuTPj49DI2NXmKgyDM,13611
162
+ cellfinder/napari/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
163
+ cellfinder/napari/curation.py,sha256=jz7GekuuzOdwiEFLarvvO5Bho68k8eL7AjObMdEoPXw,21447
164
+ cellfinder/napari/input_container.py,sha256=tkm0dkPt7kSL8Xkvs1fh8M6vKWw57QLIt_wv74HFkGk,2150
165
+ cellfinder/napari/napari.yaml,sha256=WMR1CIAmYIVyQngbdbomTRZLvlDbb6LxsXsvTRClQnE,921
166
+ cellfinder/napari/sample_data.py,sha256=oUST23q09MM8dxHbUCmO0AjtXG6OlR_32LLqP0EU2UA,732
167
+ cellfinder/napari/utils.py,sha256=AwTs76M9azutHhHj2yuaKErDEQ5F6pFbIIakBfzen6M,3824
168
+ cellfinder/napari/__pycache__/__init__.cpython-310.pyc,sha256=Z0fSSfEHbZExG5mkv6SB3EGCy0fqe1ql1T1yZrLnTrc,164
169
+ cellfinder/napari/__pycache__/__init__.cpython-311.pyc,sha256=faHrTeBwnUm0wlEyEH88aT6oybT-2bf_dKfL2M0AdKM,180
170
+ cellfinder/napari/__pycache__/__init__.cpython-312.pyc,sha256=D9guOOmigiCTfUO4wWADX9jL3LlXuJ8m3P33U7WKIwc,168
171
+ cellfinder/napari/__pycache__/curation.cpython-310.pyc,sha256=JQS74BVhQnxV4mGtlWbKNBeqkVY_tPPf5RHvUQfBPF4,16221
172
+ cellfinder/napari/__pycache__/curation.cpython-312.pyc,sha256=weucKSZjvKOVnkNcnKIKjbyK5XkoNx6FXcIARUpU7vU,26918
173
+ cellfinder/napari/__pycache__/input_container.cpython-310.pyc,sha256=Yby5iMGcT4kkDkfIT_1Z8umSML_cgnMbVnkQxkcOgT4,2378
174
+ cellfinder/napari/__pycache__/input_container.cpython-311.pyc,sha256=mafmnKxjopUWVagoHmhouWqV_3E8c4Df90hCV7rWvig,3071
175
+ cellfinder/napari/__pycache__/input_container.cpython-312.pyc,sha256=zhT9fZWEXXoa3YCJVneHnobSuLspEI24uNZDYe_IOIY,2769
176
+ cellfinder/napari/__pycache__/sample_data.cpython-310.pyc,sha256=bOoU9wh3VxqHBEoMFioMUdzRYpivIyrHfEClZrVTCKw,960
177
+ cellfinder/napari/__pycache__/sample_data.cpython-312.pyc,sha256=uSTUZJUuHbWjt6sGlVTkiQ37HsFWmvnVoHDqpaZq3Mk,1373
178
+ cellfinder/napari/__pycache__/utils.cpython-310.pyc,sha256=i4BAFnriPh43mqmmDHTlqGjwpVhVOdRl-69gC7DTLgg,3817
179
+ cellfinder/napari/__pycache__/utils.cpython-311.pyc,sha256=FBNklkZ8KNoz6ILoNfgoRektG_3A9v1lFOu6xqTCDSw,5550
180
+ cellfinder/napari/__pycache__/utils.cpython-312.pyc,sha256=RfHisx-rngB1hJMt0KyA-wFOAgzA4pjrEhwaccd8ItY,4934
181
+ cellfinder/napari/detect/__init__.py,sha256=BD9Bg9NTAr6yRTq2A_p58U6j4w5wbY0sdXwhPJ3MSMY,34
182
+ cellfinder/napari/detect/detect.py,sha256=gX10U4HHcni1ff3zYXkXYX6dWMZErYpvzVde56yV80w,13658
183
+ cellfinder/napari/detect/detect_containers.py,sha256=Xx-E2JTbe5Ih_1m5ZhQ0pCYFxfdQxVJMMfGh9EZExms,5377
184
+ cellfinder/napari/detect/thread_worker.py,sha256=3xGUPSthycpErcVxl_yc5soIv_z0Hf0iEaZq0Yx90OM,3078
185
+ cellfinder/napari/detect/__pycache__/__init__.cpython-310.pyc,sha256=SecFu5NJydCtq4dCFPZ4sAK3Hj69dDjIR0z6U24Z8jE,215
186
+ cellfinder/napari/detect/__pycache__/__init__.cpython-311.pyc,sha256=YmxGJlu0ybrDo5nYVDvGkTiDivTPysRsu5ITNwIgG3c,245
187
+ cellfinder/napari/detect/__pycache__/__init__.cpython-312.pyc,sha256=soemsP58Citr1lCFUQPxxCm9eMbmJ3I3g0p41efFV18,222
188
+ cellfinder/napari/detect/__pycache__/detect.cpython-310.pyc,sha256=dYt4xnO2jbfPBwY32Y3Voi3_3lkn4trckRqxwGedL3s,10018
189
+ cellfinder/napari/detect/__pycache__/detect.cpython-311.pyc,sha256=udrDP7z7yLfPuMN7A-zVH1blRRowSFlaS2y7gp_JhO0,14902
190
+ cellfinder/napari/detect/__pycache__/detect.cpython-312.pyc,sha256=2BnzdXTwQN0e2ZstgYKspJsnDh4vL84LyQ8A7eC4ABg,13667
191
+ cellfinder/napari/detect/__pycache__/detect_containers.cpython-310.pyc,sha256=W1X2JggJomSOxYoIaof-4g0vp5UVwFV6vvSy7SVR-JM,5225
192
+ cellfinder/napari/detect/__pycache__/detect_containers.cpython-311.pyc,sha256=2BjShnk8eP-stfcOes1yEUR89icFHBhZXW-tF-5mfv0,8717
193
+ cellfinder/napari/detect/__pycache__/detect_containers.cpython-312.pyc,sha256=IDe_AoCb64AkpEfUXTYLGnLfg1deE0brgv0WhiX6atI,7387
194
+ cellfinder/napari/detect/__pycache__/thread_worker.cpython-310.pyc,sha256=wCymiasW8CEDx0dzIcs309uj1JkmLD2ZAQDTg0eauKA,3305
195
+ cellfinder/napari/detect/__pycache__/thread_worker.cpython-311.pyc,sha256=zhcVEsk4y00v5dm6S-0zLogpe_ZVdiCBCm8wen76Zyg,5136
196
+ cellfinder/napari/detect/__pycache__/thread_worker.cpython-312.pyc,sha256=cqtSdbeuExQii3zi7GIJW3e0shz0L4fRBwI1MXR37zs,4576
197
+ cellfinder/napari/train/__init__.py,sha256=xo4CK-DvSecInGEc2ohcTgQYlH3iylFnGvKTCoq2WkI,35
198
+ cellfinder/napari/train/train.py,sha256=zJY7zKcLqDTDtD76thmbwViEU4tTFCmXZze-zHsTpoo,5941
199
+ cellfinder/napari/train/train_containers.py,sha256=1wZ_GPe7B5XsLYs5XIx4m8GMw5KeVhg6SchhPtXu4V8,4386
200
+ cellfinder/napari/train/__pycache__/__init__.cpython-310.pyc,sha256=QtHkDbUeUxkgd9NqNikyNUOtXZfmAP6HOMzPh7XTPhA,215
201
+ cellfinder/napari/train/__pycache__/__init__.cpython-312.pyc,sha256=lxULMSL81AYWCwRwaozc8jeGVktxDr3C1emPsBBkFZI,222
202
+ cellfinder/napari/train/__pycache__/train.cpython-310.pyc,sha256=CzghuE4CEKhNzGH6z_tOjzTNKthgCFRPn1LtIAPCEYU,5073
203
+ cellfinder/napari/train/__pycache__/train.cpython-312.pyc,sha256=ueupnNF56gNH-OIEbSMsnkfkAWBfsrJtlQHOBRylFHw,7017
204
+ cellfinder/napari/train/__pycache__/train_containers.cpython-310.pyc,sha256=9s56UvttVjmCCDvoGZqtUUV_hjSmUDv3a3-5cFal_Lw,4609
205
+ cellfinder/napari/train/__pycache__/train_containers.cpython-312.pyc,sha256=k4s3VHLJ-fKtS4dsk5Z7N_P_9ZqNjR7Uc0CglFFSrNc,6891
206
+ cellfinder-1.3.0rc0.dist-info/LICENSE,sha256=Tw8iMytIDXLSmcIUsbQmRWojstl9yOWsPCx6ZT6dZLY,1564
207
+ cellfinder-1.3.0rc0.dist-info/METADATA,sha256=5AVyZiHS9d-FU-goBD1HCkk_iR3E4s4cXGFBQEcmfBs,6480
208
+ cellfinder-1.3.0rc0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
209
+ cellfinder-1.3.0rc0.dist-info/entry_points.txt,sha256=cKKjU8GPiN-TRelG2sT2JCKAcB9XDCjP6g9atE9pSoY,247
210
+ cellfinder-1.3.0rc0.dist-info/top_level.txt,sha256=jyTQzX-tDjbsMr6s-E71Oy0IKQzmHTXSk4ZhpG5EDSE,11
211
+ cellfinder-1.3.0rc0.dist-info/RECORD,,
@@ -1,49 +0,0 @@
1
- import os
2
- from pathlib import Path
3
- from typing import Literal
4
-
5
- from cellfinder.core import logger
6
- from cellfinder.core.download.download import download
7
-
8
- model_weight_urls = {
9
- "resnet50_tv": "https://gin.g-node.org/cellfinder/models/raw/"
10
- "master/resnet50_tv.h5",
11
- "resnet50_all": "https://gin.g-node.org/cellfinder/models/raw/"
12
- "master/resnet50_weights.h5",
13
- }
14
-
15
- download_requirements_gb = {
16
- "resnet50_tv": 0.18,
17
- "resnet50_all": 0.18,
18
- }
19
-
20
- model_type = Literal["resnet50_tv", "resnet50_all"]
21
-
22
-
23
- def main(model_name: model_type, download_path: os.PathLike) -> Path:
24
- """
25
- For a given model name and download path, download the model file
26
- and return the path to the downloaded file.
27
- """
28
- download_path = Path(download_path)
29
-
30
- model_weight_dir = download_path / "model_weights"
31
- model_path = model_weight_dir / f"{model_name}.h5"
32
- if not model_path.exists():
33
- model_weight_dir.mkdir(parents=True)
34
-
35
- logger.info(
36
- f"Downloading '{model_name}' model. This may take a little while."
37
- )
38
-
39
- download(
40
- model_path,
41
- model_weight_urls[model_name],
42
- model_name,
43
- download_requires=download_requirements_gb[model_name],
44
- )
45
-
46
- else:
47
- logger.info(f"Model already exists at {model_path}. Skipping download")
48
-
49
- return model_path
@@ -1,48 +0,0 @@
1
- import glob
2
- import os
3
- from typing import Tuple
4
-
5
- import numpy as np
6
- from brainglobe_utils.general.system import get_sorted_file_paths
7
- from dask import array as da
8
- from dask import delayed
9
- from tifffile import TiffFile, imread
10
-
11
-
12
- def get_tiff_meta(
13
- path: str,
14
- ) -> Tuple[Tuple[int, int], np.dtype]:
15
- with TiffFile(path) as tfile:
16
- nz = len(tfile.pages)
17
- if not nz:
18
- raise ValueError(f"tiff file {path} has no pages!")
19
- first_page = tfile.pages[0]
20
-
21
- return tfile.pages[0].shape, first_page.dtype
22
-
23
-
24
- lazy_imread = delayed(imread) # lazy reader
25
-
26
-
27
- def read_with_dask(path):
28
- """
29
- Based on https://github.com/tlambert03/napari-ndtiffs
30
- :param path:
31
- :return:
32
- """
33
-
34
- if path.endswith(".txt"):
35
- with open(path, "r") as f:
36
- filenames = [line.rstrip() for line in f.readlines()]
37
-
38
- else:
39
- filenames = glob.glob(os.path.join(path, "*.tif"))
40
-
41
- shape, dtype = get_tiff_meta(filenames[0])
42
- lazy_arrays = [lazy_imread(fn) for fn in get_sorted_file_paths(filenames)]
43
- dask_arrays = [
44
- da.from_delayed(delayed_reader, shape=shape, dtype=dtype)
45
- for delayed_reader in lazy_arrays
46
- ]
47
- stack = da.stack(dask_arrays, axis=0)
48
- return stack
@@ -1,46 +0,0 @@
1
- import tensorflow as tf
2
-
3
- from cellfinder.core import logger
4
-
5
-
6
- def allow_gpu_memory_growth():
7
- """
8
- If a gpu is present, prevent tensorflow from using all the memory straight
9
- away. Allows multiple processes to use the GPU (and avoid occasional
10
- errors on some systems) at the cost of a slight performance penalty.
11
- """
12
- gpus = tf.config.experimental.list_physical_devices("GPU")
13
- if gpus:
14
- logger.debug("Allowing GPU memory growth")
15
- try:
16
- # Currently, memory growth needs to be the same across GPUs
17
- for gpu in gpus:
18
- tf.config.experimental.set_memory_growth(gpu, True)
19
- logical_gpus = tf.config.experimental.list_logical_devices("GPU")
20
- logger.debug(
21
- f"{len(gpus)} physical GPUs, {len(logical_gpus)} logical GPUs"
22
- )
23
- except RuntimeError as e:
24
- # Memory growth must be set before GPUs have been initialized
25
- print(e)
26
- else:
27
- logger.debug("No GPUs found, using CPU.")
28
-
29
-
30
- def set_tf_threads(max_threads):
31
- """
32
- Limit the number of threads that tensorflow uses
33
- :param max_threads: Maximum number of threads to use
34
- :return:
35
- """
36
- logger.debug(
37
- f"Setting maximum number of threads for tensorflow "
38
- f"to: {max_threads}"
39
- )
40
-
41
- # If statements are for testing. If tf is initialised, then setting these
42
- # parameters throws an error
43
- if tf.config.threading.get_inter_op_parallelism_threads() != 0:
44
- tf.config.threading.set_inter_op_parallelism_threads(max_threads)
45
- if tf.config.threading.get_intra_op_parallelism_threads() != 0:
46
- tf.config.threading.set_intra_op_parallelism_threads(max_threads)
Binary file