Skip to content

Commit 5430b6e

Browse files
authored
Merge pull request #68 from computational-cell-analytics/update_measure_synapses
The script `measure_synapses.py` has been updated and is functional. Other minor fixes have been performed which can be ordered in a later commit.
2 parents 13fe35a + 17a6778 commit 5430b6e

File tree

13 files changed

+426
-13
lines changed

13 files changed

+426
-13
lines changed

flamingo_tools/segmentation/synapse_detection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,18 @@ def marker_detection(
175175
if os.path.exists(output_path) and prediction_key in zarr.open(output_path, "r"):
176176
skip_prediction = True
177177

178+
# skip prediction if post-processed output exists
179+
detection_path = os.path.join(output_folder, "synapse_detection.tsv")
180+
if os.path.exists(detection_path):
181+
skip_prediction = True
182+
178183
if not skip_prediction:
179184
prediction_impl(
180185
input_path, input_key, output_folder, model_path,
181186
scale=None, block_shape=block_shape, halo=halo,
182187
apply_postprocessing=False, output_channels=1,
183188
)
184189

185-
detection_path = os.path.join(output_folder, "synapse_detection.tsv")
186190
if not os.path.exists(detection_path):
187191
input_ = zarr.open(output_path, "r")[prediction_key]
188192
detections = find_local_maxima(
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[
2+
{
3+
"cochlea": "G_EK_000233_L",
4+
"image_channel": [
5+
"Vglut3",
6+
"IHC_v6"
7+
],
8+
"halo_size": [
9+
196,
10+
196,
11+
80
12+
],
13+
"crop_centers": [
14+
[
15+
593,
16+
1018,
17+
276
18+
],
19+
[
20+
674,
21+
1048,
22+
1574
23+
],
24+
[
25+
788,
26+
937,
27+
255
28+
],
29+
[
30+
950,
31+
1450,
32+
380
33+
],
34+
[
35+
1120,
36+
875,
37+
360
38+
]
39+
]
40+
}
41+
]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[
2+
{
3+
"cochlea": "G_LR_000233_R",
4+
"image_channel": [
5+
"PV"
6+
],
7+
"halo_size": [
8+
196,
9+
196,
10+
196
11+
],
12+
"crop_centers": [
13+
[
14+
620,
15+
1060,
16+
1050
17+
],
18+
[
19+
1555,
20+
1170,
21+
1230
22+
],
23+
[
24+
1600,
25+
1075,
26+
1090
27+
],
28+
[
29+
1390,
30+
1430,
31+
1375
32+
],
33+
[
34+
650,
35+
1130,
36+
1000
37+
],
38+
[
39+
800,
40+
1230,
41+
710
42+
],
43+
[
44+
600,
45+
1100,
46+
1055
47+
]
48+
]
49+
}
50+
]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[
2+
{
3+
"cochlea": "G_LR_000233_R",
4+
"image_channel": [
5+
"PV",
6+
"SGN_v2-DA"
7+
],
8+
"halo_size": [
9+
196,
10+
196,
11+
48
12+
],
13+
"crop_centers": [
14+
[
15+
1584,
16+
1570,
17+
958
18+
],
19+
[
20+
1474,
21+
1655,
22+
730
23+
],
24+
[
25+
1275,
26+
1604,
27+
1324
28+
],
29+
[
30+
1603,
31+
1240,
32+
1279
33+
]
34+
]
35+
}
36+
]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
"cochlea": "LaVision-M04",
4+
"image_channel": [
5+
"PV"
6+
],
7+
"resolution" : [
8+
1.887779,
9+
1.887779,
10+
3.0
11+
],
12+
"halo_size": [
13+
128,
14+
128,
15+
64
16+
],
17+
"crop_centers": [
18+
[
19+
2550,
20+
2340,
21+
440
22+
]
23+
]
24+
}
25+
]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[
2+
{
3+
"cochlea": "LaVision-M04",
4+
"image_channel": [
5+
"MYO",
6+
"IHC_LOWRES-v1"
7+
],
8+
"resolution" : [
9+
1.887779,
10+
1.887779,
11+
3.0
12+
],
13+
"halo_size": [
14+
128,
15+
128,
16+
32
17+
],
18+
"crop_centers": [
19+
[
20+
3118,
21+
2840,
22+
500
23+
],
24+
[
25+
1540,
26+
2075,
27+
924
28+
],
29+
[
30+
2135,
31+
835,
32+
627
33+
],
34+
[
35+
2025,
36+
1332,
37+
221
38+
]
39+
]
40+
}
41+
]
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[
2+
{
3+
"cochlea": "LaVision-OTOF23R",
4+
"image_channel": [
5+
"CR",
6+
"IHC_LOWRES-v2"
7+
],
8+
"resolution" : [
9+
1.887779,
10+
1.887779,
11+
3.0
12+
],
13+
"halo_size": [
14+
128,
15+
128,
16+
48
17+
],
18+
"crop_centers": [
19+
[
20+
1360,
21+
3450,
22+
732
23+
],
24+
[
25+
2408,
26+
913,
27+
688
28+
],
29+
[
30+
2700,
31+
3220,
32+
620
33+
]
34+
]
35+
},
36+
{
37+
"cochlea": "LaVision-OTOF25R",
38+
"image_channel": [
39+
"CR",
40+
"IHC_LOWRES-v2"
41+
],
42+
"resolution" : [
43+
1.887779,
44+
1.887779,
45+
3.0
46+
],
47+
"halo_size": [
48+
128,
49+
128,
50+
48
51+
],
52+
"crop_centers": [
53+
[
54+
2490,
55+
3460,
56+
875
57+
]
58+
]
59+
},
60+
{
61+
"cochlea": "LaVision-OTOF36R",
62+
"image_channel": [
63+
"CR",
64+
"IHC_LOWRES-v2"
65+
],
66+
"resolution" : [
67+
1.887779,
68+
1.887779,
69+
3.0
70+
],
71+
"halo_size": [
72+
128,
73+
128,
74+
48
75+
],
76+
"crop_centers": [
77+
[
78+
2558,
79+
3415,
80+
871
81+
]
82+
]
83+
}
84+
]
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[
2+
{
3+
"cochlea": "LaVision-M04",
4+
"image_channel": [
5+
"PV"
6+
],
7+
"resolution" : [
8+
1.887779,
9+
1.887779,
10+
3.0
11+
],
12+
"halo_size": [
13+
128,
14+
128,
15+
64
16+
],
17+
"crop_centers": [
18+
[
19+
396,
20+
1906,
21+
383
22+
],
23+
[
24+
830,
25+
3390,
26+
670
27+
],
28+
[
29+
3520,
30+
1525,
31+
310
32+
],
33+
[
34+
1867,
35+
2538,
36+
390
37+
],
38+
[
39+
400,
40+
2500,
41+
840
42+
]
43+
]
44+
},
45+
{
46+
"cochlea": "LaVision-Mar05",
47+
"image_channel": [
48+
"PV"
49+
],
50+
"resolution" : [
51+
1.887779,
52+
1.887779,
53+
3.0
54+
],
55+
"halo_size": [
56+
128,
57+
128,
58+
64
59+
],
60+
"crop_centers": [
61+
[
62+
2247,
63+
2434,
64+
1660
65+
],
66+
[
67+
1182,
68+
2920,
69+
726
70+
],
71+
[
72+
2530,
73+
1660,
74+
1840
75+
],
76+
[
77+
620,
78+
1900,
79+
1825
80+
],
81+
[
82+
1330,
83+
3375,
84+
1114
85+
],
86+
[
87+
3442,
88+
2950,
89+
1000
90+
]
91+
]
92+
}
93+
]

0 commit comments

Comments
 (0)