mghro / rad-collision

Platform for collision detection during treatment planning in radiotherapy
GNU General Public License v3.0
32 stars 13 forks source link

DSC: make more efficient #4

Open ferdymercury opened 4 years ago

ferdymercury commented 4 years ago

Instead of using DSC, choose a more efficient algorithm to calculate ROI overlap

ferdymercury commented 4 years ago

RS has been contacted.

ferdymercury commented 4 years ago

see also http://vtk.1045678.n5.nabble.com/collision-detection-with-vtk-td5722845.html

ferdymercury commented 3 years ago

if vtk package is available in IronPython, one could use:

collide = vtk.vtkCollisionDetectionFilter()
collide.SetInputData(0, vpolydata1)
collide.SetInputData(1, vpolydata22)
collide.SetTransform(0, vtk.vtkTransform())
collide.SetMatrix(1, vtk.vtkMatrix4x4())
collide.SetBoxTolerance(0.0)
collide.SetCellTolerance(0.0)
collide.SetNumberOfCellsPerNode(2)
collide.SetCollisionModeToFirstContact()
collide.GenerateScalarsOn()
collide.Update()
collision = collide.GetNumberOfContacts() > 0