Skip to content

Commit

Permalink
Add fill missing options for input layers
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed Mar 22, 2024
1 parent 8e87ffc commit 5251308
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions scripts/cut_chunk_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions scripts/cut_chunk_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions scripts/cut_chunk_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5251308

Please sign in to comment.