dorianps / LINDA

Lesion Identification with Neighborhood Data Analysis
Apache License 2.0
21 stars 4 forks source link

Error in brain segmentation #38

Closed akelkar26 closed 2 months ago

akelkar26 commented 6 months ago

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 commented 6 months ago

Hi Apoorva,

If it worked before, it may have to do with updates in R or ANTsR. Did you install everything fresh? Can you use an older version of R. I think the image object used to be S3, not sure, and perhaps the methods are not defined well what to do with min() for the S4. Just speculating here.

If this is first time you use it, make sure the input is correct, and paste the entire history of commands.

On Mon, Mar 11, 2024, 11:05 AM Apoorva Kelkar @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/dorianps/LINDA/issues/38, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFJU7MHADB7AX5MVDNM4LDYXXI5TAVCNFSM6AAAAABEQPTOMWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TSMZXGQ4DQOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

akelkar26 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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