Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .virtual_documents/docs/notebooks/demo_select_channels.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@









import easy_vitessce as ev
import spatialdata as sd
import spatialdata_plot
from os.path import join





import os
from os.path import join, isfile, isdir
from urllib.request import urlretrieve
import zipfile


data_dir = "data"
zip_path = join(data_dir, "mcmicro_io.spatialdata.zarr.zip")
sdata_path = join(data_dir, "mcmicro_io.spatialdata.zarr")


if not isdir(sdata_path):
if not isfile(zip_path):
os.makedirs(data_dir, exist_ok=True)
urlretrieve('https://mghp.osn.xsede.org/bir190004-bucket01/BiocSpatialData/mcmicro_io.zip', zip_path)
with zipfile.ZipFile(zip_path,"r") as zip_ref:
zip_ref.extractall(data_dir)
os.rename(join(data_dir, "data.zarr"), sdata_path)





sdata = sd.read_zarr(sdata_path)
sdata





vw = sdata.pl.render_images(element="exemplar-001_image").pl.show()
vw





current_config = vw._config





meta_scopes = current_config["coordinationSpace"]["metaCoordinationScopes"]
meta_scopes_by = current_config["coordinationSpace"]["metaCoordinationScopesBy"]


first_layer_scope = meta_scopes['init_A_image_0']['imageLayer'][0]
first_layer_scope


channel_scope_names = meta_scopes_by['init_A_image_0']['imageLayer']['imageChannel'][first_layer_scope]
channel_scope_names


channel_colors = current_config["coordinationSpace"]["spatialChannelColor"]
channel_colors


first_channel_color = channel_colors[channel_scope_names[0]]
first_channel_color


channel_windows = current_config["coordinationSpace"]["spatialChannelWindow"]
channel_windows


first_channel_window = channel_windows[channel_scope_names[0]]
first_channel_window






Loading
Loading