I am studing the calibration and researched many publicatioins but get nothing about the spin calibration. I tend to know what is the Algorithm and Math Theory of spin calibration?

@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

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.

In case it helps, here are my notes on the “theory”: Holden_SpinCalibration.pdf - Google Drive.

Thank you very much.

Thank you for helping me find the information I needed

I collected a stack of transform data(np.array([matrix][matrix][matrix]…)) and I tend to use this algorithm in 3d slicer to get the transform to calibrate the spin axis.I have tried this but seems not correct.

calibrationSuccess = slicer.modules.pivotcalibration.logic().ComputeSpinCalibration()

I donnot know how to set up the input data, or should I use ‘AddToolToReferenceMatrix(…)’ one by one?