ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.22k stars 381 forks source link

can't find libITKIOTransformMINC-5.3.so.1 #1814

Closed atwu closed 1 day ago

atwu commented 2 days ago

Operating system and version

Ubuntu 22.04.3 LTS

CPU architecture

x86_64 (PC, Intel Mac, other Intel/AMD)

ANTs code version

antsRegistration: error while loading shared libraries: libITKIOTransformMINC-5.3.so.1: cannot open shared object file: No such file or directory

ANTs installation type

Conda (Please include output of conda list --show-channel-urls | grep ants)

Summary of the problem

Output of conda list: $ conda list --show-channel-urls | grep ants ants 2.5.1 h00ab1b0_0 conda-forge

Code ran: warped_pet_output = os.path.join(subject_output_dir, f"{subject}_PET_warped_to_MNI.nii") apply_transform_command = [ "antsApplyTransforms", "-d", "3", "-v", "1", "-i", pet_file, "-r", mni_template_file_path, "-o", warped_pet_output, "-n", "Linear", "-t", f"{mni_out_prefix}1Warp.nii.gz", "-t", f"{mni_out_prefix}0GenericAffine.mat", "-t", f"{rigid_out_prefix}0GenericAffine.mat" ] result = subprocess.run(apply_transform_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) Error is: antsApplyTransforms: error while loading shared libraries: libITKIOTransformMINC-5.3.so.1: cannot open shared object file: No such file or directory

Commands to reproduce the problem.

I tried to see what was in my libraries, and this is what I saw:

$ ldd $(which antsApplyTransforms) ......... libITKIOTransformMINC-5.3.so.1 => not found ......... i.e. every package is found but this one. I tried looking in my anaconda lib, but it's not there either (everything else was). I tried to install ITK to see if it will patch it, but it didn't.

Output of the command with verbose output.

I stuck it in a script, but I am wondering where the package is... I tried to use find, but to no avail.

Data to reproduce the problem

Sorry I'm using in house data :( but I will say antsRegistrationSyNQuick.sh worked great as expected.

gdevenyi commented 2 days ago

Can you reproduce the error outside of your python code in the terminal.

Have you tried rebuilding your conda environment? We cannot currently reproduce your bug without a minimal working example so having steps from no-environment to demonstrating the bug are important.

cookpa commented 2 days ago

MINC support is optional but is turned on by default since v2.4.4. It's odd that it would be missing that one.

Is it possible there are multiple versions on the system, and it's confused somehow?

I just installed 2.5.4 with mamba, and it works (on my Mac) so maybe it's worth trying to update.

gdevenyi commented 1 day ago

Speaking of conda/mamba etc, I can strongly recommend micromamba as the best starting place for managing environments, https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html

atwu commented 1 day ago

Hello, I created a new conda environment and used conda-forge to download:

cookpa commented 1 day ago

Maybe related? https://github.com/conda-forge/ants-feedstock/issues/9

cookpa commented 1 day ago

If you're not required to use conda, there's static binaries on the release page that will probably work

gdevenyi commented 1 day ago

Hello, I created a new conda environment and used conda-forge to download:

  • nilearn
  • ants
  • dcm2niix Now I have having a slightly different error: antsApplyTransforms: error while loading shared libraries: libITKIOBruker-5.3.so.1: cannot open shared object file: No such file or directory

Can you please provide the exact steps you're going through so we can reproduce this. Please include the conda info

atwu commented 1 day ago

I downgraded the version for itk to 5.3 and it worked. Thanks!