Saggittaman
(Arthur Van Damme)
August 18, 2021, 2:58pm
1
Hello everyone,
I created a model with a symmetry plane and I would like to project a bunch of fiducials from one side to the other side of this plane symmetrically. Do someone know if it’s possible to do this and if yes how to ?
Thanks a lot in advance !
muratmaga
(Murat Maga)
August 18, 2021, 4:54pm
2
I think this part of the PseudoLMGenerator module from SlicerMorph will be helpful for you:
def clipAndMirrorWithPlane(self, inputData, plane):
normal=[0,0,0]
origin=[0,0,0]
plane.GetNormalWorld(normal)
plane.GetOriginWorld(origin)
vtkPlane = vtk.vtkPlane()
vtkPlane.SetOrigin(origin)
vtkPlane.SetNormal(normal)
clipper = vtk.vtkClipPolyData()
clipper.SetClipFunction(vtkPlane)
clipper.SetInputData(inputData)
clipper.Update()
mirrorMatrix = vtk.vtkMatrix4x4()
mirrorMatrix.SetElement(0, 0, 1 - 2 * normal[0] * normal[0])
mirrorMatrix.SetElement(0, 1, - 2 * normal[0] * normal[1])
mirrorMatrix.SetElement(0, 2, - 2 * normal[0] * normal[2])
mirrorMatrix.SetElement(1, 0, - 2 * normal[0] * normal[1])
mirrorMatrix.SetElement(1, 1, 1 - 2 * normal[1] * normal[1])
This file has been truncated. show original