Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
agglo_id = max(agglo_ids, key=lambda x: agglo_id_counts[x])
if len(agglo_ids) > 1:
logging.info('Warning: more than one agglomerated component. ' +
'Choosing component %d with maximum number of seed points.', agglo_id)
logging.info('agglo_id_counts = %r', agglo_id_counts)
input_edges = graph.get_agglo_edges(agglo_id)
if supervoxels is not None:
input_edges = [x for x in input_edges if x.segment_ids[0] in supervoxels and x.segment_ids[1] in supervoxels]
graph = build_graph(input_edges)
if debug_graph:
graph.check_consistency()
cur_eqs = neuroglancer.EquivalenceMap()
logging.info('Agglomerating')
threshold = float('inf')
while True:
entry = graph.get_next_edge()
if entry is None:
if verbose_merging:
logging.info('Stopping because entry is None')
break
if entry[0] > threshold:
if verbose_merging:
logging.info('Stopping because edge score %r is > threshold %r', entry[0],
threshold)
break
segment_ids = entry[1]
seeds_a = supervoxel_map.get(segment_ids[0])
seeds_b = supervoxel_map.get(segment_ids[1])