dorianps / LESYMAP

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

Example dataset #18

Closed mkcyeung closed 4 years ago

mkcyeung commented 4 years ago

Hi,

I am new to lesion-symptom mapping and excited to try out the mulitvariate LSM.

I am running LESYMAP on a windows machine, under the Linux subsystem. I was able to run the two demo scripts available online, one with the univariate VLSM and the other one with the multivariate LSM. I can replicate the results and generate the same figures as shown online.

However, I found something strange after carrying out some testing. The demo scripts can still run smoothly even after I deleted all the .nii.gz files from the "lesions" folder (see the screenshot below). As you can see, the variable "filenames" should have been empty, but it was not. The output looked the same as before. The file path seems fine...

aaa

R (version 3.6.2) might have already loaded the files into the workspace or something. So I restarted Ubuntu/R and repeated the process. I got the same output.

I am wondering what might be causing that.

Thanks, Michael

dorianps commented 4 years ago

I suspect the files were not deleted, because the filenames would not in the system when the folder is read:

filenames = Sys.glob(file.path(lesydata, 'lesions', 'Subject*.nii.gz'))

Could it be that you installed lesymap as root using sudo and then tried to delete as normal user, which prevented you form deleting anything. Try:

sudo rm -f /home/labuser/R/x84_64-pc-linux-gnu-library/3.6/LESYMAP/extdata/lesions/*

Also note, there is a docker variant of LESYMAP which I think performs better than WSL: https://github.com/dorianps/docker

mkcyeung commented 4 years ago

Hi Dorian,

Yes I installed lesymap as root using sudo. The sudo rm -f code works! What should I do to add the files back to path?

Thanks, Michael

dorianps commented 4 years ago

Get the zip file from GitHub, unzip, and copy them where they were. Or reinstall lesymap.

On Wed, Dec 18, 2019, 6:30 PM mkcyeung notifications@github.com wrote:

Hi Dorian,

Yes I installed lesymap as root using sudo. The sudo rm -f code works! What should I do to add the files back to path?

Thanks, Michael

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dorianps/LESYMAP/issues/18?email_source=notifications&email_token=ACFJU7J27L7KMXB5DS6IAZTQZKXCXA5CNFSM4J4TNN5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHH3ALI#issuecomment-567259181, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFJU7PJ4EAWGM2VUFXKTHTQZKXCXANCNFSM4J4TNN5A .

mkcyeung commented 4 years ago

Hi Dorian,

I copied the 131 .nii.gz back to the folder and ran the code again. The "filenames" was still empty.

abc

To be honest, i am quite new to Linux/Ubuntu.

Thanks, Michael

dorianps commented 4 years ago

You can run again the devtools install command and it will hopefully just install lesymap again, without reinstalling antsr (if antsr did not have any new git commit since you installed it). Let.me know if you still need help. The docker solution might be more appropriate for you.

On Wed, Dec 18, 2019, 6:49 PM mkcyeung notifications@github.com wrote:

Reopened #18 https://github.com/dorianps/LESYMAP/issues/18.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dorianps/LESYMAP/issues/18?email_source=notifications&email_token=ACFJU7P5WA57IBJX465ATB3QZKZJRA5CNFSM4J4TNN5KYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOVSKLC3Q#event-2895425902, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFJU7PBFAEDIV5KH4X3RKLQZKZJRANCNFSM4J4TNN5A .

mkcyeung commented 4 years ago

Hi Dorian,

Thanks for the prompt reply!

I ran the devtools install command, and it seems that everything was reinstalled. Then I ran the example script again, this time I got no plotted results (i.e., no figure popped out), although the script ran ok. I got plotted results before the reinstallation.

I tried: sudo rm -f /home/labuser/R/x84_64-pc-linux-gnu-library/3.6/LESYMAP/extdata/lesions/* But no files were deleted. The "filenames" also did not change.

My understanding is that if I can get the example scripts work, I can then simply replace behavior.txt and the *.nii.gz files under the "extdata" folder by my data set, and run the scripts again. Is that right? My question is how to load my data set in R and run lesymap on it.

I found the Doctor Pull command docker pull dorianps/lesymap in the Docker Hub. What should I do with it?

Thanks a lot for your help! Michael

dorianps commented 4 years ago

@mkcyeung it does not work that way. You should not touch the installation location. Instead put all your nii.gz files in a folder, then put the filenames in an R variable, just like the ones in the example. The behavior filename can also go in another variable, and pass those to lesymap(filenames,behavior).

All nifti files need to be in the same template space, LESYMAP will do some checks automatically to make sure they are.

If you are new to R, I suggest you start with a brief tutorial online to understand how it works.

The docker solution will ask you which folder you want to share with the virtual environment (you need to have the folder sharing enabled in the docker settings). But since you don't have any experience with any of these concepts, maybe you can continue with wsl for now. I plan to make a video on how the docker solution works, not soon though.

mkcyeung commented 4 years ago

I copied and pasted the two demo folders (i.e., lesions and behavior) to desktop, and used the new paths (C:/Users/labuser/Desktop/lesions/Subject*.nii.gz; 131 rows) and (C:/users/labuser/Desktop/behavior/behavior.txt; 1 row) as the filenames and behavior variables, respectively.

I then ran this in the wsl: list.files("C:/Users/labuser/Desktop/lesions/", pattern = NULL, all.files = FALSE, full.names = FALSE) The output is character(0), suggesting that R could not detect these two folders, as if they did not exist.

I also ran the same code using the the R outside the wsl (i.e., the window version of R). The 131 .nii.gz file names were shown in the output.

So do I have to put in some code in the wsl to grant permission or something to these folders, so they can be identified in the wsl?

Thank you.

dorianps commented 4 years ago

WSL cannot see the Windows path like that. I think the C drive is in /mnt/c/Users...etc.

Use ls command to explore folders in Linux.

On Thu, Dec 19, 2019, 9:58 PM mkcyeung notifications@github.com wrote:

I copied and pasted the two demo folders (i.e., lesions and behavior) to desktop, and used the new paths (C:/Users/labuser/Desktop/lesions/Subject*.nii.gz; 131 rows) and (C:/users/labuser/Desktop/behavior/behavior.txt; 1 row) as the filenames and behavior variables, respectively.

I then ran this in the wsl: list.files("C:/Users/labuser/Desktop/lesions/", pattern = NULL, all.files = FALSE, full.names = FALSE) The output is character(0), suggesting that R could not detect these two folders, as if they did not exist.

I also ran the same code using the the R outside the wsl (i.e., the window version of R). The 131 .nii.gz file names were shown in the output.

So do I have to put in some code in the wsl to grant permission or something to these folders, so they can be identified in the wsl?

Thank you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dorianps/LESYMAP/issues/18?email_source=notifications&email_token=ACFJU7PVSUARYFMIFN63QY3QZQYGBA5CNFSM4J4TNN5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHLW3XI#issuecomment-567766493, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFJU7LVO3RWOEAK5R7T6E3QZQYGBANCNFSM4J4TNN5A .

mkcyeung commented 4 years ago

Thanks for the quick reply. But I still have no idea why the two folders can't be found in the current working directory. I used the ls command.

Untitled
dorianps commented 4 years ago

I am affraid you need help beyond the functionality of lesymap. You will need to understand how files and folders appear in WSL. As I said, that is a Linux system and the Windows folders are mounted at a different location from what you are used to see in Windows. I suggest you search online how WSL interfaces with Windows.

On Thu, Dec 19, 2019, 10:23 PM mkcyeung notifications@github.com wrote:

Thanks for the quick reply. But I still have no idea why the two folders can't be found in the current working directory. I used the ls command.

[image: Untitled] https://user-images.githubusercontent.com/54640402/71227662-fb5bb780-22ad-11ea-8dfa-112f8f1b18ed.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dorianps/LESYMAP/issues/18?email_source=notifications&email_token=ACFJU7MWXCMLY6C6INMAAZTQZQ3BZA5CNFSM4J4TNN5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHLYDBY#issuecomment-567771527, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFJU7OTCUG4D5TGVBGC3T3QZQ3BZANCNFSM4J4TNN5A .

dorianps commented 4 years ago

Closing, reopen if necessary.