You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/user_guide/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This page explains how to configure Derotation for use with the full processing
7
7
8
8
You need to provide a configuration file if you are using the **full pipeline** or the **incremental pipeline**. This configuration can be passed as a Python `dict`
9
9
10
-
If you only want to use the **core derotation method** — `rotate_an_image_array_line_by_line` — then you must manually prepare the image stack and the angle array. In this case, configuration is not needed.
10
+
If you only want to use the **core derotation method** — {func}`derotation.derotate_by_line.derotate_an_image_array_line_by_line` — then you must manually prepare the image stack and the angle array. In this case, configuration is not needed.
Copy file name to clipboardExpand all lines: docs/source/user_guide/key_concepts.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ If the angle of rotation is recorded, `derotation` can reconstruct each frame by
19
19
There are two main ways to use `derotation`:
20
20
21
21
### 1. **Low-level core function**
22
-
Use `derotate_an_image_array_line_by_line` to derotate an image stack, given:
22
+
Use {func}`derotation.derotate_by_line.derotate_an_image_array_line_by_line` to derotate an image stack, given:
23
23
- The original multi-photon movie (expects only one imaging plane)
24
24
- Rotation angle per line
25
25
@@ -28,13 +28,13 @@ This is ideal for testing and debugging with synthetic or preprocessed data.
28
28
### 2. **Full or incremental pipeline classes**
29
29
Use the pre-made pipelines to run end-to-end processing:
30
30
31
-
-`FullPipeline`: assumes randomised complete clockwise and counter-clockwise rotations. It includes:
31
+
-{class}`derotation.analysis.full_derotation_pipeline.FullPipeline`: assumes randomised complete clockwise and counter-clockwise rotations. It includes:
32
32
- Analog signal parsing
33
33
- Angle interpolation
34
34
- Bayesian optimization for center estimation
35
-
- Derotation by line (calling `derotate_an_image_array_line_by_line`)
35
+
- Derotation by line (calling {func}`derotation.derotate_by_line.derotate_an_image_array_line_by_line`)
36
36
37
-
-`IncrementalPipeline`: assumes a continuous rotation performed in small increments. It inherits functionality from the `FullPipeline` but does not perform Bayesian optimization. It can be useful as an alternative way to estimate center of rotation.
37
+
-{class}`derotation.analysis.incremental_derotation_pipeline.IncrementalPipeline`: assumes a continuous rotation performed in small increments. It inherits functionality from the {class}`derotation.analysis.full_derotation_pipeline.FullPipeline` but does not perform Bayesian optimization. It can be useful as an alternative way to estimate center of rotation.
38
38
39
39
Both pipelines accept a configuration dictionary (see the [configuration guide](configuration)) and output:
40
40
- Derotated TIFF
@@ -43,7 +43,7 @@ Both pipelines accept a configuration dictionary (see the [configuration guide](
43
43
- A text file with optimal center of rotation
44
44
- Logs
45
45
46
-
You can subclass `FullPipeline` to create custom pipelines by overwriting relevant methods.
46
+
You can subclass {class}`derotation.analysis.full_derotation_pipeline.FullPipeline` to create custom pipelines by overwriting relevant methods.
47
47
48
48
### Example usage of FullPipeline:
49
49
@@ -82,11 +82,11 @@ Derotation offers two approaches for estimating the center:
82
82
83
83
**Bayesian optimization via FullPipeline**
84
84
85
-
This method searches for the correct center of rotation by derotating the whole movie and minimizing a custom metric, computed through the function `ptd_of_most_detected_blob`. It requires the average image of the derotated movie at different rotations angles, and from them detects blobs, searches for the most frequent and calculates the Point-to-Point Distance (PTD) for it across blob centers at different rotation angles.
85
+
This method searches for the correct center of rotation by derotating the whole movie and minimizing a custom metric, computed through the function {func}`derotation.analysis.metrics.ptd_of_most_detected_blob`. It requires the average image of the derotated movie at different rotations angles, and from them detects blobs, searches for the most frequent and calculates the Point-to-Point Distance (PTD) for it across blob centers at different rotation angles.
86
86
87
87
It is robust but computationally expensive.
88
88
89
-
**Ellipse fitting via IncrementalPipeline**
89
+
**Ellipse fitting via {class}`derotation.analysis.incremental_derotation_pipeline.IncrementalPipeline`**
90
90
91
91
This method exploits the fact that incremental datasets rotate very slowly and smoothly. It works by:
92
92
@@ -96,9 +96,9 @@ This method exploits the fact that incremental datasets rotate very slowly and s
96
96
97
97
The center of the ellipse is assumed to match the true center of rotation. This method fails when the cell stops being visible in certain rotation angles.
98
98
99
-
Once the center is estimated, it can be fed to the FullPipeline to derotate the whole movie.
99
+
Once the center is estimated, it can be fed to the {class}`derotation.analysis.full_derotation_pipeline.FullPipeline` to derotate the whole movie.
100
100
101
-
**Example usage of IncrementalPipeline:**
101
+
**Example usage of {class}`derotation.analysis.incremental_derotation_pipeline.IncrementalPipeline`:**
102
102
103
103
```python
104
104
from derotation.config.load_config import update_config_paths, load_config
@@ -152,9 +152,9 @@ Debugging plots are by default saved in the ``debug_plots`` folder.
152
152
### Custom plotting hooks
153
153
To monitor what is happening at every step of line-by-line derotation, you can use custom plotting hooks. These are functions that are called at specific points in the pipeline and can be used to visualize intermediate results.
154
154
155
-
There are two steps in the ``derotate_an_image_array_line_by_line`` function where hooks can be injected:
156
-
- After adding a new line to the derotated image (`plotting_hook_line_addition`)
157
-
- After completing a frame (`plotting_hook_image_completed`)
155
+
There are two steps in the {func}`derotation.derotate_by_line.derotate_an_image_array_line_by_line` function where hooks can be injected:
156
+
- After adding a new line to the derotated image ({func}`derotation.plotting_hooks.for_derotation.line_addition`)
157
+
- After completing a frame ({func}`derotation.plotting_hooks.for_derotation.image_completed`)
158
158
159
159
Here and example of two pre-made hooks that can be used to visualize the derotation process:
160
160
```python
@@ -177,21 +177,21 @@ You can also inject **custom plotting hooks** at defined pipeline stages. See th
177
177
178
178
## Simulated data
179
179
180
-
Use the `Rotator` and `SyntheticData` classes to generate test data:
180
+
Use the {class}`derotation.simulate.line_scanning_microscope.Rotator` and {class}`derotation.simulate.synthetic_data.SyntheticData` classes to generate test data:
181
181
182
-
-`Rotator`: applies line-by-line rotation to an image stack, simulating a rotating microscope. It can be used to generate challenging synthetic data that include wrong centers of rotation and out of imaging plane rotations.
183
-
-`SyntheticData`: creates fake cell images, assigns rotation angles, and generates synthetic stacks. This is especially useful for validating both the incremental and full pipelines under known conditions.
182
+
-{class}`derotation.simulate.line_scanning_microscope.Rotator`: applies line-by-line rotation to an image stack, simulating a rotating microscope. It can be used to generate challenging synthetic data that include wrong centers of rotation and out of imaging plane rotations.
183
+
-{class}`derotation.simulate.synthetic_data.SyntheticData`: creates fake cell images, assigns rotation angles, and generates synthetic stacks. This is especially useful for validating both the incremental and full pipelines under known conditions.
184
184
185
185

186
186
187
-
This is an example of a synthetic dataset with two cells generated with the `Rotator` class.
187
+
This is an example of a synthetic dataset with two cells generated with the {class}`derotation.simulate.line_scanning_microscope.Rotator` class.
188
188
189
189
---
190
190
191
191
192
192
## Limitations
193
193
194
-
Derotation supports two experimental configurations: randomized full rotations (in the `FullRotation` pipeline) and small-step incremental rotations (`IncrementalPipeline`). Other rotation paradigms are not currently supported out of the box.
194
+
Derotation supports two experimental configurations: randomized full rotations (in the {class}`derotation.analysis.full_derotation_pipeline.FullPipeline`) and small-step incremental rotations ({class}`derotation.analysis.incremental_derotation_pipeline.IncrementalPipeline`). Other rotation paradigms are not currently supported out of the box.
195
195
196
196
The package assumes strict input formats — TIFF stacks for images and `.bin` files with analog signals following a specific channel order. Both pipelines require:
197
197
- timing of rotation ticks, which are used to compute rotation angles;
0 commit comments