# What is the Algorithm and Theory of spin calibration?

**URL:** <https://discourse.slicer.org/t/what-is-the-algorithm-and-theory-of-spin-calibration/15434>\
**Category:** Development\
**Created:** [January 10, 2021, 11:34am UTC](https://discourse.slicer.org/t/what-is-the-algorithm-and-theory-of-spin-calibration/15434 "2021-01-10T11:34:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ungi/32/78573_2.png) [@ungi](https://discourse.slicer.org/u/ungi)\
**Post date:** [January 10, 2021, 6:12pm UTC](https://discourse.slicer.org/t/what-is-the-algorithm-and-theory-of-spin-calibration/15434/2 "2021-01-10T18:12:36Z")

</div>

@mholden8 implemented it, but haven’t published the algorithm. You can find the implementation in the source code, here: [SlicerIGT/vtkSlicerPivotCalibrationLogic.cxx at master · SlicerIGT/SlicerIGT · GitHub](https://github.com/SlicerIGT/SlicerIGT/blob/master/PivotCalibration/Logic/vtkSlicerPivotCalibrationLogic.cxx)  
It is essentially looking for the axis with least variation in the tool motion during calibration. And adds a few heuristics, e.g. for direction in the axis, it assumes that the position sensor is behind the pointer, not in front.

To explain it to someone with no math background: Calculate the rotation of the tool between two time points. That rotation has an axis direction. Then, record a series of rotations of this tool, and take the average direction of the rotation axes. That will be the final axis of rotation. If you have already computed the tip point, then make sure the pointy tip is pointing away from the tracked position, so you may need to flip the direction in the end.

---

_[View the full topic](https://discourse.slicer.org/t/what-is-the-algorithm-and-theory-of-spin-calibration/15434)._
