Skip to content

Commit 2143be7

Browse files
committed
refactor: expose stats and metric in analysis module.
1 parent 69358ac commit 2143be7

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
3+
from .stats import contrast_zscore, get_scores, bacc, mcc
4+
from .metrics import get_snr, get_snr_console_db, get_tsnr
5+
6+
7+
__all__ = [
8+
"contrast_zscore",
9+
"get_scores",
10+
"bacc",
11+
"mcc",
12+
"get_snr",
13+
"get_snr_console_db",
14+
"get_tsnr",
15+
]

src/snake/toolkit/analysis/stats.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,6 @@ def contrast_zscore(
5858
return z_image
5959

6060

61-
def get_thresh_map(
62-
z_image: np.ndarray,
63-
alpha: float | list[float],
64-
height_control: HeightControl = "fpr",
65-
) -> dict[float, np.ndarray]:
66-
"""Get thresholded map."""
67-
thresh_dict = {}
68-
if not isinstance(alpha, list):
69-
alphas = [alpha]
70-
else:
71-
alphas = alpha
72-
for a in alphas:
73-
if height_control == "fpr":
74-
z_thresh = norm.isf(a)
75-
elif height_control == "fdr":
76-
z_thresh = fdr_threshold(z_image, a)
77-
78-
above_thresh = z_image > z_thresh
79-
thresh_dict[a] = above_thresh
80-
if len(alphas) == 1:
81-
return thresh_dict[alphas[0]]
82-
return thresh_dict
83-
84-
8561
def get_scores(
8662
contrast: np.ndarray, roi_mask: np.ndarray, roi_threshold: float
8763
) -> dict[str, float]:

0 commit comments

Comments
 (0)