Skip to content

Commit 6686462

Browse files
author
dipterix
committed
fixed readme
1 parent 1bec514 commit 6686462

File tree

1 file changed

+34
-19
lines changed

1 file changed

+34
-19
lines changed

README.md

+34-19
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
* For function usage, check [Reference page](https://dipterix.github.io/threeBrain/reference/index.html)
1818
* Check [keyboard shortcuts](https://dipterix.github.io/threeBrain/shortcuts.html) here
1919

20+
#### System Requirement
21+
22+
* **Web Browsers**: the viewer uses `WegGL2` to render in browsers. Please check [this list](https://caniuse.com/?search=webgl2) to see compatible browsers. As of 2020, **Chrome** and **Firefox** have full supports.
23+
- For **Safari** users, please enable this feature by going to `Safari` > `Preferences`, click `Advanced`, then select `Show Develop menu in menu bar`; then click `Develop` in the menu bar, go to `Experimental Features` > `WebGL 2.0`. This only needs to be done once.
24+
2025
## A. Installation
2126

2227
1. [`R`](https://cran.r-project.org/) and [`RStudio Desktop (Free Version)`](https://www.rstudio.com/products/rstudio/download/)
@@ -26,8 +31,8 @@ install.packages("threeBrain")
2631
```
2732
If you want to install `dev` version from *Github*, then use:
2833
```r
29-
install.packages("devtools")
30-
devtools::install_github("dipterix/threeBrain")
34+
install.packages("remotes")
35+
remotes::install_github("dipterix/threeBrain")
3136
```
3237
3. (Optional) Setups: after installation, in `RStudio` console, type the following command
3338
```r
@@ -37,39 +42,47 @@ and follow the instructions.
3742

3843
## B. Basic Brain Viewer
3944

40-
Once finishing setting up of `threeBrain`, there will be a template subject `N27` (Collin's 27) created at
41-
```
42-
~/rave_data/others/three_brain/N27
45+
Once finishing setting up of `threeBrain`, there will be a template subject `N27` (Collin's 27) created locally. The location is platform-related. You can find it by running the following command:
46+
47+
```r
48+
library(threeBrain)
49+
50+
default_template_directory()
51+
#> [1] "/Users/dipterix/Library/Application Support/
52+
#> org.R-project.R/R/threeBrain/templates"
4353
```
44-
`~` is your home directory. For example on my laptop, it's `/Users/dipterix/`. On Windows, it's `C:\Users\dipterix\`.
4554

46-
Let's view this subject. The following commands all go to `RStudio` console.
55+
**N27** template folder resides inside of this directory.
56+
57+
Let's view this subject using the `freesurfer_brain2` function.
4758

4859
1. Import subject
4960
```r
50-
# freesurfer_brain is deprecated, use freesurfer_brain2 instead
51-
n27 = freesurfer_brain2(
52-
fs_subject_folder = '~/rave_data/others/three_brain/N27',
53-
subject_name = 'N27',
54-
surface_types = 'pial'
55-
)
61+
library(threeBrain)
62+
63+
n27_path <- file.path(default_template_directory(), "N27")
64+
65+
x <- freesurfer_brain2( fs_subject_folder = n27_path,
66+
subject_name = 'N27', surface_types = 'pial')
5667
```
5768
2. Visualize
5869
```r
59-
plot(x) # alternatively, you can use `x$plot()`
70+
plot(x) # alternatively, you can use `n27$plot()`
6071
```
6172

62-
## C. Directory Setup
73+
## C. Subject Setup
6374

64-
`~/rave_data/others/three_brain/N27` is a sample generated by `FreeSurfer` ([download](https://surfer.nmr.mgh.harvard.edu/fswiki/DownloadAndInstall)). If you have any subjects processed by `FreeSurfer`, direct `fs_subject_folder` to your subject folder.
75+
The sample subject (`N27`) is a sample generated by `FreeSurfer` ([download](https://surfer.nmr.mgh.harvard.edu/fswiki/DownloadAndInstall)). If you have any subjects processed by `FreeSurfer`, use function `freesurfer_brain2` to visualize.
76+
77+
The `AFNI/SUMA` standard 141 brain is also supported. Please use terminal command `@SUMA_Make_Spec_FS -NIFTI -sid [subID]` to generate 141 brain. (Click [here](https://openwetware.org/wiki/Beauchamp:BuffyElectrodeNotes#Converting_Files_between_iELVis_and_AFNI/SUMA) for some hints)
6578

6679
## D. Add/Render Electrodes
6780

6881
If you have electrode file, you can import it before calling `plot` function. Please make sure it's in `csv` format.
6982
```r
7083
x$set_electrodes(electrodes = "[PATH to ELECTRODE FILE]")
7184
```
72-
Here is an example of electrode csv file. Only the first five columns (**case-sensitive**) are mandatory: `Electrode (integer)`, `Coord_x`, `Coord_y`, `Coord_z`, and `Label (character)`. `Coord_*` is `RAS` location from `FreeSurfer` coordinates.
85+
Here is an example of electrode csv file. Only the first five columns (**case-sensitive**) are mandatory: `Electrode (integer)`, `Coord_x`, `Coord_y`, `Coord_z`, and `Label (character)`. `Coord_*` is `tkRAS` location from `FreeSurfer` coordinates.
7386
```
7487
| Electrode| Coord_x| Coord_y| Coord_z|Label | MNI305_x| MNI305_y| MNI305_z|SurfaceElectrode |SurfaceType | Radius| VertexNumber|Hemisphere |
7588
|---------:|-------:|-------:|-------:|:------|--------:|---------:|---------:|:----------------|:-----------|------:|------------:|:----------|
@@ -106,9 +119,11 @@ The electrode value file is also a csv like:
106119

107120
If you have your own subjects with `FreeSurfer` output, for example, I have two subjects `YAB` and `YCQ`. To merge these two subjects and show them on `N27` template,
108121
```r
122+
library(threeBrain)
123+
109124
# yab = ... (see section B for import a single subject)
110125
# ycq = ...
111-
template_n27 = threeBrain::merge_brain(yab, ycq, template_subject = 'N27')
126+
template_n27 = merge_brain(yab, ycq, template_subject = 'N27')
112127

113128
plot( template_n27 )
114129
```
@@ -119,7 +134,7 @@ The viewer will be in `N27` template, and electrodes of these two subjects can b
119134

120135
To cite threeBrain in publications use:
121136

122-
> Magnotti, JF, Wang, Z, Beauchamp, MS. RAVE: comprehensive open-source software for reproducible analysis and visualization of intracranial EEG data.
137+
> Magnotti, J. F., Wang, Z., & Beauchamp, M. S. (2020). RAVE: Comprehensive open-source software for reproducible analysis and visualization of intracranial EEG data. *NeuroImage, 223*, 117341.
123138
124139
A BibTeX entry for LaTeX users:
125140

0 commit comments

Comments
 (0)