# You must run install.py first and then restart 3D Slicer before running this script
import imagecodecs.zarr
from ome_zarr import OMEZarrMultiscale

imagecodecs.zarr.register_codecs(verbose=True)

# Set this to whatever path you have as an .ome.zarr directory
input_path = r'C:\Users\jeppe\Documents\MEGA\S4\naturarv3d\CIL_basic_binned_2x2\NaturArv3D_format_viability_study\OME-Zarr\Canislupus_CZM_712__uncompressed__scales_2_4_8_16.ome.zarr'

img = OMEZarrMultiscale.from_ome_zarr(input_path)
scale_idx = 2  # This selects 2nd scale in pyramid (assuming you have loaded a multiscale image)
arr = img.images[scale_idx].data

vol = addVolumeFromArray(arr)
# Now volume is loaded, but it is hidden by default
# Unhide it in the Data module.
