Hello,
I am new to Slicer, tying to learn ALPACA in SlicerMorph.
I am following the steps described here.
When I click on “Run subsampling”, an error occurs : Import Error: cannot import name ‘registration’
I wonder how to solve the problem. Any advice would be appreciated.
Operating system: Windows 10 Pro
Slicer version: 4.11.20210226 r29738 / 7a593c8
Expected behavior: getting a target mesh
Actual behavior: an error occurs
This is a bit strange because I can’t replicate this error on any of my windows 10 computer with the latest stable (which is what you are runngin). Can you provide a screen capture of the settings (and copy and paste the entire log file) @smrolfe@agporto ?
Can you check your open3d version?
The easiest way is to go to the python interpreter within Slicer and type:
import open3d open3d.__version__
The reason for that is that open3d reorganized some modules from one version to another. So, you would have to pip_uninstall(‘open3d’ and then pip_install(‘open3d==0.10.0’)
That should solve it
@agporto you can enforce a particular open3d version similarly to how it is done here.
I maintain that this open3d package is a hodge-podge of random stuff and there are lots of red flags in the code and how it is managed. Even though it contains some useful algorithms and the package may improve in the future, I would recommend to look for alternatives if you want to avoid unnecessary trouble.
Thanks @lassoan . It is good to know there is a way to check the installed version. Normally, users would have version 0.10.0 installed by default, as Murat mentioned. But it seems this user manually installed open3d from the python interpreter.
I also agree with regard to the issue of having external dependencies (such as open3d). However, outside of Sara (who is the main developer on SlicerMorph and has a lot of stuff on her plate), we don’t really have a dedicated developer that could tackle this issue in the short term. So, at least for now, we have to rely on these dependencies to some extent.
Just to be clear with what happened to me as far as I can remember:
I opened ALPACA for the first time and the installation of open3d automatically started.
But after that I still could not open ALPACA correctly (the two tabs did not appear).
So I thought there was something wrong with the installation of open3d. So I ran pip_install(“open3d”) (which probably overwrote the version 0.10 with 0.12). After this, I also found out that pycpd was not automatically installed (I don’t know if this is default). So I ran pip_install(“pycpd”) and finally ALPACA opened. But naturally, the version of open3d is different, which caused an error.
So my problem was that pycpd was not automatically installed, so ALPACA did not open. But I misinterpreted it as a problem of open3d and replaced it with a newer version. I wonder if pycpd is supposed to get automatically installed when opening ALPACA for the first time. This happened again today using another computer.
Interesting. Thanks for the follow up. One quick question, do you have git installed on those machines? I am wondering if the pycpd installation is not happening because of git
If there are known problems with any Python package versions then you can use the code snippet in the DICOMweb module that I referenced above. It does a few important things:
forces installation of the correct version of the package (if the installed version is unacceptable, even if import succeeds)
automatically restarts the application if needed (typically you need to restart the application if the package is already imported and you want to replace it with a different version)
it keeps the user informed about what’s happening and why (the user can just click OK, but has the option to interrupt the process, for example if that’s needed by some other modules).