siavashk / pycpd

Pure Numpy Implementation of the Coherent Point Drift Algorithm
MIT License
513 stars 115 forks source link

Axis out of bounds error #1

Closed aalavandhaann closed 7 years ago

aalavandhaann commented 7 years ago

When I tried testing the data containing 3d point clouds an error occurred in the _makeKernel module. The error is as mentioned below

Traceback (most recent call last): File "fishDeformable.py", line 39, in <module> main() File "fishDeformable.py", line 35, in main reg.register(callback) File "/home/ashok/libraries/Python-CPD-master/core/DeformableRegistration.py", line 26, in register self.initialize() File "/home/ashok/libraries/Python-CPD-master/core/DeformableRegistration.py", line 82, in initialize self._makeKernel() File "/home/ashok/libraries/Python-CPD-master/core/DeformableRegistration.py", line 112, in _makeKernel diff = np.sum(np.multiply(diff, diff), self.D); File "/usr/local/lib/python3.4/dist-packages/numpy/core/fromnumeric.py", line 1840, in sum out=out, keepdims=keepdims) File "/usr/local/lib/python3.4/dist-packages/numpy/core/_methods.py", line 32, in _sum return umr_sum(a, axis, dtype, out, keepdims) ValueError: 'axis' entry is out of bounds

Looks like the axis value is not supportive for 3D yet. Otherwise the algorithm works fine for 2D cases. Since I am not that much familiar with this algorithm, is it possible for the author to make known the possible fix?

Regards,

0K

siavashk commented 7 years ago

I have added a fix. There is also an example for 3D point clouds under tests/fishDeformable3D.py

I am closing this issue, but feel free to reopen it if the fix does not work for you.

aalavandhaann commented 7 years ago

I hereby confirm that the code works fine with 3D datasets too. Thanks to the author for fixing it quick