Installation and startup with error for vtkSimpleImageFilterExample

Hello,

I’m completely new to OpenTPS. I just installed Anaconda on my Mac (M2) through the anaconda website. I completed the quick start steps:

conda create --name OpenTPS python=3.9
conda activate OpenTPS
pip install opentps

Those were all fine and the environment is active, but when I try to run the program

opentps

I get an error:

from vtkmodules.vtkImagingGeneral import vtkSimpleImageFilterExample

ImportError: cannot import name 'vtkSimpleImageFilterExample' from 'vtkmodules.vtkImagingGeneral' (/opt/anaconda3/envs/OpenTPS/lib/python3.9/site-packages/vtkmodules/vtkImagingGeneral.cpython-39-darwin.so)

Any ideas how to fix this, or if something is missing or mis-installed?

Thanks!

Hi Kira, sorry for the delay in our answer. Can you tell us (using this command “conda list” in your environment) which version of VTK do you have?

It looks like VTK version 9.5.2. I was able to open the GUI by commenting out those lines, but it looks like my bigger problem is that I’m trying to run this on an M2 Mac, which, it sounds like, is not supported.

Hi Kira,

I think indeed that is the reason for the problem, the version of VTK supported in master is 9.2.6 (This is the one I get installed when doing the same commands you did). You could try and reinstall with the right version and let us know how it works?

Regarding the use of OpenTPS on a M2 Mac: what is your final goal? Actually, because we do not have any Mac in our team of developers, there are many things that might not be up-to-date for M2 Mac, like the MCsquare executable …let us know if you find other issues besides the VTK version

Thank you, that solved the VTK issue. But, yes, there are other incompatibilities when I try to run the plan optimization:

tried: '/opt/anaconda3/envs/OpenTPS/lib/python3.9/site-packages/opentps/core/processing/C_libraries/libRayTracingMAC.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64'))

ok yes indeed, we expected something like this. Let us discuss and we will come back to you hopefully with a solution. In the meantime, do you have access to linux/windows machine? If so, that might be the way to go until we compile the executables for compatibility