Skip to content

vc_grow_seg_from_seed silently deletes the grown surface and exits 0 when the volume is an s3:// path #1403

Description

@DarthCeltic

Growing a segment straight from an s3:// volume produces no output, no error, and exit code 0.

vc_grow_seg_from_seed reads the voxel size at line 326:

float voxelsize = json::parse(std::ifstream(vol_path/"meta.json"))["voxelsize"];

The zarr data streams from S3 fine, but that's a plain ifstream against an s3:// path, so voxelsize doesn't get the real value. area_cm2 then computes to 0.000000, and at line 1371 that fails the min_area_cm check (default 0.3), which calls remove_all(seg_dir) and returns EXIT_SUCCESS:

double area_cm2 = (*surf->meta)["area_cm2"].get<double>();
if (area_cm2 < min_area_cm) {
    if (std::filesystem::exists(seg_dir)) {
        std::filesystem::remove_all(seg_dir);
    }
    return EXIT_SUCCESS;
}

The surface is deleted and the run reports success. It took me a while to work out that the grow had actually worked — 99 generations, about 15.6M vx² of surface, and an empty output directory.

Setting {"min_area_cm": 0.0} gets the mesh written, but the area recorded in its meta.json is still wrong for the same reason.

Same root cause shows up in a second tool with a different symptom: vc_render_tifxyz against s3://vesuvius-challenge-open-data/PHerc0009B/volumes/20250521125136-8.640um-1.2m-116keV-masked.zarr prints

Voxel size: 1.0 (no metadata found; override with --voxel-size)

and carries on with the wrong scale rather than deleting anything.

Reading that meta.json through the same S3-aware path the volume already uses would fix both. I haven't sent a patch — I don't know whether anything downstream relies on the current fallback behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions