This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a markups fiducial node and place 6 points then copy paste this code into 3D Slicer's Python console. | |
# Two circles will be created (one for each 3 points) and the axis will be computed by connecting their centers. | |
# The circles and the axis is updated as the fiducial point positions are adjusted. | |
def sphereFrom3Points(markupsNode, startPointIndex): | |
"""Compute center and radius of 3-point sphere from 3 fiducial points | |
source: https://stackoverflow.com/questions/20314306/find-arc-circle-equation-given-three-points-in-space-3d | |
""" | |
import numpy as np | |
A = np.zeros(3) |