Skip to content

Commit 4cad5d4

Browse files
authored
Remove usage of deprecated annotation ruler node
Annotations module will be removed in Slicer-4.3
1 parent b7f7819 commit 4cad5d4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

SlicerDevelopmentToolboxUtils/mixins.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,8 @@ def get3DDistance(p1, p2):
539539

540540
@staticmethod
541541
def get3DEuclideanDistance(pos1, pos2):
542-
rulerNode = slicer.vtkMRMLAnnotationRulerNode()
543-
rulerNode.SetPosition1(pos1)
544-
rulerNode.SetPosition2(pos2)
545-
distance3D = rulerNode.GetDistanceMeasurement()
546-
return distance3D
542+
import numpy as np
543+
return np.linalg.norm(np.array(pos1)-np.array(pos2))
547544

548545
@staticmethod
549546
def dilateMask(label, dilateValue=1.0, erodeValue=0.0, marginSize=5.0):

0 commit comments

Comments
 (0)