Skip to content

Commit d3b59cd

Browse files
committed
JSON for block extraction, small fixes
1 parent 48d5df3 commit d3b59cd

File tree

8 files changed

+101
-37
lines changed

8 files changed

+101
-37
lines changed

flamingo_tools/segmentation/sgn_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def sgn_detection(
149149
detection_path = os.path.join(output_folder, "SGN_detection.tsv")
150150
input_ = zarr.open(output_path, "r")[prediction_key]
151151
if not os.path.exists(detection_path):
152-
block_shape = (128, 128, 128) # bigger block to avoid edge effects
152+
block_shape = (12, 128, 128) # bigger block to avoid edge effects
153153
detections_maxima = find_local_maxima(
154154
input_, block_shape=block_shape, min_distance=min_distance, threshold_abs=threshold_abs,
155155
verbose=True, n_threads=16,

flamingo_tools/segmentation/unet_prediction.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ def find_mask(
230230
upper_percentile = 99
231231
min_intensity = 150
232232
print(f"Calculating mask for segmentation class {seg_class}.")
233+
elif seg_class == "ihc_low":
234+
upper_percentile = 99.5
235+
min_intensity = 100
236+
print(f"Calculating mask for segmentation class {seg_class}.")
233237
else:
234238
upper_percentile = 95
235239
min_intensity = 200
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"cochlea": "LaVision-Mar05",
4+
"image_channel": [
5+
"MYO",
6+
"PV",
7+
"IHC_LOWRES-v3"
8+
],
9+
"resolution" : [
10+
1.887779,
11+
1.887779,
12+
3.0
13+
],
14+
"halo_size": [
15+
128,
16+
128,
17+
32
18+
],
19+
"crop_centers": [
20+
[
21+
3077,
22+
3000,
23+
960
24+
],
25+
[
26+
2816,
27+
3170,
28+
320
29+
],
30+
[
31+
2410,
32+
3080,
33+
250
34+
]
35+
]
36+
}
37+
]

reproducibility/block_extraction/SGNsub_MLR184L.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,34 @@
1919
],
2020
"crop_centers": [
2121
[
22-
864,
23-
1058,
22+
887,
23+
1057,
2424
580
2525
],
2626
[
27-
911,
28-
764,
29-
605
27+
887,
28+
735,
29+
592
3030
],
3131
[
32-
586,
33-
724,
34-
542
32+
538,
33+
766,
34+
558
3535
],
3636
[
37-
519,
38-
900,
39-
786
37+
525,
38+
869,
39+
873
4040
],
4141
[
42-
648,
43-
696,
44-
999
42+
695,
43+
582,
44+
1010
4545
],
4646
[
47-
716,
48-
357,
49-
975
47+
615,
48+
231,
49+
950
5050
]
5151
]
5252
}

reproducibility/block_extraction/SGNsub_MLR99L.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"cochlea": "M_LR_000214_L",
3+
"cochlea": "M_LR_000099_L",
44
"image_channel": [
55
"PV",
66
"Calb1",
@@ -20,34 +20,34 @@
2020
],
2121
"crop_centers": [
2222
[
23-
617,
24-
914,
25-
690
23+
979,
24+
1250,
25+
1060
2626
],
2727
[
28-
614,
29-
709,
30-
477
28+
1230,
29+
1066,
30+
1037
3131
],
3232
[
33-
311,
34-
747,
35-
472
33+
1057,
34+
819,
35+
1039
3636
],
3737
[
38-
283,
39-
634,
40-
772
38+
951,
39+
839,
40+
722
4141
],
4242
[
43-
424,
44-
332,
45-
780
43+
1260,
44+
859,
45+
551
4646
],
4747
[
48-
383,
49-
69,
50-
571
48+
1542,
49+
647,
50+
540
5151
]
5252
]
5353
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"cochlea": "M_LR_000184_L",
4+
"component_list": [
5+
1
6+
],
7+
"segmentation_channel": "SGN_v2",
8+
"type": "sgn"
9+
}
10+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"cochlea": "M_LR_000184_R",
4+
"component_list": [
5+
1
6+
],
7+
"segmentation_channel": "SGN_v2",
8+
"type": "sgn"
9+
}
10+
]

scripts/export_lower_resolution.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ def export_lower_resolution(args):
165165
if "PV" in channel:
166166
max_intensity = 1400
167167
data[data > max_intensity] = 0
168+
if "CTBP2" in channel:
169+
max_intensity = 1400
170+
data[data > max_intensity] = 300
168171

169172
if args.binarize:
170173
data = (data > 0).astype("uint16")

0 commit comments

Comments
 (0)