diff --git a/src/blik/reader.py b/src/blik/reader.py index 5a0f488..8aae66a 100644 --- a/src/blik/reader.py +++ b/src/blik/reader.py @@ -60,9 +60,11 @@ def _construct_orientations_layer(coords, features, scale, exp_id, p_id, source) { "name": f"{exp_id} - particle orientations", "edge_color": vec_color, - "length": 150 / np.array(scale), + "length": 100 / np.array(scale), + "edge_width": 10 / np.array(scale), "scale": [scale] * 3, "metadata": {"experiment_id": exp_id, "p_id": p_id, "source": source}, + "vector_style": "arrow", # "projection_mode": "all", # only available in napari 0.5.0 "out_of_slice_display": True, }, @@ -102,8 +104,9 @@ def construct_particle_layer_tuples( ) ori = _construct_orientations_layer(coords, features, scale, exp_id, p_id, source) - # invert order for convenience (latest added layer is selected) - return [ori, pos] + # ori should be last, or the auto-update feedback loop messes up the orientations + # when existing layers are updated from a new run + return [pos, ori] def read_particles(particles): diff --git a/src/blik/widgets/picking.py b/src/blik/widgets/picking.py index c581906..5c04f2b 100644 --- a/src/blik/widgets/picking.py +++ b/src/blik/widgets/picking.py @@ -173,14 +173,13 @@ def surface_particles( pos = np.concatenate(pos) features = pd.DataFrame({"orientation": np.asarray(Rotation.concatenate(ori))}) - vec_layer_tuple, pos_layer_tuple = construct_particle_layer_tuples( + return construct_particle_layer_tuples( coords=invert_xyz(pos), features=features, scale=surface.scale[0], exp_id=exp_id, face_color_cycle=colors, ) - return [vec_layer_tuple, pos_layer_tuple] @magicgui( @@ -280,13 +279,12 @@ def filament_particles( features = pd.DataFrame({"orientation": np.asarray(Rotation.concatenate(ori))}) - vec_layer_tuple, pos_layer_tuple = construct_particle_layer_tuples( + return construct_particle_layer_tuples( coords=invert_xyz(pos), features=features, scale=filament.scale[0], exp_id=exp_id, ) - return [vec_layer_tuple, pos_layer_tuple] @magicgui(