Skip to content

Commit 1a2ee6e

Browse files
committed
crop display roi
1 parent 2761dda commit 1a2ee6e

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

examples/virtual_staining/vcp_tutorials/quick_start.ipynb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,19 @@
377377
"outputs": [],
378378
"source": [
379379
"# Read images from Zarr stores\n",
380+
"# Choose the ROI for better visualization\n",
381+
"y_slice = slice(0, 512)\n",
382+
"x_slice = slice(0, 512)\n",
380383
"\n",
381384
"# Open the prediction store and get the 2D images from 5D arrays (t,c,z,y,x)\n",
382385
"with open_ome_zarr(output_path / fov) as vs_store:\n",
383-
" vs_nucleus = vs_store[0][0, 0, 0]\n",
384-
" vs_membrane = vs_store[0][0, 1, 0]\n",
386+
" vs_nucleus = vs_store[0][0, 0, 0, y_slice, x_slice]\n",
387+
" vs_membrane = vs_store[0][0, 1, 0, y_slice, x_slice]\n",
385388
"\n",
386389
"# Open the experimental fluorescence dataset\n",
387390
"with open_ome_zarr(input_data_path / fov) as fluor_store:\n",
388-
" fluor_nucleus = fluor_store[0][0, 1, 0]\n",
389-
" fluor_membrane = fluor_store[0][0, 2, 0]"
391+
" fluor_nucleus = fluor_store[0][0, 1, 0, y_slice, x_slice]\n",
392+
" fluor_membrane = fluor_store[0][0, 2, 0, y_slice, x_slice]"
390393
]
391394
},
392395
{

examples/virtual_staining/vcp_tutorials/quick_start.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,16 +250,19 @@
250250

251251
# %%
252252
# Read images from Zarr stores
253+
# Choose the ROI for better visualization
254+
y_slice = slice(0, 512)
255+
x_slice = slice(0, 512)
253256

254257
# Open the prediction store and get the 2D images from 5D arrays (t,c,z,y,x)
255258
with open_ome_zarr(output_path / fov) as vs_store:
256-
vs_nucleus = vs_store[0][0, 0, 0]
257-
vs_membrane = vs_store[0][0, 1, 0]
259+
vs_nucleus = vs_store[0][0, 0, 0, y_slice, x_slice]
260+
vs_membrane = vs_store[0][0, 1, 0, y_slice, x_slice]
258261

259262
# Open the experimental fluorescence dataset
260263
with open_ome_zarr(input_data_path / fov) as fluor_store:
261-
fluor_nucleus = fluor_store[0][0, 1, 0]
262-
fluor_membrane = fluor_store[0][0, 2, 0]
264+
fluor_nucleus = fluor_store[0][0, 1, 0, y_slice, x_slice]
265+
fluor_membrane = fluor_store[0][0, 2, 0, y_slice, x_slice]
263266

264267
# %%
265268
# Plot

0 commit comments

Comments
 (0)