Skip to content

Commit

Permalink
fix: crashing bug in CLI for contrast normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Dec 11, 2023
1 parent c48be20 commit 21f2f7b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion igneous/task_creation/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,11 +1120,13 @@ def create_contrast_normalization_tasks(
dvol.info['scales'] = dvol.info['scales'][:mip+1]
dvol.commit_info()

dvol.meta.unlock_mips(mip)

if bounds is None:
bounds = srcvol.bounds.clone()

if shape is None:
shape = Bbox( (0,0,0), (2048, 2048, 64) )
shape = Bbox( (0,0,0), (2048, 2048, dvol.chunk_size.z) )
shape = shape.shrink_to_chunk_size(dvol.underlying).size3()
shape = Vec.clamp(shape, (1,1,1), bounds.size3() )

Expand Down
2 changes: 1 addition & 1 deletion igneous_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def equalize(
"""(2) Apply histogram equalization to z-slices."""
if bounds_mip is None:
bounds_mip = mip
bounds = compute_bounds(path, bounds_mip, xrange, yrange, zrange)
bounds = compute_bounds(src, bounds_mip, xrange, yrange, zrange)

tasks = tc.create_contrast_normalization_tasks(
src, dest, levels_path=None,
Expand Down

0 comments on commit 21f2f7b

Please sign in to comment.