# How to set the input transforms for calibration

**URL:** <https://discourse.slicer.org/t/how-to-set-the-input-transforms-for-calibration/15533>\
**Category:** Development\
**Created:** [January 15, 2021, 1:37am UTC](https://discourse.slicer.org/t/how-to-set-the-input-transforms-for-calibration/15533 "2021-01-15T01:37:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 15, 2021, 1:37am UTC](https://discourse.slicer.org/t/how-to-set-the-input-transforms-for-calibration/15533/1 "2021-01-15T01:37:27Z")

</div>

I collected a stack of transform data(np.array([matrix][matrix][matrix]…)) in different times and I tend to use spin calibration in 3d slicer to get the transform to calculate the spin axis.I have tried this code but seems not correct.  
`calibrationSuccess = slicer.modules.pivotcalibration.logic().ComputeSpinCalibration()`  
I donnot know how to set up the input datas, and I also tried ‘AddToolToReferenceMatrix(…)’ one by one, but the slicer was crashed.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 15, 2021, 1:41am UTC](https://discourse.slicer.org/t/how-to-set-the-input-transforms-for-calibration/15533/2 "2021-01-15T01:41:26Z")

</div>

You need to convert the numpy array to VTK matrix using [slicer.util.vtkMatrixFromArray](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#slicer.util.vtkMatrixFromArray).
