Skip to content

Commit b289da8

Browse files
Update annotation script
1 parent d03a8db commit b289da8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

scripts/intensity_annotation/gfp_annotation.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def _extend_sgns_complex(gfp, sgns):
9595

9696

9797
# Just dilate by 3 pixels.
98-
def _extend_sgns_simple(gfp, sgns, dilation=3):
98+
def _extend_sgns_simple(gfp, sgns, dilation):
9999
block_shape = (128,) * 3
100100
halo = (dilation + 2,) * 3
101101

@@ -121,7 +121,8 @@ def gfp_annotation(prefix, default_stat="mean"):
121121

122122
# Extend the sgns so that they cover the SGN boundaries.
123123
# sgns_extended = _extend_sgns(gfp, sgns)
124-
sgns_extended = _extend_sgns_simple(gfp, sgns)
124+
# TODO we need to integrate this directly in the object measurement to efficiently do it at scale.
125+
sgns_extended = _extend_sgns_simple(gfp, sgns, dilation=4)
125126

126127
# Compute the intensity statistics.
127128
statistics = compute_object_measures_impl(gfp, sgns_extended)
@@ -130,10 +131,10 @@ def gfp_annotation(prefix, default_stat="mean"):
130131
v = napari.Viewer()
131132

132133
# Add the base layers.
133-
v.add_image(gfp)
134-
v.add_image(pv, visible=False)
135-
v.add_labels(sgns, visible=False)
136-
v.add_labels(sgns_extended, name="sgns-extended")
134+
v.add_image(gfp, name="GFP")
135+
v.add_image(pv, visible=False, name="PV")
136+
v.add_labels(sgns, visible=False, name="SGNs")
137+
v.add_labels(sgns_extended, name="SGNs-extended")
137138

138139
# Add additional layers for intensity coloring and classification
139140
# data_numerical = np.zeros(gfp.shape, dtype="float32")
@@ -185,6 +186,10 @@ def threshold_widget(viewer: napari.Viewer, threshold: float = (max_val - min_va
185186
napari.run()
186187

187188

189+
# Cochlea chanel registration quality:
190+
# - M_LR_000144_L: rough alignment is ok, but specific alignment is a bit poor.
191+
# - M_LR_000145_L: rough alignment is ok, detailed alignment also ok.
192+
# - M_LR_000151_R: rough alignment is ok, detailed alignment also ok.
188193
def main():
189194
parser = argparse.ArgumentParser()
190195
parser.add_argument("prefix")

0 commit comments

Comments
 (0)