ALPACA not working

Hi all,

I’m using the ALPACA in SlicerMorph to register two cardiac models. However, when I clicked “Run ALPACA”, no results were shown. (see the screenshot below)

Here’s my steps:

  1. load two .stl files as the target and the source model
  2. use the “PseudoLMGenerator” to generate landmarks for the source model
  3. run ALPACA

And here is the output:

There’s an error jumped out:

Traceback (most recent call last):
File “F:/Slicer 5.2.1/NA-MIC/Extensions-31317/SlicerMorph/lib/Slicer-5.2/qt-scripted-modules/ALPACA.py”, line 448, in onRunALPACAButton
self.transformMatrix = logic.estimateTransform(self.sourcePoints, self.targetPoints, self.sourceFeatures, self.targetFeatures, self.voxelSize, self.ui.skipScalingCheckBox.checked, self.parameterDictionary)
File “F:/Slicer 5.2.1/NA-MIC/Extensions-31317/SlicerMorph/lib/Slicer-5.2/qt-scripted-modules/ALPACA.py”, line 1325, in estimateTransform
ransac = self.execute_global_registration(sourcePoints, targetPoints, sourceFeatures, targetFeatures, voxelSize,
File “F:/Slicer 5.2.1/NA-MIC/Extensions-31317/SlicerMorph/lib/Slicer-5.2/qt-scripted-modules/ALPACA.py”, line 1445, in execute_global_registration
evaluation = registration.evaluate_registration(target_down, source_down, distance_threshold, np.linalg.inv(result.transformation))
File “<array_function internals>”, line 180, in inv
File “F:\Slicer 5.2.1\lib\Python\Lib\site-packages\numpy\linalg\linalg.py”, line 552, in inv
ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
File “F:\Slicer 5.2.1\lib\Python\Lib\site-packages\numpy\linalg\linalg.py”, line 89, in _raise_linalgerror_singular
raise LinAlgError(“Singular matrix”)
numpy.linalg.LinAlgError: Singular matrix

Does anyone have any ideas why the ALPACA is not working? Thanks in advance!

Best,
Gening

The error indicates RANSAC step failed to do Singular Matrix. If you can share your models it will be easier for us to troubleshoot or tell you why it failed.

Thanks for the reply! Please see below for the target and source models.

https://drive.google.com/drive/folders/1v9oAierGHOx5GLYkLU0L3OvafjoTSpYv?usp=share_link

if you skip the scaling and the projection (check mark them), ALPACA will run. However, result is not going to be usable. Models are quite different from each other and has unmatched parts (like a bifurcating structure that doesn’t exist in the other one).

ALPACA wasn’t never intended to work with such geometries.

Thanks for the clarification! I was hoping it can register between models with different geometries by increasing the landmark density. But now I guess it won’t work. Could you please suggest any other approaches/algorithms might be able to register such geometries? Thanks much!