Skip to content

Add .zarr file loading for faster upfront training#24

Open
StewartSethA wants to merge 112 commits intoScrollPrize:mainfrom
StewartSethA:main
Open

Add .zarr file loading for faster upfront training#24
StewartSethA wants to merge 112 commits intoScrollPrize:mainfrom
StewartSethA:main

Conversation

@StewartSethA
Copy link

Adds a new segment_to_ome.py utility based on existing scroll_to_ome.py for converting segments into .zarr format for faster loading, and an implementation of .zarr array loading in one of the training scripts

@vercel
Copy link

vercel bot commented Dec 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
scrollprize-org ⬜️ Ignored (Inspect) Visit Preview Dec 1, 2024 6:33am

@schillij95
Copy link
Contributor

Thank you Seth for your PR

After looking over the scroll2zarr adjustments, i have some questions:

  • what is the difference between the scroll_to_ome.py and the segment_to_ome.py?
  • scroll_to_ome.py can also take the "input_tiff_dir" argument as path_so_segment/layers as tif/jpg input stack and then output the zarr as the argument "output", ie segment_id.zarr

Comment on lines +500 to +502
if err is not None:
print("error returned:", err)
return 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a logic error in the zarr_only branch. The function unconditionally returns 1 (error code) regardless of whether tifs2zarr() succeeds or fails. This should be modified to return 0 when err is None and 1 when an error occurs. Consider updating the code to:

if zarr_only:
    print("zarr_only tifs2zarr", tiffdir, zarrdir, chunk_size, slices, maxgb)
    err = tifs2zarr(tiffdir, zarrdir, chunk_size, slices=slices, maxgb=maxgb)
    if err is not None:
        print("error returned:", err)
        return 1
    return 0  # Success case
Suggested change
if err is not None:
print("error returned:", err)
return 1
if err is not None:
print("error returned:", err)
return 1
return 0 # Success case

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

bruniss added a commit that referenced this pull request Sep 8, 2025
Remove `assert()` from `local_cost*` methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants