From f5e93cb7115e18337e107f53a93ece359f55dd8b Mon Sep 17 00:00:00 2001 From: Price Allman Date: Mon, 6 Apr 2026 22:37:03 -0500 Subject: [PATCH] Fix ink label URL construction for .zarr segments The download_inklabel() method was constructing incorrect URLs for ink label PNG files when the segment URL ended with .zarr extension. Before: .../20230827161847.zarr_inklabels.png (404 Not Found) After: .../20230827161847_inklabels.png (200 OK) The fix strips the .zarr extension from the segment ID before constructing the ink label filename. This fixes Tutorial 5 (Ink Detection) which was reported broken in Discord #newbie-questions. --- vesuvius/src/vesuvius/data/volume.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vesuvius/src/vesuvius/data/volume.py b/vesuvius/src/vesuvius/data/volume.py index 69a33c005..dd7811068 100644 --- a/vesuvius/src/vesuvius/data/volume.py +++ b/vesuvius/src/vesuvius/data/volume.py @@ -663,6 +663,9 @@ def download_inklabel(self, save_path=None) -> None: # Extract parent URL and segment ID parent_url = os.path.dirname(base_url) segment_id_str = os.path.basename(base_url) + # Remove .zarr extension if present (fixes URL construction bug) + if segment_id_str.endswith('.zarr'): + segment_id_str = segment_id_str[:-5] # Construct ink label path inklabel_filename = f"{segment_id_str}_inklabels.png" inklabel_url = os.path.join(parent_url, inklabel_filename)