Skip to content

Commit b3c15a7

Browse files
committed
Squashed commit of the following:
commit 6c75b50 Author: alessandrofelder <[email protected]> Date: Mon Jul 10 14:54:23 2023 +0100 make a napari-MPL widget commit 50af5aa Merge: b23c008 dd681ce Author: lauraporta <[email protected]> Date: Mon Jul 10 14:11:17 2023 +0100 Merge branch 'derotation-01' into napari-matplotlib commit b23c008 Author: alessandrofelder <[email protected]> Date: Mon Jul 10 14:07:05 2023 +0100 dummy napari plotting widget commit dd681ce Author: lauraporta <[email protected]> Date: Mon Jul 10 12:50:24 2023 +0100 Refactor plots and other methods commit 4b8596f Author: lauraporta <[email protected]> Date: Mon Jul 10 12:24:48 2023 +0100 Update pyproject.toml commit cd4d14f Author: lauraporta <[email protected]> Date: Mon Jul 10 12:01:20 2023 +0100 Move part of the analysis code in methods in other files - analog preprocessing - extraction of rotation angles commit a233b24 Author: lauraporta <[email protected]> Date: Mon Jul 10 11:04:28 2023 +0100 Add new plotting of centroids commit 0be6a4b Author: lauraporta <[email protected]> Date: Thu Jun 29 18:57:52 2023 +0200 Add improvements in the optimization algorithms for centroid location and derotation angles commit 2776f7c Author: lauraporta <[email protected]> Date: Wed Jun 28 21:41:23 2023 +0200 Add functioning algorithm to optimize rotation degrees commit 3c63528 Author: lauraporta <[email protected]> Date: Wed Jun 28 14:33:09 2023 +0200 Add changes to gitignore commit 5c73d88 Author: lauraporta <[email protected]> Date: Mon Jun 26 17:38:05 2023 +0200 Optimization v1 commit 6c0e0ca Author: lauraporta <[email protected]> Date: Mon Jun 26 17:37:54 2023 +0200 Improve plots commit 510db18 Author: lauraporta <[email protected]> Date: Mon Jun 26 17:37:32 2023 +0200 Clean up commit 7b4748e Author: lauraporta <[email protected]> Date: Mon Jun 26 17:36:43 2023 +0200 Add libraries to pyproject.toml commit 0bac20f Author: lauraporta <[email protected]> Date: Fri Jun 23 13:39:35 2023 +0100 Add draft pipeline to find centroid commit 2c42d39 Author: lauraporta <[email protected]> Date: Thu Jun 22 16:50:26 2023 +0100 Visualize effects of derotation and correct some errors commit 8c843f6 Author: lauraporta <[email protected]> Date: Thu Jun 22 15:03:20 2023 +0100 Add working logic to calculate the rotation degree for each frame commit 9708a17 Author: lauraporta <[email protected]> Date: Tue Jun 20 16:22:21 2023 +0100 Linting commit 52bea43 Author: lauraporta <[email protected]> Date: Tue Jun 20 16:21:03 2023 +0100 Add draft logic to fit the rotation degree changes to curve [not working] commit 4f2a0e3 Author: lauraporta <[email protected]> Date: Tue Jun 20 14:53:58 2023 +0100 Get the rotation angle per tick commit 2cf3636 Author: lauraporta <[email protected]> Date: Tue Jun 20 13:50:25 2023 +0100 Assign correct sign for rotation commit e3be111 Author: lauraporta <[email protected]> Date: Tue Jun 20 13:20:19 2023 +0100 Find optimal threshold for frames
1 parent a6f9da0 commit b3c15a7

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

derotation/napari.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: derotation
2+
display_name: Neuroinformatics derotation tools
3+
contributions:
4+
commands:
5+
- id: derotation.make_plotting_widget
6+
python_name: derotation.plotting:Plotting
7+
title: Make Plotting Widget
8+
widgets:
9+
- command: derotation.make_plotting_widget
10+
display_name: NIU derotation plotting

derotation/plotting.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from typing import Optional
2+
3+
import numpy as np
4+
from napari.viewer import Viewer
5+
from napari_matplotlib.base import SingleAxesWidget
6+
from qtpy.QtWidgets import (
7+
QPushButton,
8+
QVBoxLayout,
9+
QWidget,
10+
)
11+
12+
13+
class DerotationCanvas(SingleAxesWidget):
14+
def __init__(
15+
self,
16+
napari_viewer: Viewer,
17+
parent: Optional[QWidget] = None,
18+
):
19+
super().__init__(napari_viewer, parent=parent)
20+
self.angles_over_time = np.sin(np.linspace(0, 10, 100))
21+
self._update_layers(None)
22+
23+
def draw(self):
24+
self.axes.plot(self.angles_over_time, color="red")
25+
self.axes.set_title(f"z={self.current_z}")
26+
self.axes.axvline(self.current_z)
27+
28+
29+
class Plotting(QWidget):
30+
def __init__(self, napari_viewer: Viewer):
31+
super().__init__()
32+
33+
self._viewer = napari_viewer
34+
self.setLayout(QVBoxLayout())
35+
self.button = QPushButton()
36+
self.button.setText("Make plot")
37+
self.layout().addWidget(self.button)
38+
39+
self.mpl_widget = DerotationCanvas(self._viewer)
40+
self.layout().addWidget(self.mpl_widget)

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[options.entry_points]
2+
napari.manifest =
3+
brainglobe-napari = derotation:napari.yaml

0 commit comments

Comments
 (0)