dorianps / LESYMAP

Lesion to Symptom Mapping in R
https://dorianps.github.io/LESYMAP/
Apache License 2.0
32 stars 11 forks source link

error using antsImageRead on ICBM skull mask #6

Closed hanayik closed 6 years ago

hanayik commented 6 years ago

Hi Dorian. I'm a graduate student working with Chris Rorden. I've encountered a very peculiar error when running registerLesionToTemplate.

The script seems to fail when it gets to the line reading in the ICBM skull mask (using R 3.4.4. haven't testing with another version). ANTsR and ANTsRCore were installed through LESYMAP per your install instructions for LESYMAP.

I have downloaded the suspect image directly from the LESYMAP repo separately (I was hoping that maybe just my installed version was corrupt), and it still results in a fatal R session crash with the following command:

antsImageRead('/home/research/Downloads/mni_icbm152_t1_tal_nlin_sym_09c_mask_skullnoface.nii.gz')

However, if I change the data type to short (int16) using FSL:

fslmaths /home/research/Downloads/mni_icbm152_t1_tal_nlin_sym_09c_mask_skullnoface.nii.gz -add 0 /home/research/Downloads/mni_icbm152_t1_tal_nlin_sym_09c_mask_skullnoface_int16.nii.gz -odt short

the image can be read in with no problem and the image data types now match the brain mask template from your same folder as well

antsImageRead('/home/research/Downloads/mni_icbm152_t1_tal_nlin_sym_09c_mask_skullnoface_int16.nii.gz')

The fixed file is attached if you want to add it to the repo. I couldn't get anything to work in LESYMAP until I fixed this problem. Might be helpful to others. mni_icbm152_t1_tal_nlin_sym_09c_mask_skullnoface_int16.nii.gz

dorianps commented 6 years ago

Hi @hanayik

Thank you for troubleshooting this yourself. I am trying to reproduce the error but everything works fine in R 3.4.4 (Ubuntu 16.04). What platform/OS do you use? Can you try to load again the original image and post the error you see?

hanayik commented 6 years ago

@dorianps I am using Ubuntu 16.04. I was able to resolve the problems by installing everything from scratch again. I had found a forum post where someone else had issues with a package after installing through Rstudio, and they report that an install using the standard R terminal worked out better. I went that route (install using commands in R terminal) and that solved all my issues. So it looks to be an odd interaction with Rstudio. Everything works now. I'm not going to debug that, but it does not seem to be an issue with LESYMAP at all.

Thanks!

dorianps commented 6 years ago

Glad it worked out. I wouldn't be surprised if this was a memory issue, if you are using Ubuntu as a virtual machine. Just something to keep in mind if the problem represent. I had to manually increase the cache file in Windows and restart before seeing more available swap in Ubuntu WSL.

hanayik commented 6 years ago

@dorianps Thanks, def not a mem issue though. Ubuntu is installed on a dedicated machine with 32 GB of mem. I definitely think there was an odd interaction (maybe permissions?) with how Rstudio was handling everything. To get it to work, I installed it all, then just opened Rstudio after and it all worked. Haven't tried on MacOS, but I expect it to work well.