From 5251308fd4f72aacc37d880900fd1c11559cec96 Mon Sep 17 00:00:00 2001 From: Ran Lu Date: Thu, 21 Mar 2024 21:27:12 -0400 Subject: [PATCH] Add fill missing options for input layers --- scripts/cut_chunk_agg.py | 6 +++--- scripts/cut_chunk_cs.py | 4 ++-- scripts/cut_chunk_ws.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/cut_chunk_agg.py b/scripts/cut_chunk_agg.py index f93e3fd..196387d 100644 --- a/scripts/cut_chunk_agg.py +++ b/scripts/cut_chunk_agg.py @@ -30,7 +30,7 @@ def write_metadata(fn, offset, size, ac_offset): ac_offset = param["ac_offset"] boundary_flags = param["boundary_flags"] -aff = load_data(global_param['AFF_PATH'],mip=global_param['AFF_RESOLUTION'],fill_missing=False) +aff = load_data(global_param['AFF_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('AFF_FILL_MISSING', False)) aff_cutout = adjust_affinitymap(aff, aff_bbox, boundary_flags, 0, 1) save_raw_data("aff.raw", aff_cutout) @@ -39,12 +39,12 @@ def write_metadata(fn, offset, size, ac_offset): start_coord = bbox[0:3] end_coord = [bbox[i+3]+1-boundary_flags[i+3] for i in range(3)] -seg = load_data(os.environ['WS_PATH'],mip=global_param['AFF_RESOLUTION'],fill_missing=False) +seg = load_data(os.environ['WS_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('WS_FILL_MISSING', False)) seg_cutout = cut_data(seg, start_coord, end_coord, boundary_flags) save_raw_data("seg.raw", seg_cutout) if "SEM_PATH" in global_param: - sem = load_data(global_param['SEM_PATH'],mip=global_param['AFF_RESOLUTION'],fill_missing=False) + sem = load_data(global_param['SEM_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('SEM_FILL_MISSING', False)) sem_cutout = cut_data(sem, start_coord, end_coord, boundary_flags) save_raw_data("sem.raw", sem_cutout) diff --git a/scripts/cut_chunk_cs.py b/scripts/cut_chunk_cs.py index ad6ef7a..47df0b4 100644 --- a/scripts/cut_chunk_cs.py +++ b/scripts/cut_chunk_cs.py @@ -32,11 +32,11 @@ def write_metadata(fn, offset, size, ac_offset, low, high): end_coord = [bbox[i+3]+1-boundary_flags[i+3] for i in range(3)] if "AFF_PATH" in global_param: - aff = load_data(global_param['AFF_PATH'],mip=global_param['AFF_RESOLUTION'],fill_missing=False) + aff = load_data(global_param['AFF_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('AFF_FILL_MISSING', False)) aff_cutout = cut_data(aff, start_coord, end_coord, boundary_flags) save_raw_data("aff.raw", aff_cutout) -seg = load_data(os.environ['SEG_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=True) +seg = load_data(os.environ['SEG_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('SEG_FILL_MISSING', False)) seg_cutout = cut_data(seg, start_coord, end_coord, boundary_flags) save_raw_data("seg.raw", seg_cutout) diff --git a/scripts/cut_chunk_ws.py b/scripts/cut_chunk_ws.py index 9ee0e8e..a98cb07 100644 --- a/scripts/cut_chunk_ws.py +++ b/scripts/cut_chunk_ws.py @@ -24,11 +24,11 @@ def write_metadata(fn, size, boundaries, offset): boundary_flags = param["boundary_flags"] offset = param["offset"] -aff = load_data(global_param['AFF_PATH'],mip=global_param['AFF_RESOLUTION'],fill_missing=False) +aff = load_data(global_param['AFF_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('AFF_FILL_MISSING', False)) aff_cutout = adjust_affinitymap(aff, aff_bbox, boundary_flags, 1, 1) if "SEM_PATH" in global_param and global_param.get("SEMANTIC_WS", False): - sem = load_data(global_param['SEM_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=False) + sem = load_data(global_param['SEM_PATH'], mip=global_param['AFF_RESOLUTION'], fill_missing=global_param.get('SEM_FILL_MISSING', False)) aff_cutout = mask_affinity_with_semantic_labels(aff_cutout, sem, bbox, boundary_flags, 1, 1) if 'ADJUSTED_AFF_PATH' in global_param: