ITK Install issues on VS2022

Dear all,
I was trying to install ITK for transforming the .TRE files from ITKTubeTK - Bullitt - Healthy MR Database to common image format for phantom for several days. My environment is python 3.10, ITK 5.2.1/ITK 5.3rc02, VS2022, and win11. First I tried to install via python package, there was a legacy-install-failure error and I cannot find solution for it. So I turned to install via source code via Cmake 3.22.2, I followed several install tutorials and installed for several times, and there was an error “could not find git for clone of TubeTK” during configure process when I select the ModuleITKtubeTK. I ignored and configured to generate. But after the build process, there were 95 errors of “cannot open file ‘python310_d.lib’” and 787 warnings of “‘Pyeval_initthread’: deprecated in 3.9”.

Thanks
Xiang

If you want to build Python wrappings in Debug mode, you need to install “Debug” python library. This is off by default. Also, code compiled that way would be very slow.

Recommended way is to build in RelWithDebInfo mode, which can be link to regular Python install. It can debugged if needed, but some/many symbols will be unavailable because they were optimized away.

The latest ITK 5.3rc03 is highly recommended.

@Stephen_Aylward is enabling Module_TubeTK during ITK configure a good/supported way of building TubeTK?

Thank u so much for the quick response. Are the ITK 5.3rc03 is on Github? I just downloaded the rc02 from ITK.org. I will search for how to change the build mode.

Thx
Xiang

Yes, 5.3RC3 is tagged on GitHub. It is not on itk.org because we haven’t made a public announcement yet.

Yes. It is recommended to enable Module_TubeTK during initial configuration.

Note that TubeTK also requires (recommends unless disabled) VTK. Compile VTK in the same mode (Release/Debug/whatever) that you intended to use with ITK. Python wrapping is also supported in VTK, but not required.

Hi Stephen, I downloaded the ITK nightly master from Github, actually after enabled the TubeTK I got an error during configure process
CMake Error at CMake/ITKModuleRemote.cmake:12 (message):
Failed to clone repository:
‘https://github.com/InsightSoftwareConsortium/ITKTubeTK.git’
Call Stack (most recent call first):
CMake/ITKModuleRemote.cmake:134 (_git_clone)
CMake/ITKModuleRemote.cmake:236 (_fetch_with_git)
Modules/Remote/TubeTK.remote.cmake:47 (itk_fetch_module)
Modules/Remote/CMakeLists.txt:10 (include)

That could have been a glitch in the internet. Could you please try a second time. It is suggesting that the GitHub repo doesn’t exist, and it does, so …

1 Like

Yes, that is an internet issue and got fixed. Nevertheless, I now got another cmake error Could NOT find NumPy (missing: PYTHON_NUMPY_INCLUDE_DIR) (found version “”)

Pip install numpy

Before running cmake to configure itk.

S

Hello Stephen, I recently downloaded the nightly master versions of VTK and ITK and compiled them to build. Nevertheless, During the build of install project with VS 2022 run as admin, I met an error called "MSB3073 The command "setlocal ". I searched on websites, and answers were given with permission issues. But I already run VS as admin, Thanks for your patience!

Hi

Please post this as a new topic thread. I have no experience with vs2022, but I bet others do. Starting another thread will help them see your post and offer solutions.

I will do, thx a lot

To “install” a project into a system location such as C:\Program Files\ you need to start Visual Studio “as Administrator”. Even if your user is a member of the Administrators group (like mine is).

Thx guys, I have tried several times in win11, eventually succeed in another PC with win10. win11 is trash:), thx a lot for your help.