uermel commited on
Commit ·
0c0bf54
1
Parent(s): 4f0b0d7
remove some comments
Browse files- README.md +5 -9
- demos.ipynb +4 -6
README.md
CHANGED
|
@@ -176,7 +176,7 @@ import matplotlib.pyplot as plt
|
|
| 176 |
|
| 177 |
root = copick.from_croissant(
|
| 178 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/phantom/Croissant/metadata.json",
|
| 179 |
-
overlay_root="/tmp/popsicle-overlay",
|
| 180 |
static_fs_args={"anon": True}, # public portal bucket
|
| 181 |
)
|
| 182 |
|
|
@@ -258,7 +258,7 @@ import matplotlib.pyplot as plt
|
|
| 258 |
|
| 259 |
root = copick.from_croissant(
|
| 260 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/bacterial/Croissant/metadata.json",
|
| 261 |
-
overlay_root="/tmp/popsicle-overlay",
|
| 262 |
static_fs_args={"anon": True}, # public portal bucket
|
| 263 |
)
|
| 264 |
|
|
@@ -281,8 +281,6 @@ ax.imshow(arr[z_mid], cmap="gray")
|
|
| 281 |
cmap = plt.get_cmap("tab10")
|
| 282 |
for i, seg in enumerate(run.segmentations):
|
| 283 |
mask = seg.numpy()[z_mid] # (Y, X) — same shape as the tomo slice
|
| 284 |
-
# Replace the binary 1s with i so each class maps to a different tab10 index;
|
| 285 |
-
# otherwise every overlay renders as tab10[1].
|
| 286 |
layer = np.ma.masked_where(mask == 0, np.full_like(mask, i, dtype=np.int8))
|
| 287 |
ax.imshow(layer, cmap=cmap, vmin=0, vmax=10, alpha=0.4, interpolation="none")
|
| 288 |
# one-line legend hack: scatter a single point off-image with the class color
|
|
@@ -347,7 +345,7 @@ import matplotlib.pyplot as plt
|
|
| 347 |
|
| 348 |
root = copick.from_croissant(
|
| 349 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/yeast/Croissant/metadata.json",
|
| 350 |
-
overlay_root="/tmp/popsicle-overlay",
|
| 351 |
static_fs_args={"anon": True}, # public portal bucket
|
| 352 |
)
|
| 353 |
|
|
@@ -424,7 +422,7 @@ import matplotlib.pyplot as plt
|
|
| 424 |
|
| 425 |
root = copick.from_croissant(
|
| 426 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/motorbench/Croissant/metadata.json",
|
| 427 |
-
overlay_root="/tmp/popsicle-overlay",
|
| 428 |
static_fs_args={"anon": True}, # public portal bucket
|
| 429 |
)
|
| 430 |
|
|
@@ -434,9 +432,7 @@ for split, run_names in root.splits.items():
|
|
| 434 |
print(f"{split}: {len(run_names)} runs ({len(runs_with)} with motor picks)")
|
| 435 |
|
| 436 |
# Visualize: midplane slice of one *V. cholerae* test tomogram with motor
|
| 437 |
-
# centers overlaid as crosses.
|
| 438 |
-
# as run.name — sma2022-08-05-19 -> Run.id 33914 -> copick run.name "33914".
|
| 439 |
-
# The portal Run.name is preserved on `run.portal_run_name` for round-tripping.
|
| 440 |
run = root.get_run("33914")
|
| 441 |
vs = run.voxel_spacings[0]
|
| 442 |
tomo = vs.tomograms[0]
|
|
|
|
| 176 |
|
| 177 |
root = copick.from_croissant(
|
| 178 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/phantom/Croissant/metadata.json",
|
| 179 |
+
overlay_root="/tmp/popsicle-overlay",
|
| 180 |
static_fs_args={"anon": True}, # public portal bucket
|
| 181 |
)
|
| 182 |
|
|
|
|
| 258 |
|
| 259 |
root = copick.from_croissant(
|
| 260 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/bacterial/Croissant/metadata.json",
|
| 261 |
+
overlay_root="/tmp/popsicle-overlay",
|
| 262 |
static_fs_args={"anon": True}, # public portal bucket
|
| 263 |
)
|
| 264 |
|
|
|
|
| 281 |
cmap = plt.get_cmap("tab10")
|
| 282 |
for i, seg in enumerate(run.segmentations):
|
| 283 |
mask = seg.numpy()[z_mid] # (Y, X) — same shape as the tomo slice
|
|
|
|
|
|
|
| 284 |
layer = np.ma.masked_where(mask == 0, np.full_like(mask, i, dtype=np.int8))
|
| 285 |
ax.imshow(layer, cmap=cmap, vmin=0, vmax=10, alpha=0.4, interpolation="none")
|
| 286 |
# one-line legend hack: scatter a single point off-image with the class color
|
|
|
|
| 345 |
|
| 346 |
root = copick.from_croissant(
|
| 347 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/yeast/Croissant/metadata.json",
|
| 348 |
+
overlay_root="/tmp/popsicle-overlay",
|
| 349 |
static_fs_args={"anon": True}, # public portal bucket
|
| 350 |
)
|
| 351 |
|
|
|
|
| 422 |
|
| 423 |
root = copick.from_croissant(
|
| 424 |
"https://huggingface.co/datasets/uermel/popsicle/resolve/main/motorbench/Croissant/metadata.json",
|
| 425 |
+
overlay_root="/tmp/popsicle-overlay",
|
| 426 |
static_fs_args={"anon": True}, # public portal bucket
|
| 427 |
)
|
| 428 |
|
|
|
|
| 432 |
print(f"{split}: {len(run_names)} runs ({len(runs_with)} with motor picks)")
|
| 433 |
|
| 434 |
# Visualize: midplane slice of one *V. cholerae* test tomogram with motor
|
| 435 |
+
# centers overlaid as crosses.
|
|
|
|
|
|
|
| 436 |
run = root.get_run("33914")
|
| 437 |
vs = run.voxel_spacings[0]
|
| 438 |
tomo = vs.tomograms[0]
|
demos.ipynb
CHANGED
|
@@ -72,7 +72,7 @@
|
|
| 72 |
"\n",
|
| 73 |
"root = copick.from_croissant(\n",
|
| 74 |
" PHANTOM_URL,\n",
|
| 75 |
-
" overlay_root=\"/tmp/popsicle-overlay\",
|
| 76 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 77 |
")\n",
|
| 78 |
"\n",
|
|
@@ -145,7 +145,7 @@
|
|
| 145 |
"\n",
|
| 146 |
"root = copick.from_croissant(\n",
|
| 147 |
" BACTERIAL_URL,\n",
|
| 148 |
-
" overlay_root=\"/tmp/popsicle-overlay\",
|
| 149 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 150 |
")\n",
|
| 151 |
"\n",
|
|
@@ -177,8 +177,6 @@
|
|
| 177 |
"cmap = plt.get_cmap(\"tab10\")\n",
|
| 178 |
"for i, seg in enumerate(run.segmentations):\n",
|
| 179 |
" mask = seg.numpy()[z_mid] # (Y, X) — same shape as the tomo slice\n",
|
| 180 |
-
" # Substitute the binary mask values with i so each class maps to a\n",
|
| 181 |
-
" # different tab10 index (otherwise every overlay renders as tab10[1]).\n",
|
| 182 |
" layer = np.ma.masked_where(mask == 0, np.full_like(mask, i, dtype=np.int8))\n",
|
| 183 |
" ax.imshow(layer, cmap=cmap, vmin=0, vmax=10, alpha=0.4, interpolation=\"none\")\n",
|
| 184 |
" ax.scatter([], [], color=cmap(i), label=seg.name)\n",
|
|
@@ -211,7 +209,7 @@
|
|
| 211 |
"\n",
|
| 212 |
"root = copick.from_croissant(\n",
|
| 213 |
" YEAST_URL,\n",
|
| 214 |
-
" overlay_root=\"/tmp/popsicle-overlay\",
|
| 215 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 216 |
")\n",
|
| 217 |
"\n",
|
|
@@ -282,7 +280,7 @@
|
|
| 282 |
"\n",
|
| 283 |
"root = copick.from_croissant(\n",
|
| 284 |
" MOTORBENCH_URL,\n",
|
| 285 |
-
" overlay_root=\"/tmp/popsicle-overlay\",
|
| 286 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 287 |
")\n",
|
| 288 |
"\n",
|
|
|
|
| 72 |
"\n",
|
| 73 |
"root = copick.from_croissant(\n",
|
| 74 |
" PHANTOM_URL,\n",
|
| 75 |
+
" overlay_root=\"/tmp/popsicle-overlay\",\n",
|
| 76 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 77 |
")\n",
|
| 78 |
"\n",
|
|
|
|
| 145 |
"\n",
|
| 146 |
"root = copick.from_croissant(\n",
|
| 147 |
" BACTERIAL_URL,\n",
|
| 148 |
+
" overlay_root=\"/tmp/popsicle-overlay\",\n",
|
| 149 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 150 |
")\n",
|
| 151 |
"\n",
|
|
|
|
| 177 |
"cmap = plt.get_cmap(\"tab10\")\n",
|
| 178 |
"for i, seg in enumerate(run.segmentations):\n",
|
| 179 |
" mask = seg.numpy()[z_mid] # (Y, X) — same shape as the tomo slice\n",
|
|
|
|
|
|
|
| 180 |
" layer = np.ma.masked_where(mask == 0, np.full_like(mask, i, dtype=np.int8))\n",
|
| 181 |
" ax.imshow(layer, cmap=cmap, vmin=0, vmax=10, alpha=0.4, interpolation=\"none\")\n",
|
| 182 |
" ax.scatter([], [], color=cmap(i), label=seg.name)\n",
|
|
|
|
| 209 |
"\n",
|
| 210 |
"root = copick.from_croissant(\n",
|
| 211 |
" YEAST_URL,\n",
|
| 212 |
+
" overlay_root=\"/tmp/popsicle-overlay\",\n",
|
| 213 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 214 |
")\n",
|
| 215 |
"\n",
|
|
|
|
| 280 |
"\n",
|
| 281 |
"root = copick.from_croissant(\n",
|
| 282 |
" MOTORBENCH_URL,\n",
|
| 283 |
+
" overlay_root=\"/tmp/popsicle-overlay\",\n",
|
| 284 |
" static_fs_args={\"anon\": True}, # public portal bucket\n",
|
| 285 |
")\n",
|
| 286 |
"\n",
|