# Drift Corrector

This project contains a small program with user interface implementing the drift correction method for image stack containing near spherical objects as described in Stephensen et. al. Communications biology 3.1 (2020). If you found this helpful, please reference:

```
@article{stephensen2020restoring,
  title={Restoring drifted electron microscope volumes using synaptic vesicles at sub-pixel accuracy},
  author={Stephensen, Hans Jacob Teglbj{\ae}rg and Darkner, Sune and Sporring, Jon},
  journal={Communications biology},
  volume={3},
  number={1},
  pages={1--7},
  year={2020},
  publisher={Nature Publishing Group}
}
```

# How to use

1) $python DriftCorrector.py

2) Click "Open dataset" to get startet

3) navigate to the directory with your volume data as either a multipage tiff file or in the a number of consecutively named image files. I.e. my_image_0.png, my_image_1.png, my_image_2.png, ...

4) Confirm that the tool is in "Add Points" mode in the left pane

5) Annotate vesicles one at a time by using the following commands

 Right-click to center at a vesicle
 Zoom in/out using the buttons in the left pane
 Left-click a vesicle boundary to annotate a point
 Use the mouse scroll button or the "+" and "-" key to cycle through the image sections
 Change viewing direction by clicking "a"
 Undo point placement by clicking "ctrl+z"

6) Click "Edit Points" to edit or delete previously placed points, do:

 Right-click a previous annotation to make it active
 Left-click a point to delete it