Skip to content

Commit

Permalink
fix layers not being added after updating napari to 0.5.*
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertDominguez committed Jul 23, 2024
1 parent 272ec57 commit 706988c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions napari_spotiflow/_dock_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,26 @@ def _progress(it, **kwargs):
details_flow = np.stack([det.flow for det in details_t], axis=0)

if cnn_output:
layers.append((.5*(1+details_flow), dict(name=f'Stereographic flow ({image.name})',
), 'image'))
layers.append((details_prob_heatmap, dict(name=f'Gaussian heatmap ({image.name})',
colormap='magma'), 'image'))
# layers.append((.5*(1+details_flow), dict(name=f'Stereographic flow ({image.name})',
# ), 'image'))
# layers.append((details_prob_heatmap, dict(name=f'Gaussian heatmap ({image.name})',
# colormap='magma'), 'image'))
viewer.add_image(.5*(1+details_flow), name=f'Stereographic flow ({image.name})')
viewer.add_image(details_prob_heatmap, name=f'Gaussian heatmap ({image.name})', colormap='magma')

points_layer_name = f'Spots ({image.name})'
for l in viewer.layers:
if l.name == points_layer_name:
viewer.layers.remove(l)

layers.append((pred_points, dict(name=f'Spots ({image.name})',
**_point_layer2d_default_kwargs), 'points'))

# layers.append((pred_points, dict(name=f'Spots ({image.name})',
# **_point_layer2d_default_kwargs), 'points'))

viewer.add_points(pred_points, name=points_layer_name, **_point_layer2d_default_kwargs)

progress_bar.hide()

return layers
return

# # -------------------------------------------------------------------------

Expand Down

0 comments on commit 706988c

Please sign in to comment.