Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in brain segmentation #38

Closed
akelkar26 opened this issue Mar 11, 2024 · 4 comments
Closed

Error in brain segmentation #38

akelkar26 opened this issue Mar 11, 2024 · 4 comments

Comments

@akelkar26
Copy link

akelkar26 commented Mar 11, 2024

Hi Dorian,

I hope you are doing well.
I am using LINDA on R version 4.3.2.
I installed ANTsR and ANTsRCore and ITK and LINDA.
On running LINDA (v 0.5.1), I get this following error during skull-stripping.

`> library(LINDA)
Warning message:
replacing previous import 'ANTsR::integrateVelocityField' by 'ANTsRCore::integrateVelocityField' when loading 'LINDA'

filename = '/Users/neurouser1/Documents/BICD/LINDA_T1ws/ST047_T1w.nii.gz'
outputs = linda_predict(filename)
10:42 Starting LINDA v0.5.1
10:42 Creating folder: /Users/neurouser1/Documents/BICD/LINDA_T1ws/linda
10:42 Loading file: ST047_T1w.nii.gz ...
10:42 Loading template...
10:42 Skull stripping... (long process)Error in min(dseg) : invalid 'type' (S4) of argument`

I tried it on both the zipped nifti and unzipped nifti files.

Could you provide insight on why I might be getting this error?

Thank you
Best,
Apoorva

@dorianps
Copy link
Owner

dorianps commented Mar 11, 2024 via email

@akelkar26
Copy link
Author

Hi @dorianps ,

Hope you are well.
As suggested, I installed an older version of R - R 4.2.2

I am however getting a different error now:

`library(LINDA)
Warning messages:
1: replacing previous import ‘ANTsR::fastMarchingExtension’ by ‘ANTsRCore::fastMarchingExtension’ when loading ‘LINDA’
2: replacing previous import ‘ANTsR::antsImageMutualInformation’ by ‘ANTsRCore::antsImageMutualInformation’ when loading ‘LINDA’
3: replacing previous import ‘ANTsR::robustMatrixTransform’ by ‘ANTsRCore::robustMatrixTransform’ when loading ‘LINDA’

filename='/ifs/groups/medagliaGrp/UCD_BICD/lesion_drawings/Nifti/sub-MR2079/ses-BRAINRESEARCHCOSLETT/anat/sub-MR2079_ses-BRAINRESEARCHCOSLETT_T1w.nii.gz'
outputs = linda_predict(filename)

10:16 Starting LINDA v0.5.1
10:16 Creating folder: /ifs/groups/medagliaGrp/UCD_BICD/lesion_drawings/Nifti/sub-MR2079/ses-BRAINRESEARCHCOSLETT/anat/linda
10:16 Loading file: sub-MR2079_ses-BRAINRESEARCHCOSLETT_T1w.nii.gz ...
10:16 Loading template...
10:16 Skull stripping... (long process)Error in h(simpleError(msg, call)) :
error in evaluating the argument 'i' in selecting a method for function '[<-': operations are possible only for numeric, logical or complex types`

Could you help with this error?
Would you suggest installing an R version 3 to resolve this issue?

Awaiting your reply.
Thank you
Best,
Apoorva

@dorianps
Copy link
Owner

Hi Apoorva, and very sorry for the delay, this skipped my memory and I just remembered.

I am not familiar with this new error, looks like it is deep in R but I am not sure what is causing it. I don't have LINDA installed for now, and may need to troubleshoot this later. But here is what you could try for now:

  1. The warnings you see at the beginning are related to the recent refactoring of ANTsR, and show that some ANTsR functions are masked by ANTsRCore functions, which should not happen normally. We had this issue with LESYMAP and I managed to fix it. Please try running library(ANTsR) before running LINDA. You should see similar warnings but this time ANTsR will take over ANTsRCore, which is what we want. Try running LINDA again and see if that works. Let me know if that resolved the problem so I can fix LINDA.
  2. You can use an old docker container with LINDA in it. LINDA has not changed in years, so it should be fine. Check the instructions how to use it here: https://github.com/dorianps/docker

Hope it helps.

@akelkar26
Copy link
Author

Hi Dorian,

The first solution you suggested didn't work and gave the same error. However, the docker container worked great!
Thank you so much for all your help with this.
Also, this software is amazing. The lesion tracings have been predicted well for the subjects I tried.

Thank you
Best,
Apoorva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants