# ALPACA (MALPACA) TUTORIAL: K-means\_templates\_selection

**URL:** <https://discourse.slicer.org/t/alpaca-malpaca-tutorial-k-means-templates-selection/43204>\
**Category:** SlicerMorph\
**Created:** [June 3, 2025, 12:27pm UTC](https://discourse.slicer.org/t/alpaca-malpaca-tutorial-k-means-templates-selection/43204 "2025-06-03T12:27:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicola\_Calcabrini](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nicola_calcabrini/32/79984_2.png) [@Nicola\_Calcabrini](https://discourse.slicer.org/u/Nicola_Calcabrini)\
**Post date:** [June 3, 2025, 12:27pm UTC](https://discourse.slicer.org/t/alpaca-malpaca-tutorial-k-means-templates-selection/43204/1 "2025-06-03T12:27:48Z")

</div>

good morning, I’m trying the alpaca tutorial from this link: "[https://github.com/chz31/Tutorials/blob/main/MALPACA/K-means\_templates\_selection.md](https://github.com/chz31/Tutorials/blob/main/MALPACA/K-means_templates_selection.md) "  
unfortunately I can’t get past the second step, I attach screenshot to show the settings:

 ![Screenshot 2025-06-03 alle 14.24.59](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/b/4b4403e47bce0f9b819a4730ed6573dbe3da6978.png)

## I’ve tried with two different pc’s with two different slicer versions: Macbook M1 (2020) - Slicer ver. 5.7.0 ROG Zephyrus G14 - Slicer ver. 5.6.1 both generate a series of errors that I’m struggling to interpret, as I don’t have adequate knowledge of Phyton. It seems strange to me that the errors are generated by the dataset entered for the tutorial. I attach the log files for both: Mac → parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 27.568655630649662 Voxel Size is 0.499821448191199 Scaling factor is 0.997153434640227

## movingMeshPoints.shape (5021, 3) movingMeshPointNormals.shape (5021, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2093 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.16982989736096482 Best Fitness without Scaling 1.0 RMSE is 0.16982989736096482 RANSAC Duraction 28.829017877578735 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.16982989736096482 Refinement took 13 iterations After Inlier = 1.0 RMSE = 0.18650660487674556 949 87529 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 27.31930086628061 Voxel Size is 0.499821448191199 Scaling factor is 1.0062548739834791

## movingMeshPoints.shape (5182, 3) movingMeshPointNormals.shape (5182, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2145 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.1902918489735167 Best Fitness without Scaling 1.0 RMSE is 0.1902918489735167 RANSAC Duraction 28.968416929244995 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.1902918489735167 Refinement took 29 iterations After Inlier = 1.0 RMSE = 0.18982818128750228 949 88274 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 26.10924972657576 Voxel Size is 0.499821448191199 Scaling factor is 1.0528904483430859

## movingMeshPoints.shape (5036, 3) movingMeshPointNormals.shape (5036, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2045 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.21646823614800612 Best Fitness without Scaling 1.0 RMSE is 0.21646823614800612 RANSAC Duraction 28.901240825653076 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.21646823614800612 Refinement took 16 iterations After Inlier = 1.0 RMSE = 0.20428705018420934 949 77369 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 24.775053388285006 Voxel Size is 0.499821448191199 Scaling factor is 1.1095911366840807

## movingMeshPoints.shape (4852, 3) movingMeshPointNormals.shape (4852, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2008 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.23794131463500012 Best Fitness without Scaling 1.0 RMSE is 0.23794131463500012 RANSAC Duraction 29.535005807876587 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.23794131463500012 Refinement took 15 iterations After Inlier = 1.0 RMSE = 0.21661549368439323 949 67249 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 25.38223905335343 Voxel Size is 0.499821448191199 Scaling factor is 1.0830478584939502

## movingMeshPoints.shape (5281, 3) movingMeshPointNormals.shape (5281, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2128 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.2990313731952503 Best Fitness without Scaling 1.0 RMSE is 0.2990313731952503 RANSAC Duraction 30.21252417564392 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 0.9897746638894149 RMSE = 0.2937590511021508 Refinement took 18 iterations After Inlier = 0.9992425676955122 RMSE = 0.29918747735529544 949 73873 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 28.374627250030027 Voxel Size is 0.499821448191199 Scaling factor is 0.9688296310742497

## movingMeshPoints.shape (5012, 3) movingMeshPointNormals.shape (5012, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2070 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.19843935184564565 Best Fitness without Scaling 1.0 RMSE is 0.19843935184564565 RANSAC Duraction 30.628879070281982 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.19843935184564565 Refinement took 14 iterations After Inlier = 1.0 RMSE = 0.2047550117656061 949 94689 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 27.801588154001653 Voxel Size is 0.499821448191199 Scaling factor is 0.9887988951652431

## movingMeshPoints.shape (4844, 3) movingMeshPointNormals.shape (4844, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2065 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.16601349812887392 Best Fitness without Scaling 1.0 RMSE is 0.16601349812887392 RANSAC Duraction 30.84484887123108 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.16601349812887392 Refinement took 11 iterations After Inlier = 1.0 RMSE = 0.1833367014098634 949 89572 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 25.937013625507507 Voxel Size is 0.499821448191199 Scaling factor is 1.0598822226580855

## movingMeshPoints.shape (5008, 3) movingMeshPointNormals.shape (5008, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2063 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.2449635437235649 Best Fitness without Scaling 1.0 RMSE is 0.2449635437235649 RANSAC Duraction 30.988171100616455 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 0.9988019169329073 RMSE = 0.2443334550313174 Refinement took 16 iterations After Inlier = 0.9996006389776357 RMSE = 0.2514258931977246 949 74891 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 26.717470935935047 Voxel Size is 0.499821448191199 Scaling factor is 1.0289214767533106

## movingMeshPoints.shape (4956, 3) movingMeshPointNormals.shape (4956, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2082 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.26616004232244184 Best Fitness without Scaling 1.0 RMSE is 0.26616004232244184 RANSAC Duraction 33.98073410987854 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 0.9993946731234867 RMSE = 0.26584822688560517 Refinement took 17 iterations After Inlier = 1.0 RMSE = 0.2700731472736678 949 79906 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 24.344602529639285 Voxel Size is 0.499821448191199 Scaling factor is 1.1292104529965914

## movingMeshPoints.shape (5020, 3) movingMeshPointNormals.shape (5020, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 1037, in onMatchingPointsButton  
template\_density, matchedPoints, indices, files = logic.matchingPCD(  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 3167, in matchingPCD  
) = self.runSubsample(  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 2856, in runSubsample  
source\_fpfh = self.get\_fpfh\_feature(  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 2747, in get\_fpfh\_feature  
fpfh.ComputeFPFHFeature(pointset, normalset, float(radius), int(neighbors))  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/site-packages/itk/itkPointFeaturePython.py”, line 632, in ComputeFPFHFeature  
return \_itkPointFeaturePython.itkPointFeatureMF3MF3\_ComputeFPFHFeature(self, input, input\_normals, radius, neighbors)  
RuntimeError: /Users/svc-dashboard/D/P/ITKPythonPackage/ITK-source/ITK/Modules/Core/Common/include/itkPointSet.hxx:190:  
ITK ERROR: PointSet(0x600001854fc0): Point id doesn’t exist: 18446744073709551615  
[VTK] Generic Warning: In vtkMath.cxx, line 799  
[VTK] vtkMath::Jacobi: Error extracting eigenfunctions

## Zephyrus - parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 27.568655630649662 Voxel Size is 0.499821448191199 Scaling factor is 0.997153434640227

## movingMeshPoints.shape (5021, 3) movingMeshPointNormals.shape (5021, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2093 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.16982989736096482 Best Fitness without Scaling 1.0 RMSE is 0.16982989736096482 RANSAC Duraction 28.829017877578735 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.16982989736096482 Refinement took 13 iterations After Inlier = 1.0 RMSE = 0.18650660487674556 949 87529 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 27.31930086628061 Voxel Size is 0.499821448191199 Scaling factor is 1.0062548739834791

## movingMeshPoints.shape (5182, 3) movingMeshPointNormals.shape (5182, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2145 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.1902918489735167 Best Fitness without Scaling 1.0 RMSE is 0.1902918489735167 RANSAC Duraction 28.968416929244995 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.1902918489735167 Refinement took 29 iterations After Inlier = 1.0 RMSE = 0.18982818128750228 949 88274 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 26.10924972657576 Voxel Size is 0.499821448191199 Scaling factor is 1.0528904483430859

## movingMeshPoints.shape (5036, 3) movingMeshPointNormals.shape (5036, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2045 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.21646823614800612 Best Fitness without Scaling 1.0 RMSE is 0.21646823614800612 RANSAC Duraction 28.901240825653076 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.21646823614800612 Refinement took 16 iterations After Inlier = 1.0 RMSE = 0.20428705018420934 949 77369 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 24.775053388285006 Voxel Size is 0.499821448191199 Scaling factor is 1.1095911366840807

## movingMeshPoints.shape (4852, 3) movingMeshPointNormals.shape (4852, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2008 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.23794131463500012 Best Fitness without Scaling 1.0 RMSE is 0.23794131463500012 RANSAC Duraction 29.535005807876587 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.23794131463500012 Refinement took 15 iterations After Inlier = 1.0 RMSE = 0.21661549368439323 949 67249 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 25.38223905335343 Voxel Size is 0.499821448191199 Scaling factor is 1.0830478584939502

## movingMeshPoints.shape (5281, 3) movingMeshPointNormals.shape (5281, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2128 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.2990313731952503 Best Fitness without Scaling 1.0 RMSE is 0.2990313731952503 RANSAC Duraction 30.21252417564392 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 0.9897746638894149 RMSE = 0.2937590511021508 Refinement took 18 iterations After Inlier = 0.9992425676955122 RMSE = 0.29918747735529544 949 73873 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 28.374627250030027 Voxel Size is 0.499821448191199 Scaling factor is 0.9688296310742497

## movingMeshPoints.shape (5012, 3) movingMeshPointNormals.shape (5012, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2070 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.19843935184564565 Best Fitness without Scaling 1.0 RMSE is 0.19843935184564565 RANSAC Duraction 30.628879070281982 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.19843935184564565 Refinement took 14 iterations After Inlier = 1.0 RMSE = 0.2047550117656061 949 94689 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 27.801588154001653 Voxel Size is 0.499821448191199 Scaling factor is 0.9887988951652431

## movingMeshPoints.shape (4844, 3) movingMeshPointNormals.shape (4844, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2065 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.16601349812887392 Best Fitness without Scaling 1.0 RMSE is 0.16601349812887392 RANSAC Duraction 30.84484887123108 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 1.0 RMSE = 0.16601349812887392 Refinement took 11 iterations After Inlier = 1.0 RMSE = 0.1833367014098634 949 89572 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 25.937013625507507 Voxel Size is 0.499821448191199 Scaling factor is 1.0598822226580855

## movingMeshPoints.shape (5008, 3) movingMeshPointNormals.shape (5008, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2063 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.2449635437235649 Best Fitness without Scaling 1.0 RMSE is 0.2449635437235649 RANSAC Duraction 30.988171100616455 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 0.9988019169329073 RMSE = 0.2443334550313174 Refinement took 16 iterations After Inlier = 0.9996006389776357 RMSE = 0.2514258931977246 949 74891 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 26.717470935935047 Voxel Size is 0.499821448191199 Scaling factor is 1.0289214767533106

## movingMeshPoints.shape (4956, 3) movingMeshPointNormals.shape (4956, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

## FPFH generates 2082 putative correspondences. Rigid Reg, no scaling Non-Scaling Attempt = 0 Fitness = 1.0 RMSE is 0.26616004232244184 Best Fitness without Scaling 1.0 RMSE is 0.26616004232244184 RANSAC Duraction 33.98073410987854 Best Fitness after scaling 1.0

## {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} Starting Rigid Refinement Before Inlier = 0.9993946731234867 RMSE = 0.26584822688560517 Refinement took 17 iterations After Inlier = 1.0 RMSE = 0.2700731472736678 949 79906 parameters are {‘projectionFactor’: 1.0, ‘pointDensity’: 1.0, ‘normalSearchRadius’: 2.0, ‘FPFHNeighbors’: 100, ‘FPFHSearchRadius’: 5.0, ‘distanceThreshold’: 3.0, ‘maxRANSAC’: 1000000, ‘ICPDistanceThreshold’: 1.5, ‘alpha’: 2.0, ‘beta’: 2.0, ‘CPDIterations’: 100, ‘CPDTolerance’: 0.001, ‘Acceleration’: False, ‘BCPDFolder’: ‘’} :: Loading point clouds and downsampling Scale length are 27.490179650515945 24.344602529639285 Voxel Size is 0.499821448191199 Scaling factor is 1.1292104529965914

## movingMeshPoints.shape (5020, 3) movingMeshPointNormals.shape (5020, 3) fixedMeshPoints.shape (4924, 3) fixedMeshPointNormals.shape (4924, 3)

Traceback (most recent call last):  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 1037, in onMatchingPointsButton  
template\_density, matchedPoints, indices, files = logic.matchingPCD(  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 3167, in matchingPCD  
) = self.runSubsample(  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 2856, in runSubsample  
source\_fpfh = self.get\_fpfh\_feature(  
File “/Applications/Slicer.app/Contents/Extensions-33123/SlicerMorph/lib/Slicer-5.7/qt-scripted-modules/ALPACA.py”, line 2747, in get\_fpfh\_feature  
fpfh.ComputeFPFHFeature(pointset, normalset, float(radius), int(neighbors))  
File “/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/site-packages/itk/itkPointFeaturePython.py”, line 632, in ComputeFPFHFeature  
return \_itkPointFeaturePython.itkPointFeatureMF3MF3\_ComputeFPFHFeature(self, input, input\_normals, radius, neighbors)  
RuntimeError: /Users/svc-dashboard/D/P/ITKPythonPackage/ITK-source/ITK/Modules/Core/Common/include/itkPointSet.hxx:190:  
ITK ERROR: PointSet(0x600001854fc0): Point id doesn’t exist: 18446744073709551615  
[VTK] Generic Warning: In vtkMath.cxx, line 799  
[VTK] vtkMath::Jacobi: Error extracting eigenfunctions

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 3, 2025, 2:37pm UTC](https://discourse.slicer.org/t/alpaca-malpaca-tutorial-k-means-templates-selection/43204/2 "2025-06-03T14:37:39Z")

</div>

Try wirh the latest stable or a recent preview. If the issue isnt resolved, report back again here.
