ANTsX / ANTsR

R interface to the ANTs biomedical image processing library
https://antsx.github.io/ANTsR
Apache License 2.0
127 stars 35 forks source link

Failing on ITK when running LINDA #380

Open ramBrain opened 1 year ago

ramBrain commented 1 year ago

Dear all,

I am trying to run LINDA from R, but this is what happens:

16:49 Starting LINDA v0.5.1
16:49 Creating folder: /mnt/d/<pathtosub>/sub-005/linda
16:49 Loading file: sub-005_ses-01_T1w_3D.nii ...
16:49 Loading template...
16:49 Skull stripping... (long process)/home/ramtin/ITKR/src/itks/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx:159:
ITK ERROR: TransformFileWriterTemplate(0x5590f9de3740): Could not create Transform IO object for writing file /tmp/RtmptlQNam/antsr24725103c3cf_InitialAff.mat
  There are no registered Transform IO factories.
  Please visit https://www.itk.org/Wiki/ITK/FAQ#NoFactoryException to diagnose the problem.

Transform file does not exist: /tmp/RtmptlQNam/antsr24725103c3cf_InitialAff.mat
Error in antsRegistration(tem, img, typeofTransform = regtype, initialTransform = initafffn,  : 
  Registration failed. Use verbose mode to diagnose.
Calls: linda_predict ... n4_skull_strip -> do.call -> <Anonymous> -> antsRegistration
Execution halted

I am on Ubuntu 22.04.1 LTS (under WSL2).

Any clue?

Thank you in advance, Ramtin

mark-vernon commented 1 year ago

I'm running into this same issue on Ubuntu 22.04 with R 4.2.2. It may be a similar problem as:

https://github.com/ANTsX/ANTsR/issues/383

ramBrain commented 1 year ago

Dear Mark,

Thank you for this, it looks similar indeed.

I eventually opted for using a docker with LINDA and all needed working libraries.

Ramtin

mark-vernon commented 1 year ago

Hi Ramtin,

Thanks for the heads up. I'll check it out

dorianps commented 1 year ago

@ramBrain thanks for posting your solution. I have not pushed Docker builds for a while, did you use the latest docker version?

LINDA has not changed in long time, so whichever version you used is the same, I am asking just for other users what worked for you.

mark-vernon commented 1 year ago

@dorianps For what it's worth, I was able to get LINDA to run on Ubuntu 22.04 without the ITK Transform Factory registration error by installing the ITKR, ANTsR (along with ANTsRCore) and LINDA via the neuroconductor source (https://johnmuschelli.com/neuroc/installing_ANTsR/index.html) from within R after first installing a older version of clang (v11.1.0-6) which is available in the ubuntu 22.04 repo. ANTsR had been failing to install with an incompatible compiler error from an ITK function. I installed clang-11, recompiled ITKR, ANTsRCore, ANTsR, then LINDA and was able to run LINDA with no error! It seems as though the root of the issue is that ITKR needs to be made compatible with the newer versions of clang (v14) which is the default in Ubuntu 22.04. Hope someone finds this helpful, thanks!

ramBrain commented 1 year ago

@ramBrain thanks for posting your solution. I have not pushed Docker builds for a while, did you use the latest docker version?

LINDA has not changed in long time, so whichever version you used is the same, I am asking just for other users what worked for you.

I used the latest version indeed, and worked smoothly