Skip to content

Commit

Permalink
#37 mask name added to internal helper function plots
Browse files Browse the repository at this point in the history
  • Loading branch information
carljohnsen committed Oct 8, 2024
1 parent afc1b69 commit 0c32387
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/py/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,16 +718,15 @@ def label_worker(dataset, start, end):
final_n_labels = lib_connected_components.merge_labeled_chunks(labels, np.array(n_labels), (n_chunks, layers_per_chunk, ny, nx), verbose)

if plotting:
plot_middle_planes(labels, plotting_dir, 'labeled', verbose=verbose)
plot_middle_planes(labels > 0, plotting_dir, 'labeled_binary', verbose=verbose)
plot_middle_planes(labels, plotting_dir, f'{mask_name}_labeled', verbose=verbose)
plot_middle_planes(labels > 0, plotting_dir, f'{mask_name}_labeled_binary', verbose=verbose)

# TODO use lib_general.bincount at some point.
bincounts = np.bincount(labels[labels > 0], minlength=final_n_labels+1)
largest_cc = np.argmax(bincounts)

return (labels == largest_cc)


def load_chunk(sample, scale, offset, chunk_size, mask_name, mask_scale, field_names, field_scale, verbose = 0):
'''
Load a chunk of voxels and fields from the binary and HDF5 files.
Expand Down

0 comments on commit 0c32387

Please sign in to comment.