You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: myoquant/__main__.py
+77-7Lines changed: 77 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ def sdh_analysis(
30
30
),
31
31
mask_path: Path=typer.Option(
32
32
None,
33
-
help="The path to a binary mask to hide slide region during analysis.",
33
+
help="The path to a binary mask to hide slide region during analysis. It needs to be of the same resolution as input image and only pixel marked as 1 will be analyzed.",
34
34
exists=True,
35
35
file_okay=True,
36
36
dir_okay=False,
@@ -134,6 +134,25 @@ def sdh_analysis(
134
134
135
135
image_ndarray_sdh=imread(image_path)
136
136
console.print("Image loaded.", style="blue")
137
+
138
+
ifmask_pathisnotNone:
139
+
console.print(f"Reading binary mask: {mask_path} and masking...", style="blue")
140
+
mask_ndarray=imread(mask_path)
141
+
ifnp.unique(mask_ndarray).shape[0] !=2:
142
+
console.print(
143
+
"The mask image should be a binary image with only 2 values (0 and 1).",
help="The HE image file path to analyse. If using single channel images, this will be used as cytoplasm image to run CellPose. Please use the --fluo-nuc option to indicate the path to the nuclei single image to run Stardist.",
201
225
exists=True,
202
226
file_okay=True,
203
227
dir_okay=False,
@@ -207,7 +231,7 @@ def he_analysis(
207
231
),
208
232
mask_path: Path=typer.Option(
209
233
None,
210
-
help="The path to a binary mask to hide slide region during analysis.",
234
+
help="The path to a binary mask to hide slide region during analysis. It needs to be of the same resolution as input image and only pixel marked as 1 will be analyzed.",
211
235
exists=True,
212
236
file_okay=True,
213
237
dir_okay=False,
@@ -262,6 +286,16 @@ def he_analysis(
262
286
export_stats: bool=typer.Option(
263
287
True, help="Export per fiber and per nuclei stat table."
264
288
),
289
+
fluo_nuc: Path=typer.Option(
290
+
None,
291
+
help="The path to single channel fluo image for nuclei.",
292
+
exists=True,
293
+
file_okay=True,
294
+
dir_okay=False,
295
+
writable=False,
296
+
readable=True,
297
+
resolve_path=True,
298
+
),
265
299
):
266
300
"""Run the HE analysis and quantification on the image."""
267
301
from .common_funcimport (
@@ -309,14 +343,39 @@ def he_analysis(
309
343
"No Stardist mask provided, will run Stardist during the analysis.",
310
344
style="blue",
311
345
)
312
-
model_stardist=load_stardist()
346
+
iffluo_nucisNone:
347
+
model_stardist=load_stardist(fluo=False)
348
+
else:
349
+
model_stardist=load_stardist(fluo=True)
313
350
console.print("Stardist Model loaded !", style="blue")
0 commit comments