diff --git a/CHANGELOG.html b/CHANGELOG.html
index 465044a4..0a114155 100644
--- a/CHANGELOG.html
+++ b/CHANGELOG.html
@@ -40,9 +40,29 @@
NA
Changes since last CRAN release
-
-
ef1e293d (HEAD -> master)
[dipterix
]: Plotting slices have correct margins with partial plot
+249626d4 (HEAD -> master)
[dipterix
]: Prototype set_transform_from_points
now tries to set rotation from transform Euler
angle when the prototype guided marker is 1-ranked (electrode strip, DBS
electrodes)
-
-
4bd0352c (origin/master, origin/HEAD)
[dipterix
]: Allow users to drag and drop value tables
+7529aa91
[dipterix
]: Allowed electrode prototype to display markers; added viewer options for localization
+-
+
b35e7dc1
[dipterix
]: Changed electrode direction helper to be displayed inside of crosshair group; Allowed side panel to be displayed with atlas column-row-slice; Added controller to display symmetric continuous color map for volumes
+-
+
12970a6b (origin/master, origin/HEAD)
[dipterix
]: Fixed the GLTF
not showing inner-most contact issue
+-
+
c8522cd7
[dipterix
]: Removed devel
version of ravetools
from check
+-
+
11bb99e8
[dipterix
]: Update Github
action check script
+-
+
cbeac8bc
[dipterix
]: Added rhub check
+-
+
b302dd71
[dipterix
]: minor change
+-
+
02880b44
[dipterix
]: Ready for a CRAN release
+-
+
9efec0cb
[dipterix
]: Removed doc
folder
+-
+
bae88ccb
[dipterix
]: Plotting slices have correct margins with partial plot
+-
+
4bd0352c
[dipterix
]: Allow users to drag and drop value tables
-
10ac71ad
[dipterix
]: Allow users to hide crosshairs
-
diff --git a/pkgdown.yml b/pkgdown.yml
index 141a9f38..acefaaff 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -4,7 +4,7 @@ pkgdown_sha: ~
articles:
A-getting-started: A-getting-started.html
B-data-visualization: B-data-visualization.html
-last_built: 2024-07-17T17:30Z
+last_built: 2024-07-22T21:33Z
urls:
reference: https://dipterix.org/threeBrain/reference
article: https://dipterix.org/threeBrain/articles
diff --git a/reference/seeg_prototype.html b/reference/seeg_prototype.html
index 203b300e..51e2e687 100644
--- a/reference/seeg_prototype.html
+++ b/reference/seeg_prototype.html
@@ -58,6 +58,7 @@
@@ -111,6 +112,12 @@ Argumentsviewer_options
+list of viewer options; this should be a list of
+key-value pairs where the keys are the controller names and values are the
+corresponding values when users switch to localizing the electrode group
+
+
overwrite
whether to overwrite existing configuration file; default
is false, which throws a warning when duplicated
diff --git a/search.json b/search.json
index 36f5a75b..5ad2d112 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"https://dipterix.org/threeBrain/CHANGELOG.html","id":"changes-since-last-cran-release","dir":"","previous_headings":"","what":"Changes since last CRAN release","title":"NA","text":"ef1e293d (HEAD -> master) [dipterix]: Plotting slices correct margins partial plot 4bd0352c (origin/master, origin/HEAD) [dipterix]: Allow users drag drop value tables 10ac71ad [dipterix]: Allow users hide crosshairs 05836f94 [dipterix]: Allow shiny app change current color map via proxy fbca42f4 [dipterix]: Allows drag-drop electrode color files; Added set_electrode_data brain proxy class, allowing shiny applications change electrode data, set color palettes, set value ranges call a14cd3f5 [dipterix]: Allow masks added T1; Added D99v2 monkey brain; Added demo code; Export GLTF datacube2 9268886f [dipterix]: Fixed fix_electrode_color bug 62567274 [dipterix]: Supported ISO surface generation voxels a6295c2c [dipterix]: Added white-matter segmentation default atlas user file cd8e15e8 [dipterix]: Exporting GLTF wrapped try-catch 963859ed [dipterix]: fix_electrode_color exclusive default; fixed color fixing issue naive sphere electrodes 1dea870f [dipterix]: Changed logo message 1e70580a [dipterix]: Using better RAVE logo fixed style issues; Changed shortcut p toggling visibility shift+p switching surface types 9b76fa41 [dipterix]: Added logo control panel advertise project 226994ba [dipterix]: Added export GLTF binary format; Separate 3D 2D canvas; e556d025 [dipterix]: Converts *h.pial.gii FreeSurfer format files missing 8d8c36dc [dipterix]: Allow electrode depth test disabled (always-depth) contact /outlines 558564ec [dipterix]: Typo fix SliceShader 40d60f02 [dipterix]: Fixing vertex shader output read fragment shader issue 82b23f63 [dipterix]: Drop-feature support color-map volume surfaces 0dfb0531 [dipterix]: Fixing readme vignettes b28c0643 [dipterix]: Added contact order display electrode clicked 33d7c9b3 [dipterix]: Added DIXI (, BM,CM`) electrode specifications a2d6fb53 [dipterix]: Added brightness contrast adjustment keyboard shortcut 2c636b26 [dipterix]: Added option set crosshair gap 8137d32a [dipterix]: Added model_rigid=FALSE allow electrode morph (trajectory) ce375985 [dipterix]: Underlay image needed 29141273 [dipterix]: Added default interpolation string sEEG electrodes ff9997df [dipterix]: Changed sEEG contact radius shaft radius half contact widths, increasing visibility 1397eade [dipterix]: Disabled user-selection event CSS zoom-tools (side canvas) 6993bab0 [dipterix]: Supported drag drop curvature files pial built-color map 31b7f388 [dipterix]: Skip smooth step lambda non-positive 8b814e08 [dipterix]: plot_slices allows overlay images 5ad19c55 [dipterix]: Fixed right-click settings crosshairs correctly template brain 8ccd7706 [dipterix]: Drag drop feature supports STL format now; Color map remembered regardless file extension d6de9e10 [dipterix]: Added conform_volume conform images simulate FreeSurfer conform algorithm 40d10a3b [dipterix]: Exported write.fs.surface 8f356c31 [dipterix]: volume_to_surf can take objects (read_volume) input c1e25e3a [dipterix]: Fixed subject code set issue visualizing template brain; Fixed atlas list updated brain loaded; Fixed controller set value variable undefined; Voxel Label input remembered. 4d0f2a23 [dipterix]: Fixed name parsing surface file space keyword provided 01836188 [dipterix]: Added volume_to_surf generate 3D triangular mesh surfaces volume data 8a3a03e0 (origin/dragndrop, dragndrop) [dipterix]: Fixed Github action script system dependecies added aae29b28 [dipterix]: Color look-table can set arbitrary single color (HexString, indicating values rendered color; Drag & Drop volumes can change single colors c04d7783 [dipterix]: Remembers state switching volumes (datacube2) d7cab685 [dipterix]: Allowed prototype contact colors fixed; Prototype control points displays channel information (provided control points channels) Added color (randomColor, testColorString) file-name utility functions; Soft removed addColorCoat using ElectrodeMaterial, results massive code improvement electrode instance; Allow set default electrode colors contact rendered values fixed color; Fixed NamedLut color error value range zero; Prototype electrode click information displays channel number; Fixed RShinyDriver issue object construction parameters (using getThreeBrainInstance instead); 1ed4b5b4 [dipterix]: Scrolling side canvas faster now b4cd7dbf [dipterix]: Drag & drop file names sanitized avoid displaying issues; Electrode contacts (instancedMesh) now click-able; Dispose cleaner now, also fires events; Added makeClickable removeClickable replace previous add_clickable function; Renamed register_object registerToMap; Fixed UV mapping issue sphere electrode geometry; Better ways sanitize datacube; e0437d6c [dipterix]: Improved datacube overlay texture, including using clamp--border instead clamp--edge; Fixed shader issue transparency set negative (treated 1) 7a196ff4 [dipterix]: Ray-casting electrode prototypes instancedMesh now works contact-mode; Show electrode prototype contacts default 28f3af8d [dipterix]: Changed drag & drop default color mode; changing global opacity also affects Voxel Opacity volume settings; AbstractThreeBrainObject now inherits EventDispatcher (three) events can registered instances directly; Color changes datacube2 notify underlay datacube via event dispatcher; color keyword added, reversed version also registered; Fixed discrete volume treated continuous map overlaid 5f068018 [dipterix]: Added color modes uploaded images; using NIfTI headers get calculated color intensities applying heuristic approach; removed normalize method (replaced getNormalizedImage) NiftiImage MGHImage bb1e6150 [dipterix]: Using script generate change log automatically Git commits 1eea71c6 [dipterix]: Added news 6f3ceefe [dipterix]: bump version a9d0c8f6 [dipterix]: rename electrode prototypes: (type-company-version.json) bb3adf85 [dipterix]: minor fix 01ed4695 [dipterix]: Added campass side cameras slice mode canonical; dragndrop changes folders; removed UV sphere electrodes; added model-segmented electrodes shaft; fixed bug slice instance missing controller tries set overlay; voxel threshold async now; changed default controller; added broadcast() controllers; atlas number displayed users don’t need search lut; added global debug flag; js source map hidden browser won’t complain missing map; fa4fe3f6 [dipterix]: viewer can seen quarto/rmarkdown/knitr now e7cdff72 [dipterix]: added default prototypes 60f0dddd [dipterix]: added functions create seeg prototypes 2096eb4c [dipterix]: added electrode “”, allowing electrode rotate along direction 6a53d729 [dipterix]: dnd surface granted USER_ALL_SIDE_CAMERA_4; implemented slice overlay; splited render distance Frustum near far; added model2vox datacube datacube2; timeout workers; fixed sEEG-16 UV mapping 0c466378 [dipterix]: dynamic async workers; support dnd gii colormap; added snap--electrode mode; dnd surface infer space filename (BIDS); voxel matching subcortical surfaces; d64ae335 [dipterix]: added support electrode directions; prototypes loaded system default allow updating certain params a9275a43 [dipterix]: fixed prototype channel number set set list 3dc98c5e [dipterix]: added options enable/disable cache; used better file loader options use js workers 0ef6c1c3 [dipterix]: fixed UV issues prototype 2c1f30e4 [dipterix]: allow contact fixed (anchor); reduced number control points 2; removed flattern=FALSE prototypes; fixed prototype transform issue 4351cc4b [dipterix]: default surface colors ad4b4299 [dipterix]: Implemented drag N drop 7fe52479 [dipterix]: added remotes b53c0725 (origin/custom-electrode-geom, custom-electrode-geom) [dipterix]: using instancedMesh represent electrode contacts prototype used 4cacfd41 [dipterix]: Multi-representation electrode e3bb38c0 [dipterix]: added mapToTemplate back d5416c4e [dipterix]: early stop webgl2 unavailable 4b71dee7 [dipterix]: render webgl2 disabled fa11027f [dipterix]: Fixing win fe2cc379 [dipterix]: recompile 2313b0a5 [dipterix]: changed pial surface material depthwrite transparent cf2f1905 [dipterix]: fixed electrode values prototype used 88e10f8d [dipterix]: js fix a6d61c23 [dipterix]: Added support QRCode; using flags instead function hard update contact positions (may ready) f77c8ee0 [dipterix]: docs, always docs b498b613 [dipterix]: avoid auto-load geometries; added type string prototype; added set_matrix_world set transform object 6e91dba8 [dipterix]: added custom electrode shape support fe5f2c84 [dipterix]: added news; cran-comments; allowed plot_slices additive ca56af1b (origin/win-fix, win-fix) [dipterix]: fixing crash issue windows ba3f975b [dipterix]: removed shader cache surface shader (may cause window crash 8904130d [dipterix]: updated readme 48ea5ea6 [dipterix]: adjust implementation background color arcball radius; removed additional unsed params material call; added zindex base side canvas; added defaultColor electrodes; fixed localization electrodes color set correctly issues; completely removed composer effects 9785b05d [dipterix]: trackball uses longer side instead shorter side arc radius; mouse position canvas caluclated every mouse instead every resizing 85bffcbf [dipterix]: internalize col2hexstr 9a5d74ad [dipterix]: Added brainelectrodeselectrodesfix_electrode_color fix contacts color given clip names; added electrode visibility mode: use threshold show contacts pass threhsold values 467eac5d [dipterix]: robust controller.load 34727c80 [dipterix]: textsprite depth fix c4365bad [dipterix]: changed default controllers 78acc14a [dipterix]: upgraded threejs v160 significant light fix + removed outline pass (using clearcoat instead) 56f0e000 [dipterix]: atlas label also returns atlas IDs f0712167 [dipterix]: user name rave_slices fs folder, use display T1 slices b28a22f5 [dipterix]: auto adjust T1 brightness ploting slices 28767b24 [dipterix]: adjust title position 77a28c2f [dipterix]: Added plot_slices brain class 58c66337 [dipterix]: mesh clipping c6f90fee [dipterix]: Fixed download template subject URL query e4092702 [dipterix]: dev bump 10524a4c [dipterix]: Added default rave_slices case users want choose slices 3D viewer a4cac580 [dipterix]: Allow slices change gamma ff842861 [dipterix]: make voxel IJK starting 0 c139b53c [dipterix]: Fixed brain electrode mapping; added atlas guesser 16defcdb [dipterix]: Added space transform electrodes class; set controllers (setFromDictionary) uses try-catch clauses now 176e7746 [dipterix]: Partition datauri datauri size exceed 65529 21e12b51 [dipterix]: bump version a12128c4 [dipterix]: updated citation 06a99127 [dipterix]: truly standalone viewer a5746ca2 [dipterix]: animation uses new cmap af2d2c76 [dipterix]: added png dep bb773fcb [dipterix]: Added ACPC alignment, new tubegeom customized electrode types 1b37825a [dipterix]: allows additional geoms viewer brain$plot 75e77aec [dipterix]: using new mac command 14f53797 [dipterix]: plot_slices column-major 0d43840d [dipterix]: minor patch 3503ee49 [dipterix]: minor patch 19a0c0bc [dipterix]: line--sight view (js) plot_slices (R) d019c899 [dipterix]: bump version b121553a [dipterix]: Fixing CT matrix js s/qforms inconsistent (coregistration matrix sform original matrix qform) aea5c03f [dipterix]: improved way calc spacing offsets 8be639fa [dipterix]: Fixed bugs interpolation spacing 74a871e7 [dipterix]: specify spacing inter/extrapolation; removed old interpolation logic; added distanceRatio prevent large shift (auto adjust) 73685b8a [dipterix]: localization: Outlines 1da0aa4f [dipterix]: Update match yael paper 60b014c3 [dipterix]: fixing incorrect subcortical label 1c98fa37 [dipterix]: Disabled old format; as_subcortical_label generates correct wm labels a909a73f [dipterix]: let electrodes opaque main transparent side canvas 3591520e [dipterix]: added initialization condition 0d538d85 [dipterix]: Let subcortical surfaces display default 258a7cda [dipterix]: added get_ijk2ras get Norig (sform) Torig (tkr) 289153c2 [dipterix]: minor bug fix bump a48ca697 [dipterix]: using pial surface center trackball center 1c44190d [dipterix]: added support showing subcortical surfaces; fixed depth issues showing electrodes side viewers bb0fb968 [dipterix]: fixed freesurfer_lut bd75f4e8 [dipterix]: Dithering datacube2 make rendering “smooth”; added target arg pre_render pre_render also applies side canvas","code":""},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"directory-setup","dir":"Articles","previous_headings":"","what":"Directory Setup","title":"Getting Started","text":"basic setup typical subject folder look like : using FreeSurfer generate MRI reconstruction, set! AFNI/SUMA users, please place SUMA folder subject folder. don’t FreeSurfer folders, can download sample archive , choose N27-complete.zip, extract download directory. extracted, N27 subject folder ~/Downloads/ directory. directory tree looks exactly described . following context, use ~/Downloads/N27 example","code":"Project Directory └─Subject code ├─mri - Atlas, T1 and/or CT image files (*.mgz, transforms, ...) ├─surf - FreeSurfer surface files (pial, sulc, ...) ├─SUMA - (Optional) SUMA standard 141 surfaces (std.141.*) └─... - Other files"},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"generate-viewer-object","dir":"Articles","previous_headings":"","what":"Generate Viewer Object","title":"Getting Started","text":"first time, might take import generate cache files.","code":"library(threeBrain) subject_code <- \"N27\" subject_path <- \"~/Downloads/N27\" brain <- threeBrain(subject_path, subject_code) print(brain) #> Subject - N27 #> Transforms: #> #> - FreeSurfer TalXFM [from scanner to MNI305]: #> [,1] [,2] [,3] [,4] #> [1,] 0.9692 -0.0029 -0.0134 -0.1638 #> [2,] 0.0062 0.9685 0.0492 -2.0717 #> [3,] 0.0145 0.0276 0.9541 0.1361 #> [4,] 0.0000 0.0000 0.0000 1.0000 #> #> - Torig [Voxel CRS to FreeSurfer origin, vox2ras-tkr] #> [,1] [,2] [,3] [,4] #> [1,] -1 0 0 128 #> [2,] 0 0 1 -128 #> [3,] 0 -1 0 128 #> [4,] 0 0 0 1 #> #> - Norig [Voxel CRS to Scanner center, vox2ras] #> [,1] [,2] [,3] [,4] #> [1,] -1 0 0 128.5 #> [2,] 0 0 1 -145.5 #> [3,] 0 -1 0 146.5 #> [4,] 0 0 0 1.0 #> #> - Scanner center relative to FreeSurfer origin #> [1] -0.5 17.5 -18.5 #> #> - FreeSurfer RAS to MNI305, vox2vox-MNI305 #> [,1] [,2] [,3] [,4] #> [1,] 0.9692 -0.0029 -0.0134 0.12365 #> [2,] 0.0062 0.9685 0.0492 -18.10715 #> [3,] 0.0145 0.0276 0.9541 17.31120 #> [4,] 0.0000 0.0000 0.0000 1.00000 #> Surface information (total count 1) #> Loading required namespace: rstudioapi #> pial [ std.141 ] #> Volume information (total count 1) #> T1"},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"visualization","dir":"Articles","previous_headings":"","what":"Visualization","title":"Getting Started","text":"Visualizing viewer simply just one line.","code":"brain$plot()"},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"surface-volume-atlas","dir":"Articles","previous_headings":"","what":"Surface, Volume, Atlas","title":"Getting Started","text":"default, viewers load following information. pial surfaces mandatory, files optional. mri/brain.finalsurfs.mgz mri/transforms/talairach.xfm surf/*h.pial SUMA/std.141.*h.pial[.asc|gii] surf/*h.sulc SUMA/std.141.*h.sulc.1D mri/aparc+aseg.mgz T1 image automatically detected brain.finalsurfs.mgz missing. following alternatives brainmask.mgz, brainmask.auto.mgz, T1.mgz. load one surfaces, please specify surface types loading viewer. available surface types : pial - (default) smoothwm, white - (smoothed) white matter inflated, sphere - inflated surfaces pial-outer-smoothed - (‘FreeSurfer’-) smoothed surface tightly wrapping pial surface inf_200 - (‘SUMA’-) inflated pial surface atlas type can selected aparc+aseg, aparc.a2009s+aseg, aparc.DKTatlas+aseg, aseg. load specific atlas, please make sure corresponding file exists mri/. example, mri/aseg.mgz. following example loads pial smoothwm, aseg atlas. viewer shows ‘Coronal’ plane, smoothed white matter, ‘Ventricle’, ‘Cerebellum’ together one scene.","code":"brain <- threeBrain( subject_path, subject_code, surface_types = c('pial', 'smoothwm'), atlas_types = 'aseg') brain$plot( controllers = list( \"Voxel Type\" = \"aseg\", \"Voxel Label\" = \"4,5,6,7\", \"Surface Type\" = \"smoothwm\", \"Left Opacity\" = 0.4, \"Overlay Coronal\" = TRUE ), control_display = FALSE, camera_pos = c(0, -500, 0) )"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"add-electrodes","dir":"Articles","previous_headings":"","what":"Add Electrodes","title":"Data Visualization (Electrodes)","text":"add electrodes brain object, need electrode table least 5 columns: Subject, Coord_x, Coord_y, Coord_z, Label. column names case-sensitive. performed electrode localization (see previous article) exported electrode table, exported table can used Electrode filled . demonstration purposes, electrode table used. Please download file place ~/Downloads/N27/electrodes.csv","code":"electrode_table <- `~/Downloads/N27/electrodes.csv` brain$set_electrodes(electrode_table) brain$plot()"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"add-electrode-values","dir":"Articles","previous_headings":"","what":"Add Electrode Values","title":"Data Visualization (Electrodes)","text":"iEEG study, various analyses can performed electrodes. analysis results different, including functional data mean-response time continuous data like p-values, z-scores categorical data cluster labels threeBrain can visualize two lines one data table. First, let’s take look start, generate table follows: column names case-sensitive, contain letters, digits _. Project: (optional) project name experiment belongs Subject: (mandatory) subject code; must consistent brain subject code Electrode: (mandatory) integers electrode channel number; correspond Electrode column electrode table Time (optional) numerical time seconds Value columns (sine_wave, p_value, z_score, cluster): values electrodes Download sample value table save ~/Downloads/N27/values.csv Open Data Visualization panel, change Display Data use keyboard shortcut d (make sure mouse hovering brain) switch desired variables. sine_wave time series. can see animation toggling Play/Pause option Data Visualization panel.","code":"electrode_table <- `~/Downloads/N27/electrodes.csv` value_table <- `~/Downloads/N27/values.csv` brain$set_electrodes(electrode_table) brain$set_electrode_values(value_table) brain$plot()"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"change-color-palette","dir":"Articles","previous_headings":"Add Electrode Values","what":"Change Color Palette","title":"Data Visualization (Electrodes)","text":"example , p-value legend shows range -0.5 0.5. threeBrain viewer’s default palette symmetric around zero, range decided maximum absolute number. However, actual p-value range 0 1, might particularly interested $p \\leq 0.05$. means color palette value range need corrected. following code, value_ranges named list value ranges. \"p_value\"=c(0,1) suggests p_value variable range 0 1. variables adopt default ranges. palettes named list color palettes. specific case, variable pal vector 64 colors. colorRampPalette base-R function interpolate colors. Please use help(\"colorRampPalette\") see documentation.","code":"pal <- c( colorRampPalette(c(\"red\", \"#FFC6C6\"))(8), colorRampPalette(c(\"#FFC6C6\", \"white\"))(56) ) brain$plot( value_ranges = list( \"p_value\" = c(0, 1) ), palettes = list( \"p_value\" = pal ) )"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"map-electrode-values-to-the-surface","dir":"Articles","previous_headings":"","what":"Map Electrode Values to the Surface","title":"Data Visualization (Electrodes)","text":"threeBrain provides value mapping allows electrode values displayed surfaces. enable feature, open Surface Settings panel, click Surface Color, switch sync electrodes, simply use keyboard shortcut k (make sure mouse hovering brain) change. can also hide electrodes switching electrode Visibility hidden Electrodes panel show mapped results.","code":""},{"path":"https://dipterix.org/threeBrain/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Zhengjia Wang. Author, maintainer, copyright holder. John Magnotti. Contributor, researcher. Xiang Zhang. Contributor, researcher. Brian Metzger. Researcher. Elizabeth Nesbitt. Researcher. Meng Li. Thesis advisor. Michael Beauchamp. Thesis advisor, contributor, data contributor.","code":""},{"path":"https://dipterix.org/threeBrain/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wang, Z., Magnotti, J. F., Zhang, X., & Beauchamp, M. S. (2023). YAEL: Advanced Electrode Localizer. Eneuro, 10(10). Magnotti, J. F., Wang, Z., & Beauchamp, M. S. (2020). RAVE: Comprehensive open-source software reproducible analysis visualization intracranial EEG data. NeuroImage, 223, 117341.","code":"@Article{, title = {{YAEL}: Your Advanced Electrode Localizer}, author = {Zhengjia Wang and John F. Magnotti and Xiang Zhang and Michael S. Beauchamp}, journal = {Eneuro}, year = {2023}, volume = {10}, number = {10}, publisher = {Society for Neuroscience}, doi = {10.1523/ENEURO.0328-23.2023}, } @Article{, title = {{RAVE}: Comprehensive open-source software for reproducible analysis and visualization of intracranial EEG data}, author = {John F. Magnotti and Zhengjia Wang and Michael S. Beauchamp}, journal = {NeuroImage}, year = {2020}, volume = {223}, pages = {117341}, doi = {10.1016/j.neuroimage.2020.117341}, }"},{"path":"https://dipterix.org/threeBrain/index.html","id":"threebrain---html-webgl-based-3d-viewer","dir":"","previous_headings":"","what":"Your Advanced 3D Brain Visualization","title":"Your Advanced 3D Brain Visualization","text":"Key Features: Uses modern browsers, easy embed share Displays MRI, surfaces, electrodes canvas Maps multiple subjects template brains using AFNI/SUMA (standard 141) MNI-305 locations Electrode localization Volume rendering surface/electrode animation Integration interactive R-shiny framework News | reference page | keyboard shortcuts","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"system-requirement","dir":"","previous_headings":"","what":"System Requirement","title":"Your Advanced 3D Brain Visualization","text":"Web Browsers: viewer uses WegGL2 render browsers. Please check list see compatible browsers. 2023, Chrome, Firefox, Safari, Edge (IE) full supports.","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"a-installation","dir":"","previous_headings":"","what":"A. Installation","title":"Your Advanced 3D Brain Visualization","text":"R RStudio Desktop (Free Version) Open RStudio, enter console: want install dev version Github, use: (Optional) Setups: installation, RStudio console, type following command follow instructions.","code":"install.packages(\"threeBrain\", repos = \"https://rave-ieeg.r-universe.dev\") install.packages(\"remotes\") remotes::install_github(\"dipterix/threeBrain\") threeBrain::brain_setup()"},{"path":"https://dipterix.org/threeBrain/index.html","id":"b-basic-brain-viewer","dir":"","previous_headings":"","what":"B. Basic Brain Viewer","title":"Your Advanced 3D Brain Visualization","text":"finishing setting threeBrain, template subject N27 (Collin’s 27) created locally. location platform-related. can find running following command: N27 template folder resides inside directory. Let’s view subject using threeBrain function. Import subject Visualize","code":"library(threeBrain) default_template_directory() #> [1] \"/Users/dipterix/Library/Application Support/ #> org.R-project.R/R/threeBrain/templates\" library(threeBrain) n27_path <- file.path(default_template_directory(), \"N27\") x <- threeBrain( path = n27_path, subject_code = 'N27', surface_types = 'pial') plot(x) # alternatively, you can use x$plot()`"},{"path":"https://dipterix.org/threeBrain/index.html","id":"c-subject-setup","dir":"","previous_headings":"","what":"C. Subject Setup","title":"Your Advanced 3D Brain Visualization","text":"sample subject (N27) sample generated FreeSurfer (download). subjects processed FreeSurfer, use function threeBrain visualize.","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"d-addrender-electrodes","dir":"","previous_headings":"","what":"D. Add/Render Electrodes","title":"Your Advanced 3D Brain Visualization","text":"electrode file, can import calling plot function. Please make sure ’s csv format. example electrode csv file. first five columns (case-sensitive) mandatory: Electrode (integer), Coord_x, Coord_y, Coord_z, Label (character). Coord_* tkRAS location FreeSurfer coordinates. assign values electrodes, run electrode value file also csv like: Project Time optional. However, also using rave, please make sure Project exists. want show animation, Time necessary must numeric. ValueName? can characters containing letters (-Z, -z), letters (0-9) underscore (_).","code":"x$set_electrodes(electrodes = \"[PATH to ELECTRODE FILE]\") | Electrode| Coord_x| Coord_y| Coord_z|Label | MNI305_x| MNI305_y| MNI305_z|SurfaceElectrode |SurfaceType | Radius| VertexNumber|Hemisphere | |---------:|-------:|-------:|-------:|:------|--------:|---------:|---------:|:----------------|:-----------|------:|------------:|:----------| | 1| 29.0| -7.8| -34.6|RMHCH1 | 30.46817| -17.98119| -23.40022|FALSE |pial | 2| -1|left | | 2| 33.8| -8.0| -34.2|RMHCH2 | 35.57109| -17.76624| -22.80131|FALSE |pial | 2| -1|left | | 3| 38.0| -7.5| -33.5|RMHCH3 | 39.97102| -16.81249| -22.17986|FALSE |white | 2| -1|right | | 4| 42.6| -6.8| -33.0|RMHCH4 | 44.79092| -15.73442| -21.82591|FALSE |smoothwm | 2| -1|right | | 5| 47.0| -6.8| -32.6|RMHCH5 | 49.45370| -15.35431| -21.31272|FALSE |pial | 2| -1|right | | ... x$set_electrode_values(electrodes = \"[PATH to ELECTRODE VALUE FILE]\") | Electrode| Subject| Project| Time| ValueName| ValueName2| ...| |---------:|-------:|-------:|-------:|:---------|----------:|-----| | 1| N27| Demo| 0|A | 30.46817| ...| | 2| N27| Demo| 0|B | 35.57109| ...| | 3| N27| Demo| 0|C | 39.97102| ...| | 4| N27| Demo| 0|D | 44.79092| ...| | 5| N27| Demo| 0|A | 49.45370| ...| | ..."},{"path":"https://dipterix.org/threeBrain/index.html","id":"e-merge-subjects-and-template-mapping","dir":"","previous_headings":"","what":"E. Merge Subjects and Template mapping","title":"Your Advanced 3D Brain Visualization","text":"subjects FreeSurfer output, example, two subjects YAB YCQ. merge two subjects show N27 template, viewer N27 template, electrodes two subjects can mapped via MNI305 (surface stereo EEG) std.141 (surface-).","code":"library(threeBrain) # yab = ... (see section B for import a single subject) # ycq = ... template_n27 = merge_brain(yab, ycq, template_subject = 'N27') plot( template_n27 )"},{"path":"https://dipterix.org/threeBrain/index.html","id":"f-electrode-localization-yael","dir":"","previous_headings":"","what":"F. Electrode Localization (YAEL)","title":"Your Advanced 3D Brain Visualization","text":"YAEL (“Advanced Electrode Localizer) integrated RAVE (R Analysis Visualization iEEG). Please check website https://yael.wiki sfN poster","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Your Advanced 3D Brain Visualization","text":"cite threeBrain publications use: Wang, Z., Magnotti, J. F., Zhang, X., & Beauchamp, M. S. (2023). YAEL: Advanced Electrode Localizer. Eneuro, 10(10). Magnotti, J. F., Wang, Z., & Beauchamp, M. S. (2020). RAVE: Comprehensive open-source software reproducible analysis visualization intracranial EEG data. NeuroImage, 223, 117341. BibTeX entry LaTeX users:","code":"@Article{, title = {{YAEL}: Your Advanced Electrode Localizer}, author = {Zhengjia Wang and John F. Magnotti and Xiang Zhang and Michael S. Beauchamp}, journal = {Eneuro}, year = {2023}, volume = {10}, number = {10}, publisher = {Society for Neuroscience}, doi = {10.1523/ENEURO.0328-23.2023}, } @Article{, title = {{RAVE}: Comprehensive open-source software for reproducible analysis and visualization of intracranial EEG data}, author = {John F. Magnotti and Zhengjia Wang and Michael S. Beauchamp}, journal = {NeuroImage}, year = {2020}, volume = {223}, doi = {10.1016/j.neuroimage.2020.117341}, pages = {117341}, }"},{"path":"https://dipterix.org/threeBrain/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Your Advanced 3D Brain Visualization","text":"front-end viewer (JavaScript) licensed MPL-2.0 free open-source license. Using generated viewers incorporating existing viewers whole work “-” permissive.","code":""},{"path":"https://dipterix.org/threeBrain/reference/AbstractGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Abstract Class of Geometries — AbstractGeom","title":"R6 Class - Abstract Class of Geometries — AbstractGeom","text":"R6 Class - Abstract Class Geometries","code":""},{"path":"https://dipterix.org/threeBrain/reference/AbstractGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Abstract Class of Geometries — AbstractGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/BlankGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"A geometry that renders nothing — BlankGeom","title":"A geometry that renders nothing — BlankGeom","text":"mainly used want upload group data ","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Data Cube Geometry — DataCubeGeom","title":"R6 Class - Generate Data Cube Geometry — DataCubeGeom","text":"R6 Class - Generate Data Cube Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Data Cube Geometry — DataCubeGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom2.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture — DataCubeGeom2","title":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture — DataCubeGeom2","text":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom2.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture — DataCubeGeom2","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/FreeGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Geometry from Vertices and Face Indices — FreeGeom","title":"R6 Class - Generate Geometry from Vertices and Face Indices — FreeGeom","text":"R6 Class - Generate Geometry Vertices Face Indices","code":""},{"path":"https://dipterix.org/threeBrain/reference/GeomGroup.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Group of Geometries — GeomGroup","title":"R6 Class - Generate Group of Geometries — GeomGroup","text":"R6 Class - Generate Group Geometries","code":""},{"path":"https://dipterix.org/threeBrain/reference/GeomGroup.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Group of Geometries — GeomGroup","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/LineSegmentsGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Line Segments — LineSegmentsGeom","title":"R6 Class - Generate Line Segments — LineSegmentsGeom","text":"R6 Class - Generate Line Segments","code":""},{"path":"https://dipterix.org/threeBrain/reference/LineSegmentsGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Line Segments — LineSegmentsGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/SphereGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Sphere Geometry — SphereGeom","title":"R6 Class - Generate Sphere Geometry — SphereGeom","text":"R6 Class - Generate Sphere Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/SphereGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Sphere Geometry — SphereGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/SpriteGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Sphere Geometry — SpriteGeom","title":"R6 Class - Generate Sphere Geometry — SpriteGeom","text":"R6 Class - Generate Sphere Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/SpriteGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Sphere Geometry — SpriteGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/TubeGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Tube Geometry — TubeGeom","title":"R6 Class - Generate Tube Geometry — TubeGeom","text":"R6 Class - Generate Tube Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/TubeGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Tube Geometry — TubeGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":null,"dir":"Reference","previous_headings":"","what":"Shiny Proxy for Viewer — brain_proxy","title":"Shiny Proxy for Viewer — brain_proxy","text":"Shiny Proxy Viewer","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shiny Proxy for Viewer — brain_proxy","text":"","code":"brain_proxy(outputId, session = shiny::getDefaultReactiveDomain())"},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shiny Proxy for Viewer — brain_proxy","text":"outputId shiny output ID session shiny session, default current session (see domains)","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Shiny Proxy for Viewer — brain_proxy","text":"R6 class ViewerProxy","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":null,"dir":"Reference","previous_headings":"","what":"Setup Package, Install Environment — brain_setup","title":"Setup Package, Install Environment — brain_setup","text":"Setup Package, Install Environment","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setup Package, Install Environment — brain_setup","text":"","code":"brain_setup(continued = FALSE, show_example = TRUE, ...)"},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setup Package, Install Environment — brain_setup","text":"continued logical, two phases setting environment. probably need restart R session first phase continue setting . show_example whether show example `N27` subject end. ... ignored","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Setup Package, Install Environment — brain_setup","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate rotation matrix from non-zero vectors — calculate_rotation","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"Calculate rotation matrix non-zero vectors","code":""},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"","code":"calculate_rotation(vec_from, vec_to)"},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"vec_from original vector, length 3 vec_to vector rotation, length 3","code":""},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"four--four transform matrix","code":""},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"Function check whether `FreeSurfer` folder everything need","code":""},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"","code":"check_freesurfer_path( fs_subject_folder, autoinstall_template = FALSE, return_path = FALSE, check_volume = FALSE, check_surface = FALSE )"},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"fs_subject_folder character, path `fs` project directory `RAVE` subject directory autoinstall_template logical, whether `N27` brain installed missing return_path logical, whether return `FreeSurfer` path check_volume logical, whether check volume data check_surface logical, whether check surface data (implemented yet)","code":""},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"logical whether directory valid , return_path true, return `FreeSurfer` path","code":""},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Conform imaging data in 'FreeSurfer' way — conform_volume","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"Reproduces conform algorithm used 'FreeSurfer' conform 'NIfTI' 'MGH' images.","code":""},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"","code":"conform_volume(x, save_to, dim = c(256, 256, 256))"},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"x path image file save_to path conformed image saved, must ends '.mgz' dim positive integers length three, conformed dimension; default 'FreeSurfer' conform images 1mm volume cube 256x256x256 dimension","code":""},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"Nothing; result save save_to","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a geometry group containing multiple geometries — create_group","title":"Create a geometry group containing multiple geometries — create_group","text":"Create geometry group containing multiple geometries","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a geometry group containing multiple geometries — create_group","text":"","code":"create_group(name, position = c(0, 0, 0), layer = 1)"},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a geometry group containing multiple geometries — create_group","text":"name string, name geometry position x,y,z location group layer layer group. reserved","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a geometry group containing multiple geometries — create_group","text":"GeomGroup instance","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a geometry group containing multiple geometries — create_group","text":"geometry group container multiple geometries. geometries within group share shift rotations (see example 1). ECoG/iEEG world, might 'MRI', 'CT', 'FreeSurfer' different orientations. example, want align MRI FreeSurfer, Instead calculating position geometries, can just put MRI components group, set transform group, making group aligned FreeSurfer. GeomGroup also can used store large data. generate 3D viewer, `threeBrain` needs dynamically serialize data JSON format, can read browsers. However, FreeSurfer brain might ~30 MB. large size might take ~5 seconds serialize. solve problem, GeomGroup supports cache `set_group_data` method. method supports caching static serialized data JSON file, allows files loaded static data objects. \"static\", mean data supposed dynamic, \"read-\". JavaScript code, also optimized need load large datasets repeatedly. allows load multiple subjects' brain short time.","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a geometry group containing multiple geometries — create_group","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a geometry group containing multiple geometries — create_group","text":"","code":"# Example 1: relative position # create group g = create_group('Group A') # create two spheres at 10,0,0, but s2 is relative to group A s1 = geom_sphere('Sphere 1', radius = 2, position = c(10,0,0)) s2 = geom_sphere('Sphere 2', radius = 2, position = c(10,0,0), group = g) # set transform (rotation) g$set_transform(matrix(c( 0,1,0,0, 1,0,0,0, 0,0,1,0, 0,0,0,1 ), byrow = TRUE, ncol = 4)) # global position for s2 is 0,10,0 if( interactive() ) { threejs_brain(s1, s2) } # Example 2: cache if (FALSE) { # \\dontrun{ # download N27 brain # Make sure you have N27 brain downloaded to `default_template_directory()` # download_N27() template_dir <- default_template_directory() dat = freesurferformats::read.fs.surface( file.path(template_dir, 'N27/surf/lh.pial') ) vertex = dat$vertices[,1:3] face = dat$faces[,1:3] # 1. dynamically serialize mesh = geom_freemesh('lh', vertex = vertex, face = face, layer = 1) # 2. cache # Create group, all geometries in this group are relatively positioned tmp_file = tempfile() mesh = geom_freemesh('Left Hemisphere cached', vertex = vertex, face = face, cache_file = tmp_file) } # }"},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate cross-product of two vectors in '3D' — cross_prod","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"Calculate cross-product two vectors '3D'","code":""},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"","code":"cross_prod(x, y)"},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"x, y 3-dimensional vectors","code":""},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"'3D' vector cross-product x y","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":null,"dir":"Reference","previous_headings":"","what":"Default Directory to Store Template Brain — default_template_directory","title":"Default Directory to Store Template Brain — default_template_directory","text":"Default Directory Store Template Brain","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Default Directory to Store Template Brain — default_template_directory","text":"","code":"default_template_directory(check = FALSE)"},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Default Directory to Store Template Brain — default_template_directory","text":"check logical, check folder missing, , create one. option ensures folder always created.","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Default Directory to Store Template Brain — default_template_directory","text":"directory path template brain stored ; see also download_N27","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Default Directory to Store Template Brain — default_template_directory","text":"threeBrain.template_dir set invalid, function checks 'RAVE' (R Analysis Visualization 'iEEG', https://openwetware.org/wiki/RAVE) folder home directory. folder missing, returns results R_user_dir('threeBrain', 'data'). override default behavior, use options(threeBrain.template_dir=...).","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Default Directory to Store Template Brain — default_template_directory","text":"","code":"default_template_directory() #> [1] \"/home/runner/.local/share/R/threeBrain/templates\""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` surface and volume files — freesurfer_brain","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"Read `FreeSurfer` surface volume files","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"","code":"freesurfer_brain( fs_subject_folder, subject_name, additional_surfaces = NULL, aligned_ct = NULL, use_cache = TRUE, use_141 = getOption(\"threeBrain.use141\", TRUE) ) freesurfer_brain2( fs_subject_folder, subject_name, volume_types = \"t1\", surface_types = \"pial\", curvature = \"sulc\", atlas_types = c(\"aparc+aseg\", \"aparc.a2009s+aseg\", \"aparc.DKTatlas+aseg\"), ct_path = NULL, use_cache = TRUE, use_141 = getOption(\"threeBrain.use141\", TRUE), ... )"},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"fs_subject_folder character, `FreeSurfer` subject folder, `RAVE` subject folder subject_name character, subject code display letters digits additional_surfaces character array, additional surface types load, `white`, `smoothwm` aligned_ct character, path `ct_aligned_mri.nii.gz`, used electrode localization use_cache logical, whether use cached `json` files raw `FreeSurfer` files use_141 logical, whether use standard 141 brain surface file, default getOption('threeBrain.use141', TRUE) volume_types volume types, right now support T1 image surface_types surface types load curvature curvature data. support \"sulc\" current version atlas_types atlas types loaded, choices 'aparc+aseg', 'aparc.a2009s+aseg', 'aparc.DKTatlas+aseg', 'aseg' ct_path aligned CT file 'Nifti' format ... ignored","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"function FreeSurfer license. 1. Volumes: 3D viewer uses `mri/T1.mgz` `FreeSurfer` show volume information. `T1.mgz` results step 1 5 `FreeSurfer` command `recon--autorecon1`, aligns original `DICOM` image `RAS` coordinate system, resamples volume 256x256x256 voxels (tri-linear default, check https://surfer.nmr.mgh.harvard.edu/fswiki/recon-information). 2. Surface: two options surface files. first choice using `std.141` brain generated `AFNI/SUMA`. surface file re-calculates vertices standard 141 space, averages \"surface\" 141 subjects. want map surface electrodes across different subjects, might want consider case especially designed surface mapping. However, need `AFNI/SUMA` installed generate surface file. details can found via https://openwetware.org/wiki/Beauchamp:CorticalSurfaceHCP, `AFNI/SUMA` command related `SurfToSurf`. Please generate files `[FREESURFER SUBJECT DIR]/SUMA/`. file name follows convention `std.141.[lr]h.[SURFACE TYPE].[POSTFIX]`, `lh` means left hemisphere `rh` means right hemisphere; `SURFACE TYPE` can `pial`, `white`, `smoothwm`, `POSTFIX` can `asc`, `gii`. multiple files surface type exists, search order `asc > gii`. option use mesh files directly `FreeSurfer` output located `[FREESURFER SUBJECT DIR]/surf`. want use surface, make sure converted `asc` `gii` format. 3. Electrode registration transforms package provides two ways map electrodes standard space. surface electrodes, standard 141 brain provided, first option snap electrodes nearest vertices subject space. key vertex number matches across different subjects, hence location corresponding vertices template brain mapped electrode coordinates. standard 141 brain missing, electrode type `stereo EEG`, second option volume mapping. idea map electrodes `MNI305` brain. details can found https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems. perform volume mapping, need `FreeSurfer` folder `mri/transforms`. Currently, linear `Talairach` transform matrix supported (located `talairach.xfm`). 4. Coordinates 3D viewer package uses center volume origin (0, 0, 0).","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"","code":"if (FALSE) { # \\dontrun{ # Please run `download_N27()` if `N27` is not at `default_template_directory()` # Import from `FreeSurfer` subject folder brain = threeBrain::freesurfer_brain( fs_subject_folder = file.path(default_template_directory(), 'N27'), subject_name = 'N27', additional_surfaces = c('white', 'smoothwm') ) # Visualize. Alternatively, you can use brain$plot(...) plot( brain ) } # }"},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":null,"dir":"Reference","previous_headings":"","what":"Query the 'FreeSurfer' labels — freesurfer_lut","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"Query 'FreeSurfer' labels","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"","code":"freesurfer_lut"},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"object class list length 3.","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"'FreeSurfer' atlases use https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI/FreeSurferColorLUT look-table query indexes. 'threeBrain' electrode localization also uses table export 'FSLabel' electrode. volume type set 'aparc_aseg', please also use table filter.","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"","code":"freesurfer_lut$from_key(0:10) #> 0 1 #> \"Unknown\" \"Left-Cerebral-Exterior\" #> 2 3 #> \"Left-Cerebral-White-Matter\" \"Left-Cerebral-Cortex\" #> 4 5 #> \"Left-Lateral-Ventricle\" \"Left-Inf-Lat-Vent\" #> 6 7 #> \"Left-Cerebellum-Exterior\" \"Left-Cerebellum-White-Matter\" #> 8 9 #> \"Left-Cerebellum-Cortex\" \"Left-Thalamus\" #> 10 #> \"Left-Thalamus-Proper*\" freesurfer_lut$get_key(\"ctx-lh-supramarginal\") #> ctx-lh-supramarginal #> 1031"},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate smooth envelope around surface — generate_smooth_envelope","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"Alternative 'Matlab' version 'pial-outer-smoothed', use function along fill_surface.","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"","code":"generate_smooth_envelope( surface_path, save_as = NULL, inflate = 3, verbose = TRUE, save_format = c(\"auto\", \"bin\", \"asc\", \"vtk\", \"ply\", \"off\", \"obj\", \"gii\", \"mz3\", \"byu\") )"},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"surface_path path '*h.pial' surface 'FreeSurfer' folder, 3-dimensional mesh, see read.fs.surface save_as save final envelope path, NULL dry-run inflate number 'voxels' inflate fitting envelope; must non-negative integer verbose whether verbose progress; default true save_format format saved file save_as NULL; see format argument function write.fs.surface","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"3-dimensional mesh contains vertices face indices, result also saved save_as specified.","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"","code":"if(interactive() && file.exists(file.path(default_template_directory(), \"N27\"))) { library(threeBrain) fs_path <- file.path(default_template_directory(), \"N27\") # lh.pial-outer-smoothed lh_pial <- file.path(fs_path, \"surf\", \"lh.pial\") save_as <- file.path(fs_path, \"surf\", \"lh.pial-outer-smoothed\") generate_smooth_envelope(lh_pial, save_as) # rh.pial-outer-smoothed rh_pial <- file.path(fs_path, \"surf\", \"rh.pial\") save_as <- file.path(fs_path, \"surf\", \"rh.pial-outer-smoothed\") generate_smooth_envelope(rh_pial, save_as) brain <- threeBrain( path = fs_path, subject_code = \"N27\", surface_types = 'pial-outer-smoothed' ) brain$plot(controllers = list( \"Surface Type\" = 'pial-outer-smoothed' )) }"},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":null,"dir":"Reference","previous_headings":"","what":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"Superseded volume_to_surf. Please use function.","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"","code":"generate_subcortical_surface( atlas, index, save_prefix = NULL, label = NULL, IJK2RAS = NULL, grow = 1, remesh = TRUE, smooth = TRUE, smooth_delta = 3, ... )"},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"atlas path imaging 'parcellation', can 'nii' 'mgz' formats index 'parcellation' index, see 'FreeSurfer' look-table save_prefix parent folder save resulting surface label character label name 'sub-cortical' structure, usually automatically derived index IJK2RAS 'Affine' matrix 'voxel' index 'tkrRAS', usually automatically derived atlas grow amount grow (dilate) generating mesh remesh, smooth, smooth_delta, ... passed mesh_from_volume","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"surface mesh, containing 'atlas' index, label, surface nodes face indices.","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates any mesh geometry given vertices and face indices — geom_freemesh","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"Creates mesh geometry given vertices face indices","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"","code":"geom_freemesh( name, vertex = NULL, face = NULL, position = c(0, 0, 0), layer = 1, cache_file = NULL, group = NULL )"},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"name unique string scene tell apart different objects vertex position vertices (3 columns) face face indices indicating 3 vertices linked (3 columns) position x,y,z location geometry layer visibility geometry, used multiple cameras 1 visible cameras cache_file cache vertex face data group group GeomGroup object, null, group generated automatically","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"generating free mesh internally, group must specified, therefore group NULL , group generated. However, always recommended pass group free mesh.","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"","code":"if (FALSE) { # \\dontrun{ # Make sure you have N27 brain downloaded to `default_template_directory()` # threeBrain::download_N27() n27_dir = file.path(default_template_directory(), \"N27\") surf_type = 'pial' # Locate mesh files lh = read_fs_asc(file.path(n27_dir, sprintf('surf/lh.%s.asc', surf_type))) rh = read_fs_asc(file.path(n27_dir, sprintf('surf/rh.%s.asc', surf_type))) # Create groups group = create_group(name = sprintf('Surface - %s (N27)', surf_type)) # create mesh lh_mesh = geom_freemesh( name = sprintf('FreeSurfer Left Hemisphere - %s (N27)', surf_type), vertex = lh$vertices[,1:3], face = lh$faces[,1:3], group = group ) rh_mesh = geom_freemesh( name = sprintf('FreeSurfer Right Hemisphere - %s (N27)', surf_type), vertex = rh$vertices[,1:3], face = rh$faces[,1:3], group = group ) # Render if( interactive() ) { threejs_brain(lh_mesh, rh_mesh) } } # }"},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":null,"dir":"Reference","previous_headings":"","what":"Create sphere geometry — geom_sphere","title":"Create sphere geometry — geom_sphere","text":"Create sphere geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create sphere geometry — geom_sphere","text":"","code":"geom_sphere( name, radius, position = c(0, 0, 0), layer = 1, group = NULL, value = NULL, time_stamp = NULL )"},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create sphere geometry — geom_sphere","text":"name unique string scene tell apart different objects radius size sphere position x,y,z location sphere layer visibility geometry, used multiple cameras 1 visible cameras group GeomGroup object value, time_stamp color sphere, used animation/color rendering","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create sphere geometry — geom_sphere","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create sphere geometry — geom_sphere","text":"","code":"# Create a sphere with animation g = lapply(1:10, function(ii){ v = rep(ii, 10) v[1:ii] = 1:ii geom_sphere(paste0('s', ii), ii, value = v, position = c(11 * ii, 0,0), time_stamp = (1:10)/10) }) if( interactive() ) { threejs_brain(.list = g) }"},{"path":"https://dipterix.org/threeBrain/reference/get_digest_header.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to read digest header — get_digest_header","title":"Function to read digest header — get_digest_header","text":"Function read digest header","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_digest_header.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to read digest header — get_digest_header","text":"","code":"get_digest_header(file, key, if_error = NULL, .list = NULL)"},{"path":"https://dipterix.org/threeBrain/reference/get_digest_header.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to read digest header — get_digest_header","text":"file file path `JSON` file key character, key extract if_error value return key found read error occurs .list alternative list supply file missing","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":null,"dir":"Reference","previous_headings":"","what":"Get 'voxel' to world matrix — get_ijk2ras","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"Get 'voxel' world matrix","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"","code":"get_ijk2ras(x, type = c(\"scanner\", \"tkr\"))"},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"x path imaging files type world space type; choices 'scanner' ('sform' 'qform' ) 'NIfTI' file headers; 'tkr' (used shared surface nodes)","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"four four matrix","code":""},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":null,"dir":"Reference","previous_headings":"","what":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"Import 'T1-MRI', surface files, curvature/'sulcus', atlas, 'Talairach' transform matrix 'json' format. functions intended called directly, use import_from_freesurfer instead.","code":""},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"","code":"import_fs( subject_name, fs_path, quiet = FALSE, dtype = c(\"T1\", \"surface\", \"curv\", \"atlas_volume\", \"atlas_surface\", \"xform\"), sub_type = NULL, hemisphere = c(\"l\", \"r\"), ... ) import_suma( subject_name, fs_path, quiet = FALSE, dtype = c(\"T1\", \"surface\", \"curv\", \"atlas_volume\", \"atlas_surface\", \"xform\"), sub_type = NULL, hemisphere = c(\"l\", \"r\"), ... )"},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"subject_name character, subject code fs_path path 'FreeSurfer' folder quiet, ... passed methods. dtype data type import, choices 'T1', 'surface', 'curv', 'atlas_volume', 'atlas_surface', 'xform' sub_type detailed files import. 'atlas_surface' supported now hemisphere hemisphere import, ignored dtype 'T1', 'atlas_volume', 'atlas_surface', 'xform'.","code":""},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"logical, TRUE file cached, FALSE file missing.","code":""},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":null,"dir":"Reference","previous_headings":"","what":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"Import `FreeSurfer` create `JSON` cache 3D viewer","code":""},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"","code":"import_from_freesurfer(fs_path, subject_name, quiet = FALSE)"},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"fs_path `FreeSurfer` subject directory subject_name subject code quiet whether suppress message ","code":""},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"None.","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":null,"dir":"Reference","previous_headings":"","what":"List or load all electrode prototypes — list_electrode_prototypes","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"List built-user-customized electrode prototypes. User paths searched first, multiple prototype configuration files found type.","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"","code":"list_electrode_prototypes() load_prototype(type)"},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"type electrode type, character","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"list_electrode_prototypes returns named list, names prototype types values prototype configuration paths; load_prototype returns prototype instance type exists, throw error.","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"","code":"availables <- list_electrode_prototypes() if( \"sEEG-16\" %in% names(availables) ) { proto <- load_prototype( \"sEEG-16\" ) print(proto, details = FALSE) }"},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":null,"dir":"Reference","previous_headings":"","what":"Launch a 'shiny' application to localize electrodes — localization_module","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"'RAVE' installed, please use 'RAVE' modules. function purely demonstration purposes.","code":""},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"","code":"localization_module( subject_code, fs_path, ct_path = NULL, surfaces = \"pial\", use_141 = TRUE, shiny_options = list(launch.browser = TRUE), save_path = tempfile(pattern = \"electrode\", fileext = \".csv\"), ..., control_presets = NULL, side_display = FALSE, controllers = list() )"},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"subject_code subject code fs_path subject's 'FreeSurfer' path ct_path file path 'CT' scans already aligned 'T1'; must 'NIFTI' format surfaces surfaces load use_141 whether try 'SUMA' standard 141 surface; default true shiny_options shiny application options; see options shinyApp save_path temporary file electrode table cached; file used keep track changes case application crashed shutdown ... parameters pass freesurfer_brain2 control_presets, side_display, controllers passed threejs_brain","code":""},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"list 'ui' elements, 'server' function, stand-alone 'app'","code":""},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"","code":"# This example require N27 template brain to be installed # see `?download_N27` for details # using N27 to localize fs_path <- file.path(default_template_directory(), \"N27\") if(interactive() && dir.exists(fs_path)){ module <- localization_module(\"N27\", fs_path) print(module$app) }"},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Multi-subject Template — merge_brain","title":"Create Multi-subject Template — merge_brain","text":"Create Multi-subject Template","code":""},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Multi-subject Template — merge_brain","text":"","code":"merge_brain( ..., .list = NULL, template_surface_types = NULL, template_subject = unname(getOption(\"threeBrain.template_subject\", \"N27\")), template_dir = default_template_directory() )"},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Multi-subject Template — merge_brain","text":"..., .list Brain2 objects template_surface_types template surface types load, default auto-guess template_subject character, subject code treated template, default `N27` template_dir parent directory template subject stored ","code":""},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create Multi-subject Template — merge_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":null,"dir":"Reference","previous_headings":"","what":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"Create load new electrode prototype existing configurations","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"","code":"new_electrode_prototype(base_prototype, modifier = NULL)"},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"base_prototype base prototype, can string prototype type (see list_electrode_prototypes), path prototype configuration file, configuration 'json' format, electrode prototype instance modifier internally used","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"electrode prototype instance","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"","code":"available_prototypes <- list_electrode_prototypes() if(\"Precision33x31\" %in% names(available_prototypes)) { # Load by type name new_electrode_prototype(\"Precision33x31\") # load by path path <- available_prototypes[[\"Precision33x31\"]] new_electrode_prototype(path) # load by json string json <- readLines(path) new_electrode_prototype(json) }"},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot slices of volume — plot_slices","title":"Plot slices of volume — plot_slices","text":"Plot slices volume","code":""},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot slices of volume — plot_slices","text":"","code":"plot_slices( volume, overlays = NULL, transform = NULL, positions = NULL, zoom = 1, pixel_width = 0.5, col = c(\"black\", \"white\"), normalize = NULL, zclip = NULL, overlay_alpha = 0.3, zlim = normalize, main = \"\", title_position = c(\"left\", \"top\"), fun = NULL, nc = NA, which = NULL, ... )"},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot slices of volume — plot_slices","text":"volume path volume (underlay) overlays images overlay top underlay, can either vector paths overlay volume images, sequence named lists. list item 'volume' (path volume) 'color' (color overlay) transform rotation volume scanner 'RAS' space positions vector length 3 matrix 3 columns, 'RAS' position cross-hairs zoom zoom-radio, default 1 pixel_width output image pixel resolution; default 0.5, one pixel 0.5 millimeters wide col color palette, can sequence colors normalize range volume data normalized; either NULL (normalize) numeric vector length two zclip clip image densities; specified, values outside range clipped range overlay_alpha transparency overlay; default 0.3 zlim image plot value range, default identical normalize main image titles title_position title position; choices \"left\" \"top\" fun function two arguments executed image drawn; can used draw cross-hairs annotate image nc number \"columns\" plot many positions, must positive integer; default NA (automatically determined) plane plot; default NULL, trigger new plots add titles; set 1 'Axial' plane, 2 'Sagittal', 3 'Coronal'. ... additional arguments passing image","code":""},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot slices of volume — plot_slices","text":"Nothing","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` ascii file — read_fs_asc","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"Read `FreeSurfer` ascii file","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"","code":"read_fs_asc(file)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"file file location","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"list vertices face indices","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Read FreeSurfer Annotations — read_fs_labels","title":"Read FreeSurfer Annotations — read_fs_labels","text":"Read FreeSurfer Annotations","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read FreeSurfer Annotations — read_fs_labels","text":"","code":"read_fs_labels(path, vertex_number)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read FreeSurfer Annotations — read_fs_labels","text":"path label path vertex_number force reset vertex number raw file incorrect","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` m3z file — read_fs_m3z","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"Read `FreeSurfer` m3z file","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"","code":"read_fs_m3z(filename)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"filename file location, usually located `mri/transforms/talairach.m3z`","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"registration data","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"`m3z` file `gzip` binary file containing dense vector field describes 3D registration two volumes/images. implementation follows `Matlab` implementation `FreeSurfer`. function released `FreeSurfer` license: https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"Read `FreeSurfer` `mgz/mgh` file","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"","code":"read_fs_mgh_mgz(filename)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"filename file location","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"list contains coordinate transforms volume data","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to load surface data from `Gifti` files — read_gii2","title":"Function to load surface data from `Gifti` files — read_gii2","text":"function `read_gii2` dynamic wrapper Python `nibabel` loader. Python detected, switch `gifti::readgii`.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to load surface data from `Gifti` files — read_gii2","text":"","code":"read_gii2(path)"},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Function to load surface data from `Gifti` files — read_gii2","text":"R function acting safe wrapper nibabel.load.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to load surface data from `Gifti` files — read_gii2","text":"path `Gifti` file path","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"function `read_mgz` dynamic wrapper Python `nibabel` loader. Python detected, switch built-function `read_fs_mgh_mgz`, limited features.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"","code":"read_mgz(path)"},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"R function acting safe wrapper nibabel.load.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"path `mgz/mgh` file path","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"Read volume file 'MGH' 'Nifti' formats","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"","code":"read_volume(file, format = c(\"auto\", \"mgh\", \"nii\"), header_only = FALSE)"},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"file file path format file format header_only whether read headers; default false","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"list volume data transform matrices; header_only=TRUE, volume data substituted header.","code":""},{"path":"https://dipterix.org/threeBrain/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. freesurferformats read.fs.annot, read.fs.curv, read.fs.label, read.fs.mgh, read.fs.morph, read.fs.surface, read.fs.transform, read.fs.volume, read.fs.weight, read.nifti1.data, read.nifti1.header, read.nifti2.data, read.nifti2.header, write.fs.surface, write.nifti1, write.nifti2","code":""},{"path":"https://dipterix.org/threeBrain/reference/renderBrain.html","id":null,"dir":"Reference","previous_headings":"","what":"Shiny Renderer for threeBrain Widgets — renderBrain","title":"Shiny Renderer for threeBrain Widgets — renderBrain","text":"Shiny Renderer threeBrain Widgets","code":""},{"path":"https://dipterix.org/threeBrain/reference/renderBrain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shiny Renderer for threeBrain Widgets — renderBrain","text":"expr R expression calls three_brain function Brain object env environment expression evaluated quoted expr quoted? Default false.","code":""},{"path":"https://dipterix.org/threeBrain/reference/renderBrain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Shiny Renderer for threeBrain Widgets — renderBrain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to reshape data to `RAS` order — reorient_volume","title":"Function to reshape data to `RAS` order — reorient_volume","text":"Function reshape data `RAS` order","code":""},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to reshape data to `RAS` order — reorient_volume","text":"","code":"reorient_volume(volume, Torig)"},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to reshape data to `RAS` order — reorient_volume","text":"volume, 3-mode tensor (voxels), usually `mgz`, `nii`, `BRIK` files Torig 4x4 transform matrix mapping volume (`CRS`) `RAS`","code":""},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to reshape data to `RAS` order — reorient_volume","text":"Reshaped tensor dimensions corresponding `R`, ``, `S`","code":""},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Save threeBrain widgets to local file system — save_brain","title":"Save threeBrain widgets to local file system — save_brain","text":"Save threeBrain widgets local file system","code":""},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save threeBrain widgets to local file system — save_brain","text":"","code":"save_brain(widget, path, title = \"3D Viewer\", as_zip = FALSE, ...)"},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save threeBrain widgets to local file system — save_brain","text":"widget generated function 'threejs_brain' path path save brain widget title widget title. as_zip whether create zip file \"compressed.zip\". ... ignored, used backward compatibility","code":""},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save threeBrain widgets to local file system — save_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":null,"dir":"Reference","previous_headings":"","what":"Create 'sEEG' shaft geometry prototype — seeg_prototype","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"Intended creating/editing geometry prototype, please see load_prototype load existing prototype","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"","code":"seeg_prototype( type, center_position, contact_widths, diameter = 1, channel_order = seq_along(center_position), fix_contact = 1, overall_length = 200, description = NULL, dry_run = FALSE, default_interpolation = NULL, overwrite = FALSE )"},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"type type string unique identifier prototype center_position numerical vector, contact center positions contact_widths numerical vector length one, width widths contacts diameter probe diameter channel_order channel order contacts; default sequence along number fix_contact NULL integer channel_order, indicating contact important fixed localization, default 1 (inner-target contact) overall_length probe length, default 200 description prototype description dry_run whether save prototype configurations default_interpolation default interpolation string electrode localization overwrite whether overwrite existing configuration file; default false, throws warning duplicated","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"electrode shaft geometry prototype; configuration file saved 'RAVE' 3rd-party repository.","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"","code":"probe_head <- 2 n_contacts <- 12 width <- 2.41 contact_spacing <- 5 overall_length <- 400 diameter <- 1.12 contacts <- probe_head + width / 2 + 0:(n_contacts-1) * contact_spacing proto <- seeg_prototype( type = \"AdTech-sEEG-SD12R-SP05X-000\", description = c( \"AdTech sEEG - 12 contacts\", \"Contact length : 2.41 mm\", \"Central spacing : 5 mm\", \"Tip size : 2 mm\", \"Diameter : 1.12 mm\" ), center_position = contacts, contact_widths = width, diameter = diameter, overall_length = overall_length, dry_run = TRUE ) print(proto, details = FALSE) #> #> Type : ADTECH-SEEG-SD12R-SP05X-000 #> Description : AdTech sEEG - 12 contacts #> Contact length : 2.41 mm #> Central spacing : 5 mm #> Tip size : 2 mm #> Diameter : 1.12 mm #> Channels : 12 #> Anchors : 12 contacts, 0 non-contacts"},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Manage Template Subjects — template_subject","title":"Download and Manage Template Subjects — template_subject","text":"Download Manage Template Subjects","code":""},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Manage Template Subjects — template_subject","text":"","code":"download_template_subject( subject_code = \"N27\", url, template_dir = default_template_directory() ) download_N27(make_default = FALSE, ...) set_default_template( subject_code, view = TRUE, template_dir = default_template_directory() ) threebrain_finalize_installation( upgrade = c(\"ask\", \"always\", \"never\", \"data-only\", \"config-only\"), async = TRUE ) available_templates()"},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Manage Template Subjects — template_subject","text":"subject_code character letters numbers (Important); default `N27` url zip file address; must specified subject_code followings: 'bert', 'cvs_avg35', 'cvs_avg35_inMNI152', 'fsaverage', 'fsaverage_sym', 'N27' template_dir parent directory subject's `FreeSurfer` folder stored make_default logical, whether make `N27` default subject ... pass download_template_subject view whether view subject upgrade whether check download 'N27' brain interactively. Choices 'ask', 'always', 'never' async whether run job parallel others; default true","code":""},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Manage Template Subjects — template_subject","text":"view electrodes implanted multiple subjects, highly recommended view template space detail mapping method discussed function freesurfer_brain. map template space, one idea find someone whose brain normal. case, choice subject `N27`, also known `Colin 27`. function download_N27 provides simple easy way download partial version Internet. ideas template brain, can use function set_default_template(subject_code, template_dir) redirect choice. template brain `Zip` file Internet, provide function download_template_subject automatically install .","code":""},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download and Manage Template Subjects — template_subject","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/threeBrain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a brain object — threeBrain","title":"Create a brain object — threeBrain","text":"Create brain object","code":""},{"path":"https://dipterix.org/threeBrain/reference/threeBrain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a brain object — threeBrain","text":"","code":"threeBrain( path, subject_code, surface_types = \"pial\", atlas_types, ..., template_subject = unname(getOption(\"threeBrain.template_subject\", \"N27\")), backward_compatible = getOption(\"threeBrain.compatible\", FALSE) )"},{"path":"https://dipterix.org/threeBrain/reference/threeBrain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a brain object — threeBrain","text":"path path 'FreeSurfer' directory, 'RAVE' subject directory containing 'FreeSurfer' files, simply 'RAVE' subject subject_code subject code, characters surface_types surface types load; default 'pial', common types 'white', 'smoothwm' atlas_types brain atlas load; default 'wmparc', exists, 'aparc+aseg', choices 'aparc.a2009s+aseg', 'aparc.DKTatlas+aseg', depending atlas files 'fs/mri' folder ... reserved future use template_subject template subject refer ; used group template mapping backward_compatible whether support old format; default false","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejsBrainOutput.html","id":null,"dir":"Reference","previous_headings":"","what":"Shiny Output for threeBrain Widgets — threejsBrainOutput","title":"Shiny Output for threeBrain Widgets — threejsBrainOutput","text":"Shiny Output threeBrain Widgets","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejsBrainOutput.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shiny Output for threeBrain Widgets — threejsBrainOutput","text":"outputId unique identifier widget width, height width height widget. default width=\"100 height=\"500px\". reportSize whether report widget size shiny session$clientData","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejsBrainOutput.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Shiny Output for threeBrain Widgets — threejsBrainOutput","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Threejs Brain and View it in Browsers — threejs_brain","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"Create Threejs Brain View Browsers","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"","code":"threejs_brain( ..., .list = list(), width = NULL, height = NULL, background = \"#FFFFFF\", cex = 1, timestamp = TRUE, title = \"\", side_canvas = FALSE, side_zoom = 1, side_width = 250, side_shift = c(0, 0), side_display = TRUE, control_panel = TRUE, control_presets = NULL, control_display = TRUE, camera_center = c(0, 0, 0), camera_pos = c(500, 0, 0), start_zoom = 1, symmetric = 0, default_colormap = \"Value\", palettes = NULL, value_ranges = NULL, value_alias = NULL, show_inactive_electrodes = TRUE, surface_colormap = system.file(\"palettes\", \"surface\", \"ContinuousSample.json\", package = \"threeBrain\"), voxel_colormap = system.file(\"palettes\", \"datacube2\", \"FreeSurferColorLUT.json\", package = \"threeBrain\"), videos = list(), widget_id = \"threebrain_data\", tmp_dirname = NULL, debug = FALSE, enable_cache = FALSE, token = NULL, controllers = list(), browser_external = TRUE, global_data = list(), global_files = list(), qrcode = NULL, custom_javascript = NULL, show_modal = \"auto\", embed = FALSE )"},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"..., .list geometries inherit AbstractGeom width, height positive integers. Width height widget. default width=`100%`, height varies. background character, background color \"#FFFFFF\" \"white\" cex positive number, relative text magnification level timestamp logical, whether show time-stamp beginning title viewer title side_canvas logical, enable side cameras view objects fixed perspective side_zoom numerical, side camera enabled, zoom-level, 1 5 side_width positive integer, side panel size pixels side_shift integer length two, side panel shift pixels (`CSS style`: top, left) side_display logical, show/hide side panels beginning control_panel logical, enable control panels widget control_presets characters, presets shown control panels control_display logical, whether expand/collapse control UI beginning camera_center numerical, length three, XYZ position camera focus camera_pos XYZ position camera , default (0, 0, 500) start_zoom numerical, positive number indicating camera zoom level symmetric numerical, default 0, color center mapped value default_colormap character, color map name display startup palettes named list, names corresponds color-map names want change color palettes value_ranges named list, similar palettes, value range values value_alias named list, legend title corresponding variable show_inactive_electrodes logical, whether show electrodes values surface_colormap color map path generated create_colormap(gtype=\"surface\") render surfaces vertices; see create_colormap details. voxel_colormap color map path generated create_colormap(gtype=\"volume\") render volume atlases; see create_colormap details. videos named list, names corresponds color-map names, items generated video_content widget_id character, internally used unique identifiers widgets; use multiple widgets one website tmp_dirname character path, internally used, store temporary files debug logical, internally used debugging enable_cache whether enable cache, useful rendering viewers repeatedly shiny applications token unique character, internally used identify widgets 'JavaScript' 'localStorage' controllers list override settings, example proxy$get_controllers() browser_external logical, use system default browser (default) built-one. global_data, global_files internally use, mainly store orientation matrices files. qrcode 'URL' show 'QR' code; can character string named list 'url' 'text' (hyper-reference text) custom_javascript customized temporary 'JavaScript' code runs ready state; available 'JavaScript' variables : 'groups' input information group 'geoms' input information geometry 'settings' input information canvas settings 'scene' 'threejs' scene object 'canvas' canvas object 'gui' controls data panel 'presets' preset 'gui' methods show_modal logical \"auto\", whether show modal instead direct rendering viewers; designed users 'WebGL' support; used shiny applications embed whether try embedding viewer current run-time; default false (launch default web browser); set true running 'rmarkdown' 'quarto', see viewer 'RStudio' default panel.","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"","code":"if( interactive() ) { library(threeBrain) # Please use `download_N27` to download N27 Collins template brain n27_path <- file.path(default_template_directory(), \"N27\") if( dir.exists(n27_path) ) { brain <- threeBrain(path = n27_path, subject_code = \"N27\", surface_types = c('pial', 'smoothwm')) print(brain) brain$plot( background = \"#000000\", controllers = list( 'Voxel Type' = 'aparc_aseg', 'Surface Type' = 'smoothwm', 'Blend Factor' = 1, 'Right Opacity' = 0.3, 'Overlay Sagittal' = TRUE ), show_modal = TRUE ) } }"},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":null,"dir":"Reference","previous_headings":"","what":"Add video content to the viewer — video_content","title":"Add video content to the viewer — video_content","text":"Add video content viewer","code":""},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add video content to the viewer — video_content","text":"","code":"video_content( path, duration = Inf, time_start = 0, asp_ratio = 16/9, local = TRUE )"},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add video content to the viewer — video_content","text":"path local file path 'URL' duration duration video time_start start time relative stimuli onset asp_ratio aspect ratio; default 16/9 local used path 'URL': whether download video generating viewer; see 'Details'","code":""},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add video content to the viewer — video_content","text":"video path can either local file path 'URL' websites. path internet, two options: download video generating viewer, directly use 'URL'. download happens viewer generated (local=TRUE), video content local. viewer self-contained. However, distribution contain video, archive size might large. raw 'URL' used (local=FALSE), viewer self-contained video link might break anytime. 'screenshot' 'record' function might limited 'URL' different domain . However, distribution contain video, hence smaller. works scenarios preferred share video files licensed, simply distribution limited. Besides, method slightly faster local alternatives.","code":""},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"Generate surface file 'nii' 'mgz' volume files","code":""},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"","code":"volume_to_surf( volume, save_to = NA, lambda = 0.2, degree = 2, threshold_lb = 0.5, threshold_ub = NA, format = \"auto\" )"},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"volume path volume file, object read_volume. save_to save surface file; default NA (save). lambda 'Laplacian' smooth, higher smoother degree 'Laplacian' degree; default 2 threshold_lb lower threshold volume (create mask); default 0.5 threshold_ub upper threshold volume; default NA (upper bound) format format file save_to valid path, choices include 'auto' Default, supports 'FreeSurfer' binary format 'ASCII' text format, based file name suffix 'bin' 'FreeSurfer' binary format 'asc' 'ASCII' text format 'ply' 'Stanford' 'PLY' format '' Object file format 'obj' 'Wavefront' object format 'gii' 'GIfTI' format. Please avoid using 'gii.gz' file suffix 'mz3' 'Surf-Ice' format 'byu' 'BYU' mesh format 'vtk' Legacy 'VTK' format 'gii', otherwise 'FreeSurfer' format. Please use 'gii.gz' suffix.","code":""},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"Triangle 'rgl' mesh (vertex positions native 'RAS'). save_to valid path, mesh saved location.","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"","code":"library(threeBrain) N27_path <- file.path(default_template_directory(), \"N27\") if(dir.exists(N27_path)) { aseg <- file.path(N27_path, \"mri\", \"aparc+aseg.mgz\") # generate surface for left-hemisphere insula mesh <- volume_to_surf(aseg, threshold_lb = 1034, threshold_ub = 1036) if(interactive()) { ravetools::rgl_view({ ravetools::rgl_call(\"shade3d\", mesh, color = \"yellow\") }) } }"},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":null,"dir":"Reference","previous_headings":"","what":"Color maps for volume or surface data — voxel_colormap","title":"Color maps for volume or surface data — voxel_colormap","text":"Color maps volume surface data","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Color maps for volume or surface data — voxel_colormap","text":"","code":"create_colormap( gtype = c(\"surface\", \"volume\"), dtype = c(\"continuous\", \"discrete\"), key, color, value, alpha = FALSE, con = NULL, auto_rescale = FALSE, ... ) save_colormap(cmap, con) freeserfer_colormap(con) load_colormap(con)"},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Color maps for volume or surface data — voxel_colormap","text":"gtype geometry type, choices \"surface\", \"volume\" dtype data type, \"continuous\" \"discrete\" key non-negative integer vector corresponding color values; length must exceed 1; see 'Details' color characters, corresponding color strings key value actual value key alpha whether respect transparency con file path write results read . file path can passed voxel_colormap threejs_brain. auto_rescale automatically scale color according image values; valid continuous color maps ... used continuous color maps, passed colorRampPalette cmap color map object","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Color maps for volume or surface data — voxel_colormap","text":"list color map information","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Color maps for volume or surface data — voxel_colormap","text":"Internal 'JavaScript' shader implementation uses integer color keys connect color palettes corresponding values. keys must non-negative. Zero key special color key reserved system. Please avoid using valid values.","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Color maps for volume or surface data — voxel_colormap","text":"","code":"# Creates a symmetric continuous colormap with 3 keys # The color range is -10 to 10 # The colors are 'blue','white','red' for these keys pal <- create_colormap( gtype = \"volume\", dtype = \"continuous\", key = c(1,2,3), value = c(-10,0,10), color = c('blue','white','red')) print( pal ) #> #> Version: 1.1 #> Geometry Type: volume #> Data Type: continuous #> Transparent: FALSE #> # of keys: 3 #> Min Colorkey: 1 #> Max Colorkey: 3 #> Auto-rescale ColorKey: no #> Value Range: -10 ~ 10 # ---------------- Get colormap key from a value ------------ # returns key index starting from pal$get_key( -10 ) #> [1] 1 # nearest value pal$get_key( 2 ) #> [1] 2 # set threshold, key is now 0 (no color) pal$get_key( 2, max_delta = 1 ) #> [1] 0 # ---------------- Save and load ---------------- f <- tempfile( fileext = '.json' ) save_colormap( pal, f ) cat(readLines(f), sep = '\\n') #> {\"__global_data__.VolumeColorLUT\":{\"map\":{\"1\":{\"ColorID\":1,\"Label\":-10,\"R\":0,\"G\":0,\"B\":255},\"2\":{\"ColorID\":2,\"Label\":0,\"R\":255,\"G\":255,\"B\":255},\"3\":{\"ColorID\":3,\"Label\":10,\"R\":255,\"G\":0,\"B\":0}},\"mapAlpha\":false,\"mapMinColorID\":1,\"mapMaxColorID\":3,\"mapValueRange\":[-10,10],\"mapDataType\":\"continuous\",\"mapGeomType\":\"volume\",\"colorIDAutoRescale\":false,\"mapVersion\":1.1}} load_colormap(f) #> #> Version: 1.1 #> Geometry Type: volume #> Data Type: continuous #> Transparent: FALSE #> # of keys: 3 #> Min Colorkey: 1 #> Max Colorkey: 3 #> Auto-rescale ColorKey: no #> Value Range: -10 ~ 10"},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate volume data from 'MNI' coordinates — voxel_cube","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"Generate volume data 'MNI' coordinates","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"","code":"add_voxel_cube( brain, name, cube, size = c(256, 256, 256), trans_mat = NULL, trans_space_from = c(\"model\", \"scannerRAS\"), color_format = c(\"RGBAFormat\", \"RedFormat\") ) add_nifti( brain, name, path, trans_mat = NULL, color_format = c(\"RGBAFormat\", \"RedFormat\"), trans_space_from = c(\"model\", \"scannerRAS\") ) create_voxel_cube( mni_ras, value, colormap, keys = colormap$get_key(value), dimension = c(256, 256, 256) )"},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"brain 'threeBrain' brain object generated freesurfer_brain2 merge_brain. 'rave' package installed, brain can generated rave::rave_brain2 name name voxel cube, letters, digits '_' allowed; characters replaced '_' cube 3-mode array; see following example size actual size volume, usually dot multiplication dimension voxel size trans_mat transform matrix volume. add_voxel_cube, matrix data cube geometry model center world ('tkrRAS') transform. add_nifti, matrix 'Nifti' 'RAS' world ('tkrRAS') transform. trans_space_from trans_mat transform begin; default object 'model' space; alternative space 'scannerRAS', meaning matrix transform volume cube 'scannerRAS' world space. color_format color format internal texture. Default 4-channel 'RGBAFormat'; alternative choice 'RedFormat', saves volume data single red-channel save space path 'Nifti' data path mni_ras 'MNI' 'RAS' coordinates, n--3 matrix value data values (length n); used keys missing colormap color map generated create_colormap; see voxel_colormap details keys integer color-keys generated color map length n; alternatively, specify value colormap generate keys automatically dimension volume dimension; default 256 x 256 x 256 array cube; must integers length 3","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"create_voxel_cube returns list cube data informations; add_voxel_cube returns brain object","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"","code":"# requires N27 brain to be installed # use `download_N27()` to download template Collins brain # sample MNI coords tbl <- read.csv(system.file( 'sample_data/example_cube.csv', package = 'threeBrain' )) head(tbl) #> X x y z key #> 1 1 50 -60 -14 215 #> 2 2 62 -22 -22 229 #> 3 3 42 -64 10 209 #> 4 4 36 -60 2 230 #> 5 5 34 -72 10 149 #> 6 6 50 -50 6 229 # load colormap cmap <- load_colormap(system.file( 'palettes/datacube2/Mixed.json', package = 'threeBrain' )) x <- create_voxel_cube( mni_ras = tbl[, c('x', 'y', 'z')], keys = tbl$key, dimension = c(128, 128, 128) ) n27_path <- file.path(default_template_directory(), \"N27\") if( interactive() && dir.exists(n27_path) ) { brain <- merge_brain() # or add_voxel_cube(brain, 'example', x$cube) x$add_to_brain(brain, 'example') brain$plot(controllers = list( \"Voxel Type\" = 'example', 'Right Opacity' = 0.3, 'Left Opacity' = 0.3, 'Background Color' = '#000000' ), voxel_colormap = cmap) }"},{"path":"https://dipterix.org/threeBrain/shortcuts.html","id":null,"dir":"","previous_headings":"","what":"3D Brain Viewer Shortcuts","title":"3D Brain Viewer Shortcuts","text":"shortcut keys active mouse main canvas (controling GUI side panel) Hold Ctrl, Shift, Alt drag brain want fix rotation axis using MacOSX, Alt key equivalent Option [⌥], Ctrl equivalent Control [^]","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"major-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Major Changes","title":"threeBrain 1.1.0","text":"threejs engine upgraded v160; added support NIfTI GIfTI images Allowed data embedded viewer dataURI. results truly standalone viewer: extra engine required, web-browser needed. Added electrode geometry prototype, allowing users see electrode rather using spheres, useful electrodes super micro contacts electrodes segmented contact like DBS Added support showing (cortical sub-cortical) ROI surfaces Implemented drag--drop feature drop arbitrary volume (nii,mgz) surface (fs,gii) files viewer. surface coordinate system inferred file name following BIDS convention. surface color can set via color-map (csv) file name Implemented slice (side viewer) overlay Users can control side camera frustums (near far) separately Implemented worker system viewer can run truly parallel code background line--sight mode, underlay image sliced dynamically plane orthogonal line sight; two (orthogonal) planes parallel line sight snap--electrode, volume slices snapped electrode direction (available electrode prototype used electrode direction defined). two planes dynamically slice MRI Users can localize electrode probe clicking target location, entry location Added option add QR code viewer, allowing people link publication Loading progress informative now Implemented plot_slices allow plotting MRI slices contact canonical order Users can set default colors electrodes via brain$electrodes$fix_electrode_color Users can override underlay images placing rave_slices.nii[.gz] mri/ FreeSurfer folder File/Data loaders use JavaScript workers now (can disabled enable_cache=TRUE) Added mesh clipping see depth electrodes without compromising color Implemented volume clipping Added new mode ACPC alignment Added target flag objects can rendered differently main canvas versus side canvas","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"minor-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"threeBrain 1.1.0","text":"Electrode prototype names follow type-company-version.json format Added compass object side cameras slice mode canonical Remove UV mapping sphere electrodes Added model direction electrodes assist calculating Euler axis angles Volume, atlas threshold asynchronous now Changed default values controller Added broadcast() controllers; Atlas key number displayed users longer need search look-table Added debug flag keyboard shortcuts Viewer finally compiles quarto/rmarkdown Implemented functions create sEEG electrodes Slices write depth buffer rendered side canvas, electrode contacts blocked Allowed anchor fixed localizing electrode prototype Using instancedMesh render actual electrode spheres prototype used users choose see actual contact locations Implemented mapToTemplate electrode prototypes Pial surface write depth buffer ’s super transparent Added drivers set object transform matrix Adjust implementation background color arcball radius Removed composer effects, using shaders render electrode outline Trackball uses longer side canvas instead shorter side radius Added electrode visibility mode: use threshold-show contacts pass threshold even display value given Overlay brightness can adjusted via controller Adjusted title position Updated CITATION New color map used electrodes consistent RAVE color Allow adding additional geometries brain$plot Improved spacing interpolation extrapolation (electrode localization); removed old interpolation logic; added distanceRatio prevent large shift (auto adjust) Electrodes opaque main transparent side canvas Using pial surface center trackball center Dithering datacube2 make rendering natural main canvas default set MRI slices visible surfaces missing Drag & drop file names sanitized avoid displaying issues Electrode contacts (instancedMesh) now click-able dispose cleaner now, also fires events Added makeClickable removeClickable replace previous add_clickable function Renamed register_object registerToMap Better ways sanitize datacube Improved datacube overlay texture, including using clamp--border instead clamp--edge Ray-casting electrode prototypes instancedMesh now works contact-mode Show electrode prototype contacts default Added color modes uploaded images removed normalize method (replaced getNormalizedImage) NiftiImage MGHImage Using script generate change log automatically Git commits Scrolling side canvas faster now Allowed prototype contact colors fixed Prototype control points displays channel information (provided control points channels) Added color (randomColor, testColorString) file-name utility functions Soft removed addColorCoat using ElectrodeMaterial, results massive code improvement electrode instance Allow set default electrode colors contact rendered values fixed color Scrolling side canvas faster now Color look-table can set arbitrary single color (HexString, indicating values rendered color; Drag & Drop volumes can change single colors Remembers state switching volumes (datacube2)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-1-1-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 1.1.0","text":"Fixed NamedLut color error value range zero Prototype electrode click information displays channel number Fixed RShinyDriver issue object construction parameters (using getThreeBrainInstance instead) Avoid rendering volume data sub-cortical ROI Fixed UV issues electrode geometry prototypes Fixed bug slice instance missing controller tries set overlay JavaScript map hidden compiled browsers complain missing maps Significantly reduced chances viewer crash R shiny applications Fixed shader crash issue Windows WebGL2 hard requirement now; users notified requirement met Mouse position canvas calculated every mouse instead every resizing fix control issues page scrolled shiny app Fixed controller.load handle invalid set controller request Fixed textsprite depth issues Fixed light new engine Fixed visualization volume cubes using NIfTI files Fixed volume transforms sform qform inconsistent NIfTI Fixed bug interpolation spacing fixed incorrect ROI label as_subcortical_label generates correct white-matter labels Fixed freesurfer_lut Fixed auto-adjust feature (electrode localization) Fixed UV mapping issue sphere electrode geometry Fixed shader issue transparency set negative (treated 1) Using NIfTI headers get calculated color intensities applying heuristic approach","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-102","dir":"Changelog","previous_headings":"","what":"threeBrain 1.0.2","title":"threeBrain 1.0.2","text":"Removed shader loop accidentally used dynamic variable looping, may crash Windows certain situations Updated README.md Composer effects removed Added default color electrodes (JavaScript) fix localization electrode color set correctly issues Added z-index base side canvas layer (div) Removed additional unused parameters material call Used new material type make brain realistic New background color implemented Trackball uses width instead height viewer Arcball radius; mouse positions calculated whenever mouse-event triggered (allowing accurate track-ball calculation Shiny applications) Made col2hexstr internal function Added new electrode visibility mode, allowing show contacts values passing threshold Added brain$electrodes$fix_electrode_color fix electrode colors given data names (display DBS electrodes, example) Made controller.load robust errors Fixed depth issue TextSprite default controller values changed make sense Outline render effect removed; electrode outlines implemented directly shader Updated three.js v160 light model improved Added rave_slices.nii allowed MRI prefix FreeSurfer folder highest priority, image treated default volume load side canvas (default still brain.finalsurfs.mgz) Allow MRI change brightness dynamically viewer Ensure voxels index zeros Added brain$get_atlas_labels guess atlas labels given masks atlas files Allowed spatially transform electrodes desired coordinate system Updated citation standalone viewer require static server anymore: everything self-contained (require pandoc, comes RStudio) Changed mechanism animation color map generator (color accurate discrete variables) Added png dependence Added support AC-PC alignment, available RAVE - YAEL module Allow brain plot additional customized geometries Added plot_slides plot MRI centered electrode contact slide--slide visualization Added Line--Sight view mode side canvas; can enabled using shortcut m (previous shortcut change material type changed shift+M) Fixed CT JavaScript sform qform different (different code) Allowed specify spacing interpolation extrapolation unequally spaced electrodes Added electrode outlines YAEL paper finally Fixed incorrect sub-cortical labels Deprecated old format (cache needed anymore) Made electrodes opaque main transparent side canvas Let controllers check variable valid set avoid invalid viewer state initialization Added get_ijk2ras get Norig Torig matrix","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-101","dir":"Changelog","previous_headings":"","what":"threeBrain 1.0.1","title":"threeBrain 1.0.1","text":"CRAN release: 2023-07-03 Updated controller library reasonable input focus Allow MRI slices NIfTI format Set slices visible default surface available Fixed transform datacube2 Fixed qform reading NIfTI files Fixed auto-refine functions electrode localization Removed clipboard auto-copy auto-paste functions since conflict viewers; instead users can use controllers copy paste state","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-100---egypt","dir":"Changelog","previous_headings":"","what":"threeBrain 1.0.0 - Egypt","title":"threeBrain 1.0.0 - Egypt","text":"CRAN release: 2023-06-03 version major update. Created threeBrain::threeBrain formal way create brain objects Updated JavaScript engine v150 Allow getting HTML tags saved widget widget can used Jupyter notebook Added $render method remember viewer states Allowing set title via proxy driver Added citation information Fixed hemisphere issue localization electrodes closer opposite hemispheres Added electrode registration anatomical slice cross-hair","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-029","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.9","title":"threeBrain 0.2.9","text":"CRAN release: 2023-03-14 version plans major update. highlights: Electrode localization can done original CT instead re-sampled ones Completely isolate JavaScript engine R code. JavaScript code available npm package used via sub-module Implemented file readers directly JavaScript, allows reading files directly viewer, cache needed home-brew version threejs required: standard npm distribution used New controller GUI implemented viewer can driven via JavaScript directly via event dispatchers Anatomical segmentation map visible side panels; voxel values displayed setting crosshair","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"detailed-changes-0-2-9","dir":"Changelog","previous_headings":"","what":"Detailed Changes","title":"threeBrain 0.2.9","text":"Added step size datacube2 material uniforms Upgraded threejs r148, use npm distribution “three” Massive code re-factory (variable names, trackball controls, legacy classes…) Removed data-GUI use lil-GUI Fixed compass (finally…) Added title viewer Reworked whole message signal system, added ThrottledEventDispatcher.js Added MouseKeyboard class track mouse keyboard events, greatly reduced canvas burden Added animParameter object canvas keep track animation parameters reworked shiny drivers fixed one-voxel shift issues Added format support nii, mgh/mgz, FreeSurfer surface, FreeSurfer node value binary formats Added function threeBrain allow 3D viewer run without cache (fs ) Fixed memory leak issues JavaScript code Geometry groups can now change storage path JS completely independent now (available npm now) Peel event dispatcher canvas class events can managed separately Hide time-stamps data/animation available Added experimental support show labels regular electrodes; currently depth-test turned Added GUI support change electrode label visibility size Electrode label size adjusts along electrode radius handle_resize now put resizing function detecting widget size small","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-9","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.9","text":"Fixing xfm parsed correctly line starts blank spaces Stopped rendering canvas canvas small (less 10 pixels)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-027","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.7","title":"threeBrain 0.2.7","text":"CRAN release: 2022-10-15","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-7","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.7","text":"Rewired events, allowing drive viewer via JavaScript events Allowed set animation playback status Remove modal default raveio ravedash loaded Edited launch script always use Python3","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-7","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.7","text":"Fixed installation issues (template brain) Windows, avoid backslashes","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-026","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.6","title":"threeBrain 0.2.6","text":"CRAN release: 2022-08-25","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-6","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.6","text":"Allowed users pan camera localizing electrodes Added line segment geometry type can either display static line segments (DTI), connect two electrodes dynamically Printing brain now uses accurate terms Allowed CT either path actual data calling localizing function","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-6","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.6","text":"Fixed NifTi orientation issues use sform Fixed localization issue NifTi transform matrix determinant equally 1 Fixed volume shader, resolved shift issues panning camera","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-025","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.5","title":"threeBrain 0.2.5","text":"CRAN release: 2022-05-30","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-5","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.5","text":"Surface sync voxels now clamp surface nodes Added Voxel Display controller toggle volume display modes Changed shortcut l Voxel Type Voxel Display Volume fragmentShader uses non-linear function calculate fragment colors combined face normal; create smoother results DataCube2 geometry uses ConvexHull instead box/sphere improve performance DataCube2 longer hidden sync voxels : users can use shortcuts l k easily control visibility. download_template_subject can download templates fsaverage, cvs_avg35, bert.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-5","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.5","text":"Fixed volume rendering issue ray-marching directions calculated correctly Fixed color set correctly changing Voxel Labels surface colors sync voxels","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-024","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.4","title":"threeBrain 0.2.4","text":"CRAN release: 2021-12-03 version mainly works electrode localization. changes occur JavaScript engine.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-4","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.4","text":"Allows electrodes reset Displays electrode labels along electrodes Allows resizing electrode size fly Allows resizing electrode labels Localization module integrated RAVE Added line mesh mark distance electrode deviating original position. line color changes distance value.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-4","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.4","text":"Improved localization precision Auto-adjusting electrodes now respects topology Electrodes localization mode now LocElectrode class Volume rendering ray-casters now respects transform matrices","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-023","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.3","title":"threeBrain 0.2.3","text":"CRAN release: 2021-10-13","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-3","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.3","text":"Electrode localization now shiny application","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-3","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.3","text":"Added 3 vignettes","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-2","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.2","text":"Supported video content display auditory visual stimuli along response Default closing default volume side folders","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-2","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.2","text":"Fixed electrode localization interpolation issue Proper dispose localized electrodes Fixed screenshot video recording functions Renamed recording button Chrome-specific","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-021","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.1","title":"threeBrain 0.2.1","text":"CRAN release: 2021-08-03","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.1","text":"Finally, electrode localization added! Added TextTexture internal code display text Sprite easily Can download electrodes csv","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-020","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.0","title":"threeBrain 0.2.0","text":"CRAN release: 2021-07-27","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.0","text":"efficient volume rendering transparency Added shader functions surface instances, allowing color rendering volume, electrodes, vertices (major change) Added color-map generator surface volume data Added method generate data cube (volume) MNI305 coordinates Optimized loading procedure Removed crayon, base64enc, htmltools, pryr dependence","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-0","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.0","text":"Bumped threejs version v131dev Fixed surface transparency losing fragments issue Added loaders shiny applications avoid performance issues old computers Fixed electrodes selected mouse click-(Firefox)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-019","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.9","title":"threeBrain 0.1.9","text":"CRAN release: 2021-01-10","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-9","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.9","text":"Added backend engine volume rendering show atlas files Standalone viewers now use native system tools Mac Linux (Windows, still needs R installed)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-9","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.9","text":"Allows super slow play speed show animations millisecond level Bumped threejs newer version fixed compatibility issues Animation time range reasonable","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-018","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.8","title":"threeBrain 0.1.8","text":"CRAN release: 2020-06-23","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-8","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.8","text":"Screenshot now downloads pdf format","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-8","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.8","text":"Fixed freesurferformats face index starting 1 instead 0","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-017","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.7","title":"threeBrain 0.1.7","text":"CRAN release: 2020-05-12","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-7","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.7","text":"Now displays MNI305 coordinates instead tkRAS coordinates Removed reticulate related functions support native R functions","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-7","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.7","text":"Fixed MNI305 calculation issues Internally calculates anterior commissure","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-6","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.6","text":"Implemented view_ct_t1 view CT aligned T1 images Updated document generate FreeSurfer brain Removed dependency nibabel use native R packages Re-designed legends, added options show, hide display information Added screenshot download image","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-6","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.6","text":"Added hints keyboard shortcuts","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-015","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.5","title":"threeBrain 0.1.5","text":"CRAN release: 2020-01-20","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-5","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.5","text":"Import FreeSurfer SUMA files sulc Control element update Added brain_proxy control shiny element Separated display threshold data FreeMesh material can switched MeshPhongMaterial MeshLambertMaterial","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-5","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.5","text":"UI blur focus clicking canvas Allow customizing widgets background, cex (font magnification), timestamp (display time) Allow controllers (list) override control UI Added preset syncviewers (threejs_brain(control_presets = ...)) synchronize multiple viewers shiny environment","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-014","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.4","title":"threeBrain 0.1.4","text":"CRAN release: 2019-10-18","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-4","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.4","text":"Implemented new mesh type - volume rendering using ray marching Added alternative methods read .nii files, nibabel now optional Customized color palettes value range better visualizations outliers requires T1.mgz brainmask brain.finalsurf found. allows users run FreeSurfer first stage, takes around 8 10 minutes instead 6 hours. Fully compatible htmlwidgets shiny mode. calling threejsBrainOutput shiny::renderUI, DOM element might get reset shiny, causing new 3D viewer created. might consume resource, causing memory leaks even conflict context renderings. Also event listeners couldn’t reset correctly. cache created now reusing canvas.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-4","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.4","text":"flexible directory requirement Added dispose function canvas memory gets cleared correctly Renderer optimization memory optimization","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-1-4","dir":"Changelog","previous_headings":"Changes","what":"Bug Fixes","title":"threeBrain 0.1.4","text":"Fixed keyboard listeners locking keys Fixed huge memory leaks due threejs garbage collecting geometries textures","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-013","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.3","title":"threeBrain 0.1.3","text":"CRAN release: 2019-09-10","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-3","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.3","text":"File structure change: now directly read FreeSurfer folder Added readers .mgz, .m3z files Added coordinate system align volume surface data Implemented side-viewers, added three side cameras XYZ axis Can now read, export electrodes csv file Re-write brain generating function Can display/switch multiple value types Added transparency surfaces Implemented experimental electrode localization Automatically determine color type (continuous discrete) value range","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-3","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.3","text":"Shortcuts available Optimized electrode value settings","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-012","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.2","title":"threeBrain 0.1.2","text":"CRAN release: 2019-06-28","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.2","text":"Re-draw canvas 2D context make customized overlay directly canvas. Implemented continuous discrete legends replace D3. Added support set main camera position initial zoom level. Added 3D scatter plot examples. Use hybrid render mode animation required save battery usage. Improved color palette calculation. Support customized title.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-2","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.2","text":"Support customized datapath saving widgets. Added instructions embed widgets websites without R.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-011","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.1","title":"threeBrain 0.1.1","text":"Implemented three types geometries: plane, sphere free. free geometry takes arbitrary geometry vertices faces form 3D mesh object. Added animation sphere object. Replaced old JavaScript npx driven modules. Implemented D3 side-widget","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-010","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.0","title":"threeBrain 0.1.0","text":"Initial private beta release!","code":""}]
+[{"path":"https://dipterix.org/threeBrain/CHANGELOG.html","id":"changes-since-last-cran-release","dir":"","previous_headings":"","what":"Changes since last CRAN release","title":"NA","text":"249626d4 (HEAD -> master) [dipterix]: Prototype set_transform_from_points now tries set rotation transform Euler angle prototype guided marker 1-ranked (electrode strip, DBS electrodes) 7529aa91 [dipterix]: Allowed electrode prototype display markers; added viewer options localization b35e7dc1 [dipterix]: Changed electrode direction helper displayed inside crosshair group; Allowed side panel displayed atlas column-row-slice; Added controller display symmetric continuous color map volumes 12970a6b (origin/master, origin/HEAD) [dipterix]: Fixed GLTF showing inner-contact issue c8522cd7 [dipterix]: Removed devel version ravetools check 11bb99e8 [dipterix]: Update Github action check script cbeac8bc [dipterix]: Added rhub check b302dd71 [dipterix]: minor change 02880b44 [dipterix]: Ready CRAN release 9efec0cb [dipterix]: Removed doc folder bae88ccb [dipterix]: Plotting slices correct margins partial plot 4bd0352c [dipterix]: Allow users drag drop value tables 10ac71ad [dipterix]: Allow users hide crosshairs 05836f94 [dipterix]: Allow shiny app change current color map via proxy fbca42f4 [dipterix]: Allows drag-drop electrode color files; Added set_electrode_data brain proxy class, allowing shiny applications change electrode data, set color palettes, set value ranges call a14cd3f5 [dipterix]: Allow masks added T1; Added D99v2 monkey brain; Added demo code; Export GLTF datacube2 9268886f [dipterix]: Fixed fix_electrode_color bug 62567274 [dipterix]: Supported ISO surface generation voxels a6295c2c [dipterix]: Added white-matter segmentation default atlas user file cd8e15e8 [dipterix]: Exporting GLTF wrapped try-catch 963859ed [dipterix]: fix_electrode_color exclusive default; fixed color fixing issue naive sphere electrodes 1dea870f [dipterix]: Changed logo message 1e70580a [dipterix]: Using better RAVE logo fixed style issues; Changed shortcut p toggling visibility shift+p switching surface types 9b76fa41 [dipterix]: Added logo control panel advertise project 226994ba [dipterix]: Added export GLTF binary format; Separate 3D 2D canvas; e556d025 [dipterix]: Converts *h.pial.gii FreeSurfer format files missing 8d8c36dc [dipterix]: Allow electrode depth test disabled (always-depth) contact /outlines 558564ec [dipterix]: Typo fix SliceShader 40d60f02 [dipterix]: Fixing vertex shader output read fragment shader issue 82b23f63 [dipterix]: Drop-feature support color-map volume surfaces 0dfb0531 [dipterix]: Fixing readme vignettes b28c0643 [dipterix]: Added contact order display electrode clicked 33d7c9b3 [dipterix]: Added DIXI (, BM,CM`) electrode specifications a2d6fb53 [dipterix]: Added brightness contrast adjustment keyboard shortcut 2c636b26 [dipterix]: Added option set crosshair gap 8137d32a [dipterix]: Added model_rigid=FALSE allow electrode morph (trajectory) ce375985 [dipterix]: Underlay image needed 29141273 [dipterix]: Added default interpolation string sEEG electrodes ff9997df [dipterix]: Changed sEEG contact radius shaft radius half contact widths, increasing visibility 1397eade [dipterix]: Disabled user-selection event CSS zoom-tools (side canvas) 6993bab0 [dipterix]: Supported drag drop curvature files pial built-color map 31b7f388 [dipterix]: Skip smooth step lambda non-positive 8b814e08 [dipterix]: plot_slices allows overlay images 5ad19c55 [dipterix]: Fixed right-click settings crosshairs correctly template brain 8ccd7706 [dipterix]: Drag drop feature supports STL format now; Color map remembered regardless file extension d6de9e10 [dipterix]: Added conform_volume conform images simulate FreeSurfer conform algorithm 40d10a3b [dipterix]: Exported write.fs.surface 8f356c31 [dipterix]: volume_to_surf can take objects (read_volume) input c1e25e3a [dipterix]: Fixed subject code set issue visualizing template brain; Fixed atlas list updated brain loaded; Fixed controller set value variable undefined; Voxel Label input remembered. 4d0f2a23 [dipterix]: Fixed name parsing surface file space keyword provided 01836188 [dipterix]: Added volume_to_surf generate 3D triangular mesh surfaces volume data 8a3a03e0 (origin/dragndrop, dragndrop) [dipterix]: Fixed Github action script system dependecies added aae29b28 [dipterix]: Color look-table can set arbitrary single color (HexString, indicating values rendered color; Drag & Drop volumes can change single colors c04d7783 [dipterix]: Remembers state switching volumes (datacube2) d7cab685 [dipterix]: Allowed prototype contact colors fixed; Prototype control points displays channel information (provided control points channels) Added color (randomColor, testColorString) file-name utility functions; Soft removed addColorCoat using ElectrodeMaterial, results massive code improvement electrode instance; Allow set default electrode colors contact rendered values fixed color; Fixed NamedLut color error value range zero; Prototype electrode click information displays channel number; Fixed RShinyDriver issue object construction parameters (using getThreeBrainInstance instead); 1ed4b5b4 [dipterix]: Scrolling side canvas faster now b4cd7dbf [dipterix]: Drag & drop file names sanitized avoid displaying issues; Electrode contacts (instancedMesh) now click-able; Dispose cleaner now, also fires events; Added makeClickable removeClickable replace previous add_clickable function; Renamed register_object registerToMap; Fixed UV mapping issue sphere electrode geometry; Better ways sanitize datacube; e0437d6c [dipterix]: Improved datacube overlay texture, including using clamp--border instead clamp--edge; Fixed shader issue transparency set negative (treated 1) 7a196ff4 [dipterix]: Ray-casting electrode prototypes instancedMesh now works contact-mode; Show electrode prototype contacts default 28f3af8d [dipterix]: Changed drag & drop default color mode; changing global opacity also affects Voxel Opacity volume settings; AbstractThreeBrainObject now inherits EventDispatcher (three) events can registered instances directly; Color changes datacube2 notify underlay datacube via event dispatcher; color keyword added, reversed version also registered; Fixed discrete volume treated continuous map overlaid 5f068018 [dipterix]: Added color modes uploaded images; using NIfTI headers get calculated color intensities applying heuristic approach; removed normalize method (replaced getNormalizedImage) NiftiImage MGHImage bb1e6150 [dipterix]: Using script generate change log automatically Git commits 1eea71c6 [dipterix]: Added news 6f3ceefe [dipterix]: bump version a9d0c8f6 [dipterix]: rename electrode prototypes: (type-company-version.json) bb3adf85 [dipterix]: minor fix 01ed4695 [dipterix]: Added campass side cameras slice mode canonical; dragndrop changes folders; removed UV sphere electrodes; added model-segmented electrodes shaft; fixed bug slice instance missing controller tries set overlay; voxel threshold async now; changed default controller; added broadcast() controllers; atlas number displayed users don’t need search lut; added global debug flag; js source map hidden browser won’t complain missing map; fa4fe3f6 [dipterix]: viewer can seen quarto/rmarkdown/knitr now e7cdff72 [dipterix]: added default prototypes 60f0dddd [dipterix]: added functions create seeg prototypes 2096eb4c [dipterix]: added electrode “”, allowing electrode rotate along direction 6a53d729 [dipterix]: dnd surface granted USER_ALL_SIDE_CAMERA_4; implemented slice overlay; splited render distance Frustum near far; added model2vox datacube datacube2; timeout workers; fixed sEEG-16 UV mapping 0c466378 [dipterix]: dynamic async workers; support dnd gii colormap; added snap--electrode mode; dnd surface infer space filename (BIDS); voxel matching subcortical surfaces; d64ae335 [dipterix]: added support electrode directions; prototypes loaded system default allow updating certain params a9275a43 [dipterix]: fixed prototype channel number set set list 3dc98c5e [dipterix]: added options enable/disable cache; used better file loader options use js workers 0ef6c1c3 [dipterix]: fixed UV issues prototype 2c1f30e4 [dipterix]: allow contact fixed (anchor); reduced number control points 2; removed flattern=FALSE prototypes; fixed prototype transform issue 4351cc4b [dipterix]: default surface colors ad4b4299 [dipterix]: Implemented drag N drop 7fe52479 [dipterix]: added remotes b53c0725 (origin/custom-electrode-geom, custom-electrode-geom) [dipterix]: using instancedMesh represent electrode contacts prototype used 4cacfd41 [dipterix]: Multi-representation electrode e3bb38c0 [dipterix]: added mapToTemplate back d5416c4e [dipterix]: early stop webgl2 unavailable 4b71dee7 [dipterix]: render webgl2 disabled fa11027f [dipterix]: Fixing win fe2cc379 [dipterix]: recompile 2313b0a5 [dipterix]: changed pial surface material depthwrite transparent cf2f1905 [dipterix]: fixed electrode values prototype used 88e10f8d [dipterix]: js fix a6d61c23 [dipterix]: Added support QRCode; using flags instead function hard update contact positions (may ready) f77c8ee0 [dipterix]: docs, always docs b498b613 [dipterix]: avoid auto-load geometries; added type string prototype; added set_matrix_world set transform object 6e91dba8 [dipterix]: added custom electrode shape support fe5f2c84 [dipterix]: added news; cran-comments; allowed plot_slices additive ca56af1b (origin/win-fix, win-fix) [dipterix]: fixing crash issue windows ba3f975b [dipterix]: removed shader cache surface shader (may cause window crash 8904130d [dipterix]: updated readme 48ea5ea6 [dipterix]: adjust implementation background color arcball radius; removed additional unsed params material call; added zindex base side canvas; added defaultColor electrodes; fixed localization electrodes color set correctly issues; completely removed composer effects 9785b05d [dipterix]: trackball uses longer side instead shorter side arc radius; mouse position canvas caluclated every mouse instead every resizing 85bffcbf [dipterix]: internalize col2hexstr 9a5d74ad [dipterix]: Added brainelectrodeselectrodesfix_electrode_color fix contacts color given clip names; added electrode visibility mode: use threshold show contacts pass threhsold values 467eac5d [dipterix]: robust controller.load 34727c80 [dipterix]: textsprite depth fix c4365bad [dipterix]: changed default controllers 78acc14a [dipterix]: upgraded threejs v160 significant light fix + removed outline pass (using clearcoat instead) 56f0e000 [dipterix]: atlas label also returns atlas IDs f0712167 [dipterix]: user name rave_slices fs folder, use display T1 slices b28a22f5 [dipterix]: auto adjust T1 brightness ploting slices 28767b24 [dipterix]: adjust title position 77a28c2f [dipterix]: Added plot_slices brain class 58c66337 [dipterix]: mesh clipping c6f90fee [dipterix]: Fixed download template subject URL query e4092702 [dipterix]: dev bump 10524a4c [dipterix]: Added default rave_slices case users want choose slices 3D viewer a4cac580 [dipterix]: Allow slices change gamma ff842861 [dipterix]: make voxel IJK starting 0 c139b53c [dipterix]: Fixed brain electrode mapping; added atlas guesser 16defcdb [dipterix]: Added space transform electrodes class; set controllers (setFromDictionary) uses try-catch clauses now 176e7746 [dipterix]: Partition datauri datauri size exceed 65529 21e12b51 [dipterix]: bump version a12128c4 [dipterix]: updated citation 06a99127 [dipterix]: truly standalone viewer a5746ca2 [dipterix]: animation uses new cmap af2d2c76 [dipterix]: added png dep bb773fcb [dipterix]: Added ACPC alignment, new tubegeom customized electrode types 1b37825a [dipterix]: allows additional geoms viewer brain$plot 75e77aec [dipterix]: using new mac command 14f53797 [dipterix]: plot_slices column-major 0d43840d [dipterix]: minor patch 3503ee49 [dipterix]: minor patch 19a0c0bc [dipterix]: line--sight view (js) plot_slices (R) d019c899 [dipterix]: bump version b121553a [dipterix]: Fixing CT matrix js s/qforms inconsistent (coregistration matrix sform original matrix qform) aea5c03f [dipterix]: improved way calc spacing offsets 8be639fa [dipterix]: Fixed bugs interpolation spacing 74a871e7 [dipterix]: specify spacing inter/extrapolation; removed old interpolation logic; added distanceRatio prevent large shift (auto adjust) 73685b8a [dipterix]: localization: Outlines 1da0aa4f [dipterix]: Update match yael paper 60b014c3 [dipterix]: fixing incorrect subcortical label 1c98fa37 [dipterix]: Disabled old format; as_subcortical_label generates correct wm labels a909a73f [dipterix]: let electrodes opaque main transparent side canvas 3591520e [dipterix]: added initialization condition 0d538d85 [dipterix]: Let subcortical surfaces display default 258a7cda [dipterix]: added get_ijk2ras get Norig (sform) Torig (tkr) 289153c2 [dipterix]: minor bug fix bump a48ca697 [dipterix]: using pial surface center trackball center 1c44190d [dipterix]: added support showing subcortical surfaces; fixed depth issues showing electrodes side viewers bb0fb968 [dipterix]: fixed freesurfer_lut bd75f4e8 [dipterix]: Dithering datacube2 make rendering “smooth”; added target arg pre_render pre_render also applies side canvas","code":""},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"directory-setup","dir":"Articles","previous_headings":"","what":"Directory Setup","title":"Getting Started","text":"basic setup typical subject folder look like : using FreeSurfer generate MRI reconstruction, set! AFNI/SUMA users, please place SUMA folder subject folder. don’t FreeSurfer folders, can download sample archive , choose N27-complete.zip, extract download directory. extracted, N27 subject folder ~/Downloads/ directory. directory tree looks exactly described . following context, use ~/Downloads/N27 example","code":"Project Directory └─Subject code ├─mri - Atlas, T1 and/or CT image files (*.mgz, transforms, ...) ├─surf - FreeSurfer surface files (pial, sulc, ...) ├─SUMA - (Optional) SUMA standard 141 surfaces (std.141.*) └─... - Other files"},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"generate-viewer-object","dir":"Articles","previous_headings":"","what":"Generate Viewer Object","title":"Getting Started","text":"first time, might take import generate cache files.","code":"library(threeBrain) subject_code <- \"N27\" subject_path <- \"~/Downloads/N27\" brain <- threeBrain(subject_path, subject_code) print(brain) #> Subject - N27 #> Transforms: #> #> - FreeSurfer TalXFM [from scanner to MNI305]: #> [,1] [,2] [,3] [,4] #> [1,] 0.9692 -0.0029 -0.0134 -0.1638 #> [2,] 0.0062 0.9685 0.0492 -2.0717 #> [3,] 0.0145 0.0276 0.9541 0.1361 #> [4,] 0.0000 0.0000 0.0000 1.0000 #> #> - Torig [Voxel CRS to FreeSurfer origin, vox2ras-tkr] #> [,1] [,2] [,3] [,4] #> [1,] -1 0 0 128 #> [2,] 0 0 1 -128 #> [3,] 0 -1 0 128 #> [4,] 0 0 0 1 #> #> - Norig [Voxel CRS to Scanner center, vox2ras] #> [,1] [,2] [,3] [,4] #> [1,] -1 0 0 128.5 #> [2,] 0 0 1 -145.5 #> [3,] 0 -1 0 146.5 #> [4,] 0 0 0 1.0 #> #> - Scanner center relative to FreeSurfer origin #> [1] -0.5 17.5 -18.5 #> #> - FreeSurfer RAS to MNI305, vox2vox-MNI305 #> [,1] [,2] [,3] [,4] #> [1,] 0.9692 -0.0029 -0.0134 0.12365 #> [2,] 0.0062 0.9685 0.0492 -18.10715 #> [3,] 0.0145 0.0276 0.9541 17.31120 #> [4,] 0.0000 0.0000 0.0000 1.00000 #> Surface information (total count 1) #> Loading required namespace: rstudioapi #> pial [ std.141 ] #> Volume information (total count 1) #> T1"},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"visualization","dir":"Articles","previous_headings":"","what":"Visualization","title":"Getting Started","text":"Visualizing viewer simply just one line.","code":"brain$plot()"},{"path":"https://dipterix.org/threeBrain/articles/A-getting-started.html","id":"surface-volume-atlas","dir":"Articles","previous_headings":"","what":"Surface, Volume, Atlas","title":"Getting Started","text":"default, viewers load following information. pial surfaces mandatory, files optional. mri/brain.finalsurfs.mgz mri/transforms/talairach.xfm surf/*h.pial SUMA/std.141.*h.pial[.asc|gii] surf/*h.sulc SUMA/std.141.*h.sulc.1D mri/aparc+aseg.mgz T1 image automatically detected brain.finalsurfs.mgz missing. following alternatives brainmask.mgz, brainmask.auto.mgz, T1.mgz. load one surfaces, please specify surface types loading viewer. available surface types : pial - (default) smoothwm, white - (smoothed) white matter inflated, sphere - inflated surfaces pial-outer-smoothed - (‘FreeSurfer’-) smoothed surface tightly wrapping pial surface inf_200 - (‘SUMA’-) inflated pial surface atlas type can selected aparc+aseg, aparc.a2009s+aseg, aparc.DKTatlas+aseg, aseg. load specific atlas, please make sure corresponding file exists mri/. example, mri/aseg.mgz. following example loads pial smoothwm, aseg atlas. viewer shows ‘Coronal’ plane, smoothed white matter, ‘Ventricle’, ‘Cerebellum’ together one scene.","code":"brain <- threeBrain( subject_path, subject_code, surface_types = c('pial', 'smoothwm'), atlas_types = 'aseg') brain$plot( controllers = list( \"Voxel Type\" = \"aseg\", \"Voxel Label\" = \"4,5,6,7\", \"Surface Type\" = \"smoothwm\", \"Left Opacity\" = 0.4, \"Overlay Coronal\" = TRUE ), control_display = FALSE, camera_pos = c(0, -500, 0) )"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"add-electrodes","dir":"Articles","previous_headings":"","what":"Add Electrodes","title":"Data Visualization (Electrodes)","text":"add electrodes brain object, need electrode table least 5 columns: Subject, Coord_x, Coord_y, Coord_z, Label. column names case-sensitive. performed electrode localization (see previous article) exported electrode table, exported table can used Electrode filled . demonstration purposes, electrode table used. Please download file place ~/Downloads/N27/electrodes.csv","code":"electrode_table <- `~/Downloads/N27/electrodes.csv` brain$set_electrodes(electrode_table) brain$plot()"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"add-electrode-values","dir":"Articles","previous_headings":"","what":"Add Electrode Values","title":"Data Visualization (Electrodes)","text":"iEEG study, various analyses can performed electrodes. analysis results different, including functional data mean-response time continuous data like p-values, z-scores categorical data cluster labels threeBrain can visualize two lines one data table. First, let’s take look start, generate table follows: column names case-sensitive, contain letters, digits _. Project: (optional) project name experiment belongs Subject: (mandatory) subject code; must consistent brain subject code Electrode: (mandatory) integers electrode channel number; correspond Electrode column electrode table Time (optional) numerical time seconds Value columns (sine_wave, p_value, z_score, cluster): values electrodes Download sample value table save ~/Downloads/N27/values.csv Open Data Visualization panel, change Display Data use keyboard shortcut d (make sure mouse hovering brain) switch desired variables. sine_wave time series. can see animation toggling Play/Pause option Data Visualization panel.","code":"electrode_table <- `~/Downloads/N27/electrodes.csv` value_table <- `~/Downloads/N27/values.csv` brain$set_electrodes(electrode_table) brain$set_electrode_values(value_table) brain$plot()"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"change-color-palette","dir":"Articles","previous_headings":"Add Electrode Values","what":"Change Color Palette","title":"Data Visualization (Electrodes)","text":"example , p-value legend shows range -0.5 0.5. threeBrain viewer’s default palette symmetric around zero, range decided maximum absolute number. However, actual p-value range 0 1, might particularly interested $p \\leq 0.05$. means color palette value range need corrected. following code, value_ranges named list value ranges. \"p_value\"=c(0,1) suggests p_value variable range 0 1. variables adopt default ranges. palettes named list color palettes. specific case, variable pal vector 64 colors. colorRampPalette base-R function interpolate colors. Please use help(\"colorRampPalette\") see documentation.","code":"pal <- c( colorRampPalette(c(\"red\", \"#FFC6C6\"))(8), colorRampPalette(c(\"#FFC6C6\", \"white\"))(56) ) brain$plot( value_ranges = list( \"p_value\" = c(0, 1) ), palettes = list( \"p_value\" = pal ) )"},{"path":"https://dipterix.org/threeBrain/articles/B-data-visualization.html","id":"map-electrode-values-to-the-surface","dir":"Articles","previous_headings":"","what":"Map Electrode Values to the Surface","title":"Data Visualization (Electrodes)","text":"threeBrain provides value mapping allows electrode values displayed surfaces. enable feature, open Surface Settings panel, click Surface Color, switch sync electrodes, simply use keyboard shortcut k (make sure mouse hovering brain) change. can also hide electrodes switching electrode Visibility hidden Electrodes panel show mapped results.","code":""},{"path":"https://dipterix.org/threeBrain/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Zhengjia Wang. Author, maintainer, copyright holder. John Magnotti. Contributor, researcher. Xiang Zhang. Contributor, researcher. Brian Metzger. Researcher. Elizabeth Nesbitt. Researcher. Meng Li. Thesis advisor. Michael Beauchamp. Thesis advisor, contributor, data contributor.","code":""},{"path":"https://dipterix.org/threeBrain/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wang, Z., Magnotti, J. F., Zhang, X., & Beauchamp, M. S. (2023). YAEL: Advanced Electrode Localizer. Eneuro, 10(10). Magnotti, J. F., Wang, Z., & Beauchamp, M. S. (2020). RAVE: Comprehensive open-source software reproducible analysis visualization intracranial EEG data. NeuroImage, 223, 117341.","code":"@Article{, title = {{YAEL}: Your Advanced Electrode Localizer}, author = {Zhengjia Wang and John F. Magnotti and Xiang Zhang and Michael S. Beauchamp}, journal = {Eneuro}, year = {2023}, volume = {10}, number = {10}, publisher = {Society for Neuroscience}, doi = {10.1523/ENEURO.0328-23.2023}, } @Article{, title = {{RAVE}: Comprehensive open-source software for reproducible analysis and visualization of intracranial EEG data}, author = {John F. Magnotti and Zhengjia Wang and Michael S. Beauchamp}, journal = {NeuroImage}, year = {2020}, volume = {223}, pages = {117341}, doi = {10.1016/j.neuroimage.2020.117341}, }"},{"path":"https://dipterix.org/threeBrain/index.html","id":"threebrain---html-webgl-based-3d-viewer","dir":"","previous_headings":"","what":"Your Advanced 3D Brain Visualization","title":"Your Advanced 3D Brain Visualization","text":"Key Features: Uses modern browsers, easy embed share Displays MRI, surfaces, electrodes canvas Maps multiple subjects template brains using AFNI/SUMA (standard 141) MNI-305 locations Electrode localization Volume rendering surface/electrode animation Integration interactive R-shiny framework News | reference page | keyboard shortcuts","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"system-requirement","dir":"","previous_headings":"","what":"System Requirement","title":"Your Advanced 3D Brain Visualization","text":"Web Browsers: viewer uses WegGL2 render browsers. Please check list see compatible browsers. 2023, Chrome, Firefox, Safari, Edge (IE) full supports.","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"a-installation","dir":"","previous_headings":"","what":"A. Installation","title":"Your Advanced 3D Brain Visualization","text":"R RStudio Desktop (Free Version) Open RStudio, enter console: want install dev version Github, use: (Optional) Setups: installation, RStudio console, type following command follow instructions.","code":"install.packages(\"threeBrain\", repos = \"https://rave-ieeg.r-universe.dev\") install.packages(\"remotes\") remotes::install_github(\"dipterix/threeBrain\") threeBrain::brain_setup()"},{"path":"https://dipterix.org/threeBrain/index.html","id":"b-basic-brain-viewer","dir":"","previous_headings":"","what":"B. Basic Brain Viewer","title":"Your Advanced 3D Brain Visualization","text":"finishing setting threeBrain, template subject N27 (Collin’s 27) created locally. location platform-related. can find running following command: N27 template folder resides inside directory. Let’s view subject using threeBrain function. Import subject Visualize","code":"library(threeBrain) default_template_directory() #> [1] \"/Users/dipterix/Library/Application Support/ #> org.R-project.R/R/threeBrain/templates\" library(threeBrain) n27_path <- file.path(default_template_directory(), \"N27\") x <- threeBrain( path = n27_path, subject_code = 'N27', surface_types = 'pial') plot(x) # alternatively, you can use x$plot()`"},{"path":"https://dipterix.org/threeBrain/index.html","id":"c-subject-setup","dir":"","previous_headings":"","what":"C. Subject Setup","title":"Your Advanced 3D Brain Visualization","text":"sample subject (N27) sample generated FreeSurfer (download). subjects processed FreeSurfer, use function threeBrain visualize.","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"d-addrender-electrodes","dir":"","previous_headings":"","what":"D. Add/Render Electrodes","title":"Your Advanced 3D Brain Visualization","text":"electrode file, can import calling plot function. Please make sure ’s csv format. example electrode csv file. first five columns (case-sensitive) mandatory: Electrode (integer), Coord_x, Coord_y, Coord_z, Label (character). Coord_* tkRAS location FreeSurfer coordinates. assign values electrodes, run electrode value file also csv like: Project Time optional. However, also using rave, please make sure Project exists. want show animation, Time necessary must numeric. ValueName? can characters containing letters (-Z, -z), letters (0-9) underscore (_).","code":"x$set_electrodes(electrodes = \"[PATH to ELECTRODE FILE]\") | Electrode| Coord_x| Coord_y| Coord_z|Label | MNI305_x| MNI305_y| MNI305_z|SurfaceElectrode |SurfaceType | Radius| VertexNumber|Hemisphere | |---------:|-------:|-------:|-------:|:------|--------:|---------:|---------:|:----------------|:-----------|------:|------------:|:----------| | 1| 29.0| -7.8| -34.6|RMHCH1 | 30.46817| -17.98119| -23.40022|FALSE |pial | 2| -1|left | | 2| 33.8| -8.0| -34.2|RMHCH2 | 35.57109| -17.76624| -22.80131|FALSE |pial | 2| -1|left | | 3| 38.0| -7.5| -33.5|RMHCH3 | 39.97102| -16.81249| -22.17986|FALSE |white | 2| -1|right | | 4| 42.6| -6.8| -33.0|RMHCH4 | 44.79092| -15.73442| -21.82591|FALSE |smoothwm | 2| -1|right | | 5| 47.0| -6.8| -32.6|RMHCH5 | 49.45370| -15.35431| -21.31272|FALSE |pial | 2| -1|right | | ... x$set_electrode_values(electrodes = \"[PATH to ELECTRODE VALUE FILE]\") | Electrode| Subject| Project| Time| ValueName| ValueName2| ...| |---------:|-------:|-------:|-------:|:---------|----------:|-----| | 1| N27| Demo| 0|A | 30.46817| ...| | 2| N27| Demo| 0|B | 35.57109| ...| | 3| N27| Demo| 0|C | 39.97102| ...| | 4| N27| Demo| 0|D | 44.79092| ...| | 5| N27| Demo| 0|A | 49.45370| ...| | ..."},{"path":"https://dipterix.org/threeBrain/index.html","id":"e-merge-subjects-and-template-mapping","dir":"","previous_headings":"","what":"E. Merge Subjects and Template mapping","title":"Your Advanced 3D Brain Visualization","text":"subjects FreeSurfer output, example, two subjects YAB YCQ. merge two subjects show N27 template, viewer N27 template, electrodes two subjects can mapped via MNI305 (surface stereo EEG) std.141 (surface-).","code":"library(threeBrain) # yab = ... (see section B for import a single subject) # ycq = ... template_n27 = merge_brain(yab, ycq, template_subject = 'N27') plot( template_n27 )"},{"path":"https://dipterix.org/threeBrain/index.html","id":"f-electrode-localization-yael","dir":"","previous_headings":"","what":"F. Electrode Localization (YAEL)","title":"Your Advanced 3D Brain Visualization","text":"YAEL (“Advanced Electrode Localizer) integrated RAVE (R Analysis Visualization iEEG). Please check website https://yael.wiki sfN poster","code":""},{"path":"https://dipterix.org/threeBrain/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Your Advanced 3D Brain Visualization","text":"cite threeBrain publications use: Wang, Z., Magnotti, J. F., Zhang, X., & Beauchamp, M. S. (2023). YAEL: Advanced Electrode Localizer. Eneuro, 10(10). Magnotti, J. F., Wang, Z., & Beauchamp, M. S. (2020). RAVE: Comprehensive open-source software reproducible analysis visualization intracranial EEG data. NeuroImage, 223, 117341. BibTeX entry LaTeX users:","code":"@Article{, title = {{YAEL}: Your Advanced Electrode Localizer}, author = {Zhengjia Wang and John F. Magnotti and Xiang Zhang and Michael S. Beauchamp}, journal = {Eneuro}, year = {2023}, volume = {10}, number = {10}, publisher = {Society for Neuroscience}, doi = {10.1523/ENEURO.0328-23.2023}, } @Article{, title = {{RAVE}: Comprehensive open-source software for reproducible analysis and visualization of intracranial EEG data}, author = {John F. Magnotti and Zhengjia Wang and Michael S. Beauchamp}, journal = {NeuroImage}, year = {2020}, volume = {223}, doi = {10.1016/j.neuroimage.2020.117341}, pages = {117341}, }"},{"path":"https://dipterix.org/threeBrain/index.html","id":"license","dir":"","previous_headings":"","what":"License","title":"Your Advanced 3D Brain Visualization","text":"front-end viewer (JavaScript) licensed MPL-2.0 free open-source license. Using generated viewers incorporating existing viewers whole work “-” permissive.","code":""},{"path":"https://dipterix.org/threeBrain/reference/AbstractGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Abstract Class of Geometries — AbstractGeom","title":"R6 Class - Abstract Class of Geometries — AbstractGeom","text":"R6 Class - Abstract Class Geometries","code":""},{"path":"https://dipterix.org/threeBrain/reference/AbstractGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Abstract Class of Geometries — AbstractGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/BlankGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"A geometry that renders nothing — BlankGeom","title":"A geometry that renders nothing — BlankGeom","text":"mainly used want upload group data ","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Data Cube Geometry — DataCubeGeom","title":"R6 Class - Generate Data Cube Geometry — DataCubeGeom","text":"R6 Class - Generate Data Cube Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Data Cube Geometry — DataCubeGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom2.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture — DataCubeGeom2","title":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture — DataCubeGeom2","text":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture","code":""},{"path":"https://dipterix.org/threeBrain/reference/DataCubeGeom2.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Data Cube Geometry via 3D Volume Texture — DataCubeGeom2","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/FreeGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Geometry from Vertices and Face Indices — FreeGeom","title":"R6 Class - Generate Geometry from Vertices and Face Indices — FreeGeom","text":"R6 Class - Generate Geometry Vertices Face Indices","code":""},{"path":"https://dipterix.org/threeBrain/reference/GeomGroup.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Group of Geometries — GeomGroup","title":"R6 Class - Generate Group of Geometries — GeomGroup","text":"R6 Class - Generate Group Geometries","code":""},{"path":"https://dipterix.org/threeBrain/reference/GeomGroup.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Group of Geometries — GeomGroup","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/LineSegmentsGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Line Segments — LineSegmentsGeom","title":"R6 Class - Generate Line Segments — LineSegmentsGeom","text":"R6 Class - Generate Line Segments","code":""},{"path":"https://dipterix.org/threeBrain/reference/LineSegmentsGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Line Segments — LineSegmentsGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/SphereGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Sphere Geometry — SphereGeom","title":"R6 Class - Generate Sphere Geometry — SphereGeom","text":"R6 Class - Generate Sphere Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/SphereGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Sphere Geometry — SphereGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/SpriteGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Sphere Geometry — SpriteGeom","title":"R6 Class - Generate Sphere Geometry — SpriteGeom","text":"R6 Class - Generate Sphere Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/SpriteGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Sphere Geometry — SpriteGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/TubeGeom.html","id":null,"dir":"Reference","previous_headings":"","what":"R6 Class - Generate Tube Geometry — TubeGeom","title":"R6 Class - Generate Tube Geometry — TubeGeom","text":"R6 Class - Generate Tube Geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/TubeGeom.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"R6 Class - Generate Tube Geometry — TubeGeom","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":null,"dir":"Reference","previous_headings":"","what":"Shiny Proxy for Viewer — brain_proxy","title":"Shiny Proxy for Viewer — brain_proxy","text":"Shiny Proxy Viewer","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Shiny Proxy for Viewer — brain_proxy","text":"","code":"brain_proxy(outputId, session = shiny::getDefaultReactiveDomain())"},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shiny Proxy for Viewer — brain_proxy","text":"outputId shiny output ID session shiny session, default current session (see domains)","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_proxy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Shiny Proxy for Viewer — brain_proxy","text":"R6 class ViewerProxy","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":null,"dir":"Reference","previous_headings":"","what":"Setup Package, Install Environment — brain_setup","title":"Setup Package, Install Environment — brain_setup","text":"Setup Package, Install Environment","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Setup Package, Install Environment — brain_setup","text":"","code":"brain_setup(continued = FALSE, show_example = TRUE, ...)"},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Setup Package, Install Environment — brain_setup","text":"continued logical, two phases setting environment. probably need restart R session first phase continue setting . show_example whether show example `N27` subject end. ... ignored","code":""},{"path":"https://dipterix.org/threeBrain/reference/brain_setup.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Setup Package, Install Environment — brain_setup","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate rotation matrix from non-zero vectors — calculate_rotation","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"Calculate rotation matrix non-zero vectors","code":""},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"","code":"calculate_rotation(vec_from, vec_to)"},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"vec_from original vector, length 3 vec_to vector rotation, length 3","code":""},{"path":"https://dipterix.org/threeBrain/reference/calculate_rotation.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate rotation matrix from non-zero vectors — calculate_rotation","text":"four--four transform matrix","code":""},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"Function check whether `FreeSurfer` folder everything need","code":""},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"","code":"check_freesurfer_path( fs_subject_folder, autoinstall_template = FALSE, return_path = FALSE, check_volume = FALSE, check_surface = FALSE )"},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"fs_subject_folder character, path `fs` project directory `RAVE` subject directory autoinstall_template logical, whether `N27` brain installed missing return_path logical, whether return `FreeSurfer` path check_volume logical, whether check volume data check_surface logical, whether check surface data (implemented yet)","code":""},{"path":"https://dipterix.org/threeBrain/reference/check_freesurfer_path.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to check whether `FreeSurfer` folder has everything we need — check_freesurfer_path","text":"logical whether directory valid , return_path true, return `FreeSurfer` path","code":""},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Conform imaging data in 'FreeSurfer' way — conform_volume","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"Reproduces conform algorithm used 'FreeSurfer' conform 'NIfTI' 'MGH' images.","code":""},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"","code":"conform_volume(x, save_to, dim = c(256, 256, 256))"},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"x path image file save_to path conformed image saved, must ends '.mgz' dim positive integers length three, conformed dimension; default 'FreeSurfer' conform images 1mm volume cube 256x256x256 dimension","code":""},{"path":"https://dipterix.org/threeBrain/reference/conform_volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Conform imaging data in 'FreeSurfer' way — conform_volume","text":"Nothing; result save save_to","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a geometry group containing multiple geometries — create_group","title":"Create a geometry group containing multiple geometries — create_group","text":"Create geometry group containing multiple geometries","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a geometry group containing multiple geometries — create_group","text":"","code":"create_group(name, position = c(0, 0, 0), layer = 1)"},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a geometry group containing multiple geometries — create_group","text":"name string, name geometry position x,y,z location group layer layer group. reserved","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create a geometry group containing multiple geometries — create_group","text":"GeomGroup instance","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Create a geometry group containing multiple geometries — create_group","text":"geometry group container multiple geometries. geometries within group share shift rotations (see example 1). ECoG/iEEG world, might 'MRI', 'CT', 'FreeSurfer' different orientations. example, want align MRI FreeSurfer, Instead calculating position geometries, can just put MRI components group, set transform group, making group aligned FreeSurfer. GeomGroup also can used store large data. generate 3D viewer, `threeBrain` needs dynamically serialize data JSON format, can read browsers. However, FreeSurfer brain might ~30 MB. large size might take ~5 seconds serialize. solve problem, GeomGroup supports cache `set_group_data` method. method supports caching static serialized data JSON file, allows files loaded static data objects. \"static\", mean data supposed dynamic, \"read-\". JavaScript code, also optimized need load large datasets repeatedly. allows load multiple subjects' brain short time.","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a geometry group containing multiple geometries — create_group","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/create_group.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a geometry group containing multiple geometries — create_group","text":"","code":"# Example 1: relative position # create group g = create_group('Group A') # create two spheres at 10,0,0, but s2 is relative to group A s1 = geom_sphere('Sphere 1', radius = 2, position = c(10,0,0)) s2 = geom_sphere('Sphere 2', radius = 2, position = c(10,0,0), group = g) # set transform (rotation) g$set_transform(matrix(c( 0,1,0,0, 1,0,0,0, 0,0,1,0, 0,0,0,1 ), byrow = TRUE, ncol = 4)) # global position for s2 is 0,10,0 if( interactive() ) { threejs_brain(s1, s2) } # Example 2: cache if (FALSE) { # \\dontrun{ # download N27 brain # Make sure you have N27 brain downloaded to `default_template_directory()` # download_N27() template_dir <- default_template_directory() dat = freesurferformats::read.fs.surface( file.path(template_dir, 'N27/surf/lh.pial') ) vertex = dat$vertices[,1:3] face = dat$faces[,1:3] # 1. dynamically serialize mesh = geom_freemesh('lh', vertex = vertex, face = face, layer = 1) # 2. cache # Create group, all geometries in this group are relatively positioned tmp_file = tempfile() mesh = geom_freemesh('Left Hemisphere cached', vertex = vertex, face = face, cache_file = tmp_file) } # }"},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate cross-product of two vectors in '3D' — cross_prod","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"Calculate cross-product two vectors '3D'","code":""},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"","code":"cross_prod(x, y)"},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"x, y 3-dimensional vectors","code":""},{"path":"https://dipterix.org/threeBrain/reference/cross_prod.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate cross-product of two vectors in '3D' — cross_prod","text":"'3D' vector cross-product x y","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":null,"dir":"Reference","previous_headings":"","what":"Default Directory to Store Template Brain — default_template_directory","title":"Default Directory to Store Template Brain — default_template_directory","text":"Default Directory Store Template Brain","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Default Directory to Store Template Brain — default_template_directory","text":"","code":"default_template_directory(check = FALSE)"},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Default Directory to Store Template Brain — default_template_directory","text":"check logical, check folder missing, , create one. option ensures folder always created.","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Default Directory to Store Template Brain — default_template_directory","text":"directory path template brain stored ; see also download_N27","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Default Directory to Store Template Brain — default_template_directory","text":"threeBrain.template_dir set invalid, function checks 'RAVE' (R Analysis Visualization 'iEEG', https://openwetware.org/wiki/RAVE) folder home directory. folder missing, returns results R_user_dir('threeBrain', 'data'). override default behavior, use options(threeBrain.template_dir=...).","code":""},{"path":"https://dipterix.org/threeBrain/reference/default_template_directory.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Default Directory to Store Template Brain — default_template_directory","text":"","code":"default_template_directory() #> [1] \"/home/runner/.local/share/R/threeBrain/templates\""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` surface and volume files — freesurfer_brain","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"Read `FreeSurfer` surface volume files","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"","code":"freesurfer_brain( fs_subject_folder, subject_name, additional_surfaces = NULL, aligned_ct = NULL, use_cache = TRUE, use_141 = getOption(\"threeBrain.use141\", TRUE) ) freesurfer_brain2( fs_subject_folder, subject_name, volume_types = \"t1\", surface_types = \"pial\", curvature = \"sulc\", atlas_types = c(\"aparc+aseg\", \"aparc.a2009s+aseg\", \"aparc.DKTatlas+aseg\"), ct_path = NULL, use_cache = TRUE, use_141 = getOption(\"threeBrain.use141\", TRUE), ... )"},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"fs_subject_folder character, `FreeSurfer` subject folder, `RAVE` subject folder subject_name character, subject code display letters digits additional_surfaces character array, additional surface types load, `white`, `smoothwm` aligned_ct character, path `ct_aligned_mri.nii.gz`, used electrode localization use_cache logical, whether use cached `json` files raw `FreeSurfer` files use_141 logical, whether use standard 141 brain surface file, default getOption('threeBrain.use141', TRUE) volume_types volume types, right now support T1 image surface_types surface types load curvature curvature data. support \"sulc\" current version atlas_types atlas types loaded, choices 'aparc+aseg', 'aparc.a2009s+aseg', 'aparc.DKTatlas+aseg', 'aseg' ct_path aligned CT file 'Nifti' format ... ignored","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"function FreeSurfer license. 1. Volumes: 3D viewer uses `mri/T1.mgz` `FreeSurfer` show volume information. `T1.mgz` results step 1 5 `FreeSurfer` command `recon--autorecon1`, aligns original `DICOM` image `RAS` coordinate system, resamples volume 256x256x256 voxels (tri-linear default, check https://surfer.nmr.mgh.harvard.edu/fswiki/recon-information). 2. Surface: two options surface files. first choice using `std.141` brain generated `AFNI/SUMA`. surface file re-calculates vertices standard 141 space, averages \"surface\" 141 subjects. want map surface electrodes across different subjects, might want consider case especially designed surface mapping. However, need `AFNI/SUMA` installed generate surface file. details can found via https://openwetware.org/wiki/Beauchamp:CorticalSurfaceHCP, `AFNI/SUMA` command related `SurfToSurf`. Please generate files `[FREESURFER SUBJECT DIR]/SUMA/`. file name follows convention `std.141.[lr]h.[SURFACE TYPE].[POSTFIX]`, `lh` means left hemisphere `rh` means right hemisphere; `SURFACE TYPE` can `pial`, `white`, `smoothwm`, `POSTFIX` can `asc`, `gii`. multiple files surface type exists, search order `asc > gii`. option use mesh files directly `FreeSurfer` output located `[FREESURFER SUBJECT DIR]/surf`. want use surface, make sure converted `asc` `gii` format. 3. Electrode registration transforms package provides two ways map electrodes standard space. surface electrodes, standard 141 brain provided, first option snap electrodes nearest vertices subject space. key vertex number matches across different subjects, hence location corresponding vertices template brain mapped electrode coordinates. standard 141 brain missing, electrode type `stereo EEG`, second option volume mapping. idea map electrodes `MNI305` brain. details can found https://surfer.nmr.mgh.harvard.edu/fswiki/CoordinateSystems. perform volume mapping, need `FreeSurfer` folder `mri/transforms`. Currently, linear `Talairach` transform matrix supported (located `talairach.xfm`). 4. Coordinates 3D viewer package uses center volume origin (0, 0, 0).","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_brain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read `FreeSurfer` surface and volume files — freesurfer_brain","text":"","code":"if (FALSE) { # \\dontrun{ # Please run `download_N27()` if `N27` is not at `default_template_directory()` # Import from `FreeSurfer` subject folder brain = threeBrain::freesurfer_brain( fs_subject_folder = file.path(default_template_directory(), 'N27'), subject_name = 'N27', additional_surfaces = c('white', 'smoothwm') ) # Visualize. Alternatively, you can use brain$plot(...) plot( brain ) } # }"},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":null,"dir":"Reference","previous_headings":"","what":"Query the 'FreeSurfer' labels — freesurfer_lut","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"Query 'FreeSurfer' labels","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"","code":"freesurfer_lut"},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"object class list length 3.","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"'FreeSurfer' atlases use https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI/FreeSurferColorLUT look-table query indexes. 'threeBrain' electrode localization also uses table export 'FSLabel' electrode. volume type set 'aparc_aseg', please also use table filter.","code":""},{"path":"https://dipterix.org/threeBrain/reference/freesurfer_lut.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Query the 'FreeSurfer' labels — freesurfer_lut","text":"","code":"freesurfer_lut$from_key(0:10) #> 0 1 #> \"Unknown\" \"Left-Cerebral-Exterior\" #> 2 3 #> \"Left-Cerebral-White-Matter\" \"Left-Cerebral-Cortex\" #> 4 5 #> \"Left-Lateral-Ventricle\" \"Left-Inf-Lat-Vent\" #> 6 7 #> \"Left-Cerebellum-Exterior\" \"Left-Cerebellum-White-Matter\" #> 8 9 #> \"Left-Cerebellum-Cortex\" \"Left-Thalamus\" #> 10 #> \"Left-Thalamus-Proper*\" freesurfer_lut$get_key(\"ctx-lh-supramarginal\") #> ctx-lh-supramarginal #> 1031"},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate smooth envelope around surface — generate_smooth_envelope","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"Alternative 'Matlab' version 'pial-outer-smoothed', use function along fill_surface.","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"","code":"generate_smooth_envelope( surface_path, save_as = NULL, inflate = 3, verbose = TRUE, save_format = c(\"auto\", \"bin\", \"asc\", \"vtk\", \"ply\", \"off\", \"obj\", \"gii\", \"mz3\", \"byu\") )"},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"surface_path path '*h.pial' surface 'FreeSurfer' folder, 3-dimensional mesh, see read.fs.surface save_as save final envelope path, NULL dry-run inflate number 'voxels' inflate fitting envelope; must non-negative integer verbose whether verbose progress; default true save_format format saved file save_as NULL; see format argument function write.fs.surface","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"3-dimensional mesh contains vertices face indices, result also saved save_as specified.","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_smooth_envelope.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate smooth envelope around surface — generate_smooth_envelope","text":"","code":"if(interactive() && file.exists(file.path(default_template_directory(), \"N27\"))) { library(threeBrain) fs_path <- file.path(default_template_directory(), \"N27\") # lh.pial-outer-smoothed lh_pial <- file.path(fs_path, \"surf\", \"lh.pial\") save_as <- file.path(fs_path, \"surf\", \"lh.pial-outer-smoothed\") generate_smooth_envelope(lh_pial, save_as) # rh.pial-outer-smoothed rh_pial <- file.path(fs_path, \"surf\", \"rh.pial\") save_as <- file.path(fs_path, \"surf\", \"rh.pial-outer-smoothed\") generate_smooth_envelope(rh_pial, save_as) brain <- threeBrain( path = fs_path, subject_code = \"N27\", surface_types = 'pial-outer-smoothed' ) brain$plot(controllers = list( \"Surface Type\" = 'pial-outer-smoothed' )) }"},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":null,"dir":"Reference","previous_headings":"","what":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"Superseded volume_to_surf. Please use function.","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"","code":"generate_subcortical_surface( atlas, index, save_prefix = NULL, label = NULL, IJK2RAS = NULL, grow = 1, remesh = TRUE, smooth = TRUE, smooth_delta = 3, ... )"},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"atlas path imaging 'parcellation', can 'nii' 'mgz' formats index 'parcellation' index, see 'FreeSurfer' look-table save_prefix parent folder save resulting surface label character label name 'sub-cortical' structure, usually automatically derived index IJK2RAS 'Affine' matrix 'voxel' index 'tkrRAS', usually automatically derived atlas grow amount grow (dilate) generating mesh remesh, smooth, smooth_delta, ... passed mesh_from_volume","code":""},{"path":"https://dipterix.org/threeBrain/reference/generate_subcortical_surface.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Approximate 'sub-cortical' surfaces from 'parcellation' — generate_subcortical_surface","text":"surface mesh, containing 'atlas' index, label, surface nodes face indices.","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates any mesh geometry given vertices and face indices — geom_freemesh","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"Creates mesh geometry given vertices face indices","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"","code":"geom_freemesh( name, vertex = NULL, face = NULL, position = c(0, 0, 0), layer = 1, cache_file = NULL, group = NULL )"},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"name unique string scene tell apart different objects vertex position vertices (3 columns) face face indices indicating 3 vertices linked (3 columns) position x,y,z location geometry layer visibility geometry, used multiple cameras 1 visible cameras cache_file cache vertex face data group group GeomGroup object, null, group generated automatically","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"generating free mesh internally, group must specified, therefore group NULL , group generated. However, always recommended pass group free mesh.","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_freemesh.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates any mesh geometry given vertices and face indices — geom_freemesh","text":"","code":"if (FALSE) { # \\dontrun{ # Make sure you have N27 brain downloaded to `default_template_directory()` # threeBrain::download_N27() n27_dir = file.path(default_template_directory(), \"N27\") surf_type = 'pial' # Locate mesh files lh = read_fs_asc(file.path(n27_dir, sprintf('surf/lh.%s.asc', surf_type))) rh = read_fs_asc(file.path(n27_dir, sprintf('surf/rh.%s.asc', surf_type))) # Create groups group = create_group(name = sprintf('Surface - %s (N27)', surf_type)) # create mesh lh_mesh = geom_freemesh( name = sprintf('FreeSurfer Left Hemisphere - %s (N27)', surf_type), vertex = lh$vertices[,1:3], face = lh$faces[,1:3], group = group ) rh_mesh = geom_freemesh( name = sprintf('FreeSurfer Right Hemisphere - %s (N27)', surf_type), vertex = rh$vertices[,1:3], face = rh$faces[,1:3], group = group ) # Render if( interactive() ) { threejs_brain(lh_mesh, rh_mesh) } } # }"},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":null,"dir":"Reference","previous_headings":"","what":"Create sphere geometry — geom_sphere","title":"Create sphere geometry — geom_sphere","text":"Create sphere geometry","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create sphere geometry — geom_sphere","text":"","code":"geom_sphere( name, radius, position = c(0, 0, 0), layer = 1, group = NULL, value = NULL, time_stamp = NULL )"},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create sphere geometry — geom_sphere","text":"name unique string scene tell apart different objects radius size sphere position x,y,z location sphere layer visibility geometry, used multiple cameras 1 visible cameras group GeomGroup object value, time_stamp color sphere, used animation/color rendering","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create sphere geometry — geom_sphere","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/geom_sphere.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create sphere geometry — geom_sphere","text":"","code":"# Create a sphere with animation g = lapply(1:10, function(ii){ v = rep(ii, 10) v[1:ii] = 1:ii geom_sphere(paste0('s', ii), ii, value = v, position = c(11 * ii, 0,0), time_stamp = (1:10)/10) }) if( interactive() ) { threejs_brain(.list = g) }"},{"path":"https://dipterix.org/threeBrain/reference/get_digest_header.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to read digest header — get_digest_header","title":"Function to read digest header — get_digest_header","text":"Function read digest header","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_digest_header.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to read digest header — get_digest_header","text":"","code":"get_digest_header(file, key, if_error = NULL, .list = NULL)"},{"path":"https://dipterix.org/threeBrain/reference/get_digest_header.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to read digest header — get_digest_header","text":"file file path `JSON` file key character, key extract if_error value return key found read error occurs .list alternative list supply file missing","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":null,"dir":"Reference","previous_headings":"","what":"Get 'voxel' to world matrix — get_ijk2ras","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"Get 'voxel' world matrix","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"","code":"get_ijk2ras(x, type = c(\"scanner\", \"tkr\"))"},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"x path imaging files type world space type; choices 'scanner' ('sform' 'qform' ) 'NIfTI' file headers; 'tkr' (used shared surface nodes)","code":""},{"path":"https://dipterix.org/threeBrain/reference/get_ijk2ras.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get 'voxel' to world matrix — get_ijk2ras","text":"four four matrix","code":""},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":null,"dir":"Reference","previous_headings":"","what":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"Import 'T1-MRI', surface files, curvature/'sulcus', atlas, 'Talairach' transform matrix 'json' format. functions intended called directly, use import_from_freesurfer instead.","code":""},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"","code":"import_fs( subject_name, fs_path, quiet = FALSE, dtype = c(\"T1\", \"surface\", \"curv\", \"atlas_volume\", \"atlas_surface\", \"xform\"), sub_type = NULL, hemisphere = c(\"l\", \"r\"), ... ) import_suma( subject_name, fs_path, quiet = FALSE, dtype = c(\"T1\", \"surface\", \"curv\", \"atlas_volume\", \"atlas_surface\", \"xform\"), sub_type = NULL, hemisphere = c(\"l\", \"r\"), ... )"},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"subject_name character, subject code fs_path path 'FreeSurfer' folder quiet, ... passed methods. dtype data type import, choices 'T1', 'surface', 'curv', 'atlas_volume', 'atlas_surface', 'xform' sub_type detailed files import. 'atlas_surface' supported now hemisphere hemisphere import, ignored dtype 'T1', 'atlas_volume', 'atlas_surface', 'xform'.","code":""},{"path":"https://dipterix.org/threeBrain/reference/import-fs-suma.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import 'FreeSurfer' or 'SUMA' files into the viewer structure — import-fs-suma","text":"logical, TRUE file cached, FALSE file missing.","code":""},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":null,"dir":"Reference","previous_headings":"","what":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"Import `FreeSurfer` create `JSON` cache 3D viewer","code":""},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"","code":"import_from_freesurfer(fs_path, subject_name, quiet = FALSE)"},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"fs_path `FreeSurfer` subject directory subject_name subject code quiet whether suppress message ","code":""},{"path":"https://dipterix.org/threeBrain/reference/import_from_freesurfer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Import from `FreeSurfer` and create `JSON` cache for 3D viewer — import_from_freesurfer","text":"None.","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":null,"dir":"Reference","previous_headings":"","what":"List or load all electrode prototypes — list_electrode_prototypes","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"List built-user-customized electrode prototypes. User paths searched first, multiple prototype configuration files found type.","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"","code":"list_electrode_prototypes() load_prototype(type)"},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"type electrode type, character","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"list_electrode_prototypes returns named list, names prototype types values prototype configuration paths; load_prototype returns prototype instance type exists, throw error.","code":""},{"path":"https://dipterix.org/threeBrain/reference/list_electrode_prototypes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"List or load all electrode prototypes — list_electrode_prototypes","text":"","code":"availables <- list_electrode_prototypes() if( \"sEEG-16\" %in% names(availables) ) { proto <- load_prototype( \"sEEG-16\" ) print(proto, details = FALSE) }"},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":null,"dir":"Reference","previous_headings":"","what":"Launch a 'shiny' application to localize electrodes — localization_module","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"'RAVE' installed, please use 'RAVE' modules. function purely demonstration purposes.","code":""},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"","code":"localization_module( subject_code, fs_path, ct_path = NULL, surfaces = \"pial\", use_141 = TRUE, shiny_options = list(launch.browser = TRUE), save_path = tempfile(pattern = \"electrode\", fileext = \".csv\"), ..., control_presets = NULL, side_display = FALSE, controllers = list() )"},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"subject_code subject code fs_path subject's 'FreeSurfer' path ct_path file path 'CT' scans already aligned 'T1'; must 'NIFTI' format surfaces surfaces load use_141 whether try 'SUMA' standard 141 surface; default true shiny_options shiny application options; see options shinyApp save_path temporary file electrode table cached; file used keep track changes case application crashed shutdown ... parameters pass freesurfer_brain2 control_presets, side_display, controllers passed threejs_brain","code":""},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"list 'ui' elements, 'server' function, stand-alone 'app'","code":""},{"path":"https://dipterix.org/threeBrain/reference/localization_module.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Launch a 'shiny' application to localize electrodes — localization_module","text":"","code":"# This example require N27 template brain to be installed # see `?download_N27` for details # using N27 to localize fs_path <- file.path(default_template_directory(), \"N27\") if(interactive() && dir.exists(fs_path)){ module <- localization_module(\"N27\", fs_path) print(module$app) }"},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Multi-subject Template — merge_brain","title":"Create Multi-subject Template — merge_brain","text":"Create Multi-subject Template","code":""},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Multi-subject Template — merge_brain","text":"","code":"merge_brain( ..., .list = NULL, template_surface_types = NULL, template_subject = unname(getOption(\"threeBrain.template_subject\", \"N27\")), template_dir = default_template_directory() )"},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Multi-subject Template — merge_brain","text":"..., .list Brain2 objects template_surface_types template surface types load, default auto-guess template_subject character, subject code treated template, default `N27` template_dir parent directory template subject stored ","code":""},{"path":"https://dipterix.org/threeBrain/reference/merge_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create Multi-subject Template — merge_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":null,"dir":"Reference","previous_headings":"","what":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"Create load new electrode prototype existing configurations","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"","code":"new_electrode_prototype(base_prototype, modifier = NULL)"},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"base_prototype base prototype, can string prototype type (see list_electrode_prototypes), path prototype configuration file, configuration 'json' format, electrode prototype instance modifier internally used","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"electrode prototype instance","code":""},{"path":"https://dipterix.org/threeBrain/reference/new_electrode_prototype.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create or load new electrode prototype from existing configurations — new_electrode_prototype","text":"","code":"available_prototypes <- list_electrode_prototypes() if(\"Precision33x31\" %in% names(available_prototypes)) { # Load by type name new_electrode_prototype(\"Precision33x31\") # load by path path <- available_prototypes[[\"Precision33x31\"]] new_electrode_prototype(path) # load by json string json <- readLines(path) new_electrode_prototype(json) }"},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot slices of volume — plot_slices","title":"Plot slices of volume — plot_slices","text":"Plot slices volume","code":""},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot slices of volume — plot_slices","text":"","code":"plot_slices( volume, overlays = NULL, transform = NULL, positions = NULL, zoom = 1, pixel_width = 0.5, col = c(\"black\", \"white\"), normalize = NULL, zclip = NULL, overlay_alpha = 0.3, zlim = normalize, main = \"\", title_position = c(\"left\", \"top\"), fun = NULL, nc = NA, which = NULL, ... )"},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot slices of volume — plot_slices","text":"volume path volume (underlay) overlays images overlay top underlay, can either vector paths overlay volume images, sequence named lists. list item 'volume' (path volume) 'color' (color overlay) transform rotation volume scanner 'RAS' space positions vector length 3 matrix 3 columns, 'RAS' position cross-hairs zoom zoom-radio, default 1 pixel_width output image pixel resolution; default 0.5, one pixel 0.5 millimeters wide col color palette, can sequence colors normalize range volume data normalized; either NULL (normalize) numeric vector length two zclip clip image densities; specified, values outside range clipped range overlay_alpha transparency overlay; default 0.3 zlim image plot value range, default identical normalize main image titles title_position title position; choices \"left\" \"top\" fun function two arguments executed image drawn; can used draw cross-hairs annotate image nc number \"columns\" plot many positions, must positive integer; default NA (automatically determined) plane plot; default NULL, trigger new plots add titles; set 1 'Axial' plane, 2 'Sagittal', 3 'Coronal'. ... additional arguments passing image","code":""},{"path":"https://dipterix.org/threeBrain/reference/plot_slices.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Plot slices of volume — plot_slices","text":"Nothing","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` ascii file — read_fs_asc","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"Read `FreeSurfer` ascii file","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"","code":"read_fs_asc(file)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"file file location","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_asc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read `FreeSurfer` ascii file — read_fs_asc","text":"list vertices face indices","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_labels.html","id":null,"dir":"Reference","previous_headings":"","what":"Read FreeSurfer Annotations — read_fs_labels","title":"Read FreeSurfer Annotations — read_fs_labels","text":"Read FreeSurfer Annotations","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_labels.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read FreeSurfer Annotations — read_fs_labels","text":"","code":"read_fs_labels(path, vertex_number)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_labels.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read FreeSurfer Annotations — read_fs_labels","text":"path label path vertex_number force reset vertex number raw file incorrect","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` m3z file — read_fs_m3z","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"Read `FreeSurfer` m3z file","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"","code":"read_fs_m3z(filename)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"filename file location, usually located `mri/transforms/talairach.m3z`","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"registration data","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_m3z.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Read `FreeSurfer` m3z file — read_fs_m3z","text":"`m3z` file `gzip` binary file containing dense vector field describes 3D registration two volumes/images. implementation follows `Matlab` implementation `FreeSurfer`. function released `FreeSurfer` license: https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferSoftwareLicense.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":null,"dir":"Reference","previous_headings":"","what":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"Read `FreeSurfer` `mgz/mgh` file","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"","code":"read_fs_mgh_mgz(filename)"},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"filename file location","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_fs_mgh_mgz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read `FreeSurfer` `mgz/mgh` file — read_fs_mgh_mgz","text":"list contains coordinate transforms volume data","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to load surface data from `Gifti` files — read_gii2","title":"Function to load surface data from `Gifti` files — read_gii2","text":"function `read_gii2` dynamic wrapper Python `nibabel` loader. Python detected, switch `gifti::readgii`.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to load surface data from `Gifti` files — read_gii2","text":"","code":"read_gii2(path)"},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Function to load surface data from `Gifti` files — read_gii2","text":"R function acting safe wrapper nibabel.load.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_gii2.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to load surface data from `Gifti` files — read_gii2","text":"path `Gifti` file path","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"function `read_mgz` dynamic wrapper Python `nibabel` loader. Python detected, switch built-function `read_fs_mgh_mgz`, limited features.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"","code":"read_mgz(path)"},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"R function acting safe wrapper nibabel.load.","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_mgz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to load `FreeSurfer` `mgz/mgh` file — read_mgz","text":"path `mgz/mgh` file path","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"Read volume file 'MGH' 'Nifti' formats","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"","code":"read_volume(file, format = c(\"auto\", \"mgh\", \"nii\"), header_only = FALSE)"},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"file file path format file format header_only whether read headers; default false","code":""},{"path":"https://dipterix.org/threeBrain/reference/read_volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read volume file in 'MGH' or 'Nifti' formats — read_volume","text":"list volume data transform matrices; header_only=TRUE, volume data substituted header.","code":""},{"path":"https://dipterix.org/threeBrain/reference/reexports.html","id":null,"dir":"Reference","previous_headings":"","what":"Objects exported from other packages — reexports","title":"Objects exported from other packages — reexports","text":"objects imported packages. Follow links see documentation. freesurferformats read.fs.annot, read.fs.curv, read.fs.label, read.fs.mgh, read.fs.morph, read.fs.surface, read.fs.transform, read.fs.volume, read.fs.weight, read.nifti1.data, read.nifti1.header, read.nifti2.data, read.nifti2.header, write.fs.surface, write.nifti1, write.nifti2","code":""},{"path":"https://dipterix.org/threeBrain/reference/renderBrain.html","id":null,"dir":"Reference","previous_headings":"","what":"Shiny Renderer for threeBrain Widgets — renderBrain","title":"Shiny Renderer for threeBrain Widgets — renderBrain","text":"Shiny Renderer threeBrain Widgets","code":""},{"path":"https://dipterix.org/threeBrain/reference/renderBrain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shiny Renderer for threeBrain Widgets — renderBrain","text":"expr R expression calls three_brain function Brain object env environment expression evaluated quoted expr quoted? Default false.","code":""},{"path":"https://dipterix.org/threeBrain/reference/renderBrain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Shiny Renderer for threeBrain Widgets — renderBrain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Function to reshape data to `RAS` order — reorient_volume","title":"Function to reshape data to `RAS` order — reorient_volume","text":"Function reshape data `RAS` order","code":""},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Function to reshape data to `RAS` order — reorient_volume","text":"","code":"reorient_volume(volume, Torig)"},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Function to reshape data to `RAS` order — reorient_volume","text":"volume, 3-mode tensor (voxels), usually `mgz`, `nii`, `BRIK` files Torig 4x4 transform matrix mapping volume (`CRS`) `RAS`","code":""},{"path":"https://dipterix.org/threeBrain/reference/reorient_volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Function to reshape data to `RAS` order — reorient_volume","text":"Reshaped tensor dimensions corresponding `R`, ``, `S`","code":""},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Save threeBrain widgets to local file system — save_brain","title":"Save threeBrain widgets to local file system — save_brain","text":"Save threeBrain widgets local file system","code":""},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save threeBrain widgets to local file system — save_brain","text":"","code":"save_brain(widget, path, title = \"3D Viewer\", as_zip = FALSE, ...)"},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save threeBrain widgets to local file system — save_brain","text":"widget generated function 'threejs_brain' path path save brain widget title widget title. as_zip whether create zip file \"compressed.zip\". ... ignored, used backward compatibility","code":""},{"path":"https://dipterix.org/threeBrain/reference/save_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Save threeBrain widgets to local file system — save_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":null,"dir":"Reference","previous_headings":"","what":"Create 'sEEG' shaft geometry prototype — seeg_prototype","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"Intended creating/editing geometry prototype, please see load_prototype load existing prototype","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"","code":"seeg_prototype( type, center_position, contact_widths, diameter = 1, channel_order = seq_along(center_position), fix_contact = 1, overall_length = 200, description = NULL, dry_run = FALSE, default_interpolation = NULL, viewer_options = NULL, overwrite = FALSE )"},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"type type string unique identifier prototype center_position numerical vector, contact center positions contact_widths numerical vector length one, width widths contacts diameter probe diameter channel_order channel order contacts; default sequence along number fix_contact NULL integer channel_order, indicating contact important fixed localization, default 1 (inner-target contact) overall_length probe length, default 200 description prototype description dry_run whether save prototype configurations default_interpolation default interpolation string electrode localization viewer_options list viewer options; list key-value pairs keys controller names values corresponding values users switch localizing electrode group overwrite whether overwrite existing configuration file; default false, throws warning duplicated","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"electrode shaft geometry prototype; configuration file saved 'RAVE' 3rd-party repository.","code":""},{"path":"https://dipterix.org/threeBrain/reference/seeg_prototype.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create 'sEEG' shaft geometry prototype — seeg_prototype","text":"","code":"probe_head <- 2 n_contacts <- 12 width <- 2.41 contact_spacing <- 5 overall_length <- 400 diameter <- 1.12 contacts <- probe_head + width / 2 + 0:(n_contacts-1) * contact_spacing proto <- seeg_prototype( type = \"AdTech-sEEG-SD12R-SP05X-000\", description = c( \"AdTech sEEG - 12 contacts\", \"Contact length : 2.41 mm\", \"Central spacing : 5 mm\", \"Tip size : 2 mm\", \"Diameter : 1.12 mm\" ), center_position = contacts, contact_widths = width, diameter = diameter, overall_length = overall_length, dry_run = TRUE ) print(proto, details = FALSE) #> #> Type : ADTECH-SEEG-SD12R-SP05X-000 #> Description : AdTech sEEG - 12 contacts #> Contact length : 2.41 mm #> Central spacing : 5 mm #> Tip size : 2 mm #> Diameter : 1.12 mm #> Channels : 12 #> Anchors : 12 contacts, 0 non-contacts"},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":null,"dir":"Reference","previous_headings":"","what":"Download and Manage Template Subjects — template_subject","title":"Download and Manage Template Subjects — template_subject","text":"Download Manage Template Subjects","code":""},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download and Manage Template Subjects — template_subject","text":"","code":"download_template_subject( subject_code = \"N27\", url, template_dir = default_template_directory() ) download_N27(make_default = FALSE, ...) set_default_template( subject_code, view = TRUE, template_dir = default_template_directory() ) threebrain_finalize_installation( upgrade = c(\"ask\", \"always\", \"never\", \"data-only\", \"config-only\"), async = TRUE ) available_templates()"},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download and Manage Template Subjects — template_subject","text":"subject_code character letters numbers (Important); default `N27` url zip file address; must specified subject_code followings: 'bert', 'cvs_avg35', 'cvs_avg35_inMNI152', 'fsaverage', 'fsaverage_sym', 'N27' template_dir parent directory subject's `FreeSurfer` folder stored make_default logical, whether make `N27` default subject ... pass download_template_subject view whether view subject upgrade whether check download 'N27' brain interactively. Choices 'ask', 'always', 'never' async whether run job parallel others; default true","code":""},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Download and Manage Template Subjects — template_subject","text":"view electrodes implanted multiple subjects, highly recommended view template space detail mapping method discussed function freesurfer_brain. map template space, one idea find someone whose brain normal. case, choice subject `N27`, also known `Colin 27`. function download_N27 provides simple easy way download partial version Internet. ideas template brain, can use function set_default_template(subject_code, template_dir) redirect choice. template brain `Zip` file Internet, provide function download_template_subject automatically install .","code":""},{"path":"https://dipterix.org/threeBrain/reference/template_subject.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Download and Manage Template Subjects — template_subject","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/threeBrain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a brain object — threeBrain","title":"Create a brain object — threeBrain","text":"Create brain object","code":""},{"path":"https://dipterix.org/threeBrain/reference/threeBrain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a brain object — threeBrain","text":"","code":"threeBrain( path, subject_code, surface_types = \"pial\", atlas_types, ..., template_subject = unname(getOption(\"threeBrain.template_subject\", \"N27\")), backward_compatible = getOption(\"threeBrain.compatible\", FALSE) )"},{"path":"https://dipterix.org/threeBrain/reference/threeBrain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a brain object — threeBrain","text":"path path 'FreeSurfer' directory, 'RAVE' subject directory containing 'FreeSurfer' files, simply 'RAVE' subject subject_code subject code, characters surface_types surface types load; default 'pial', common types 'white', 'smoothwm' atlas_types brain atlas load; default 'wmparc', exists, 'aparc+aseg', choices 'aparc.a2009s+aseg', 'aparc.DKTatlas+aseg', depending atlas files 'fs/mri' folder ... reserved future use template_subject template subject refer ; used group template mapping backward_compatible whether support old format; default false","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejsBrainOutput.html","id":null,"dir":"Reference","previous_headings":"","what":"Shiny Output for threeBrain Widgets — threejsBrainOutput","title":"Shiny Output for threeBrain Widgets — threejsBrainOutput","text":"Shiny Output threeBrain Widgets","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejsBrainOutput.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Shiny Output for threeBrain Widgets — threejsBrainOutput","text":"outputId unique identifier widget width, height width height widget. default width=\"100 height=\"500px\". reportSize whether report widget size shiny session$clientData","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejsBrainOutput.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Shiny Output for threeBrain Widgets — threejsBrainOutput","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create a Threejs Brain and View it in Browsers — threejs_brain","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"Create Threejs Brain View Browsers","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"","code":"threejs_brain( ..., .list = list(), width = NULL, height = NULL, background = \"#FFFFFF\", cex = 1, timestamp = TRUE, title = \"\", side_canvas = FALSE, side_zoom = 1, side_width = 250, side_shift = c(0, 0), side_display = TRUE, control_panel = TRUE, control_presets = NULL, control_display = TRUE, camera_center = c(0, 0, 0), camera_pos = c(500, 0, 0), start_zoom = 1, symmetric = 0, default_colormap = \"Value\", palettes = NULL, value_ranges = NULL, value_alias = NULL, show_inactive_electrodes = TRUE, surface_colormap = system.file(\"palettes\", \"surface\", \"ContinuousSample.json\", package = \"threeBrain\"), voxel_colormap = system.file(\"palettes\", \"datacube2\", \"FreeSurferColorLUT.json\", package = \"threeBrain\"), videos = list(), widget_id = \"threebrain_data\", tmp_dirname = NULL, debug = FALSE, enable_cache = FALSE, token = NULL, controllers = list(), browser_external = TRUE, global_data = list(), global_files = list(), qrcode = NULL, custom_javascript = NULL, show_modal = \"auto\", embed = FALSE )"},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"..., .list geometries inherit AbstractGeom width, height positive integers. Width height widget. default width=`100%`, height varies. background character, background color \"#FFFFFF\" \"white\" cex positive number, relative text magnification level timestamp logical, whether show time-stamp beginning title viewer title side_canvas logical, enable side cameras view objects fixed perspective side_zoom numerical, side camera enabled, zoom-level, 1 5 side_width positive integer, side panel size pixels side_shift integer length two, side panel shift pixels (`CSS style`: top, left) side_display logical, show/hide side panels beginning control_panel logical, enable control panels widget control_presets characters, presets shown control panels control_display logical, whether expand/collapse control UI beginning camera_center numerical, length three, XYZ position camera focus camera_pos XYZ position camera , default (0, 0, 500) start_zoom numerical, positive number indicating camera zoom level symmetric numerical, default 0, color center mapped value default_colormap character, color map name display startup palettes named list, names corresponds color-map names want change color palettes value_ranges named list, similar palettes, value range values value_alias named list, legend title corresponding variable show_inactive_electrodes logical, whether show electrodes values surface_colormap color map path generated create_colormap(gtype=\"surface\") render surfaces vertices; see create_colormap details. voxel_colormap color map path generated create_colormap(gtype=\"volume\") render volume atlases; see create_colormap details. videos named list, names corresponds color-map names, items generated video_content widget_id character, internally used unique identifiers widgets; use multiple widgets one website tmp_dirname character path, internally used, store temporary files debug logical, internally used debugging enable_cache whether enable cache, useful rendering viewers repeatedly shiny applications token unique character, internally used identify widgets 'JavaScript' 'localStorage' controllers list override settings, example proxy$get_controllers() browser_external logical, use system default browser (default) built-one. global_data, global_files internally use, mainly store orientation matrices files. qrcode 'URL' show 'QR' code; can character string named list 'url' 'text' (hyper-reference text) custom_javascript customized temporary 'JavaScript' code runs ready state; available 'JavaScript' variables : 'groups' input information group 'geoms' input information geometry 'settings' input information canvas settings 'scene' 'threejs' scene object 'canvas' canvas object 'gui' controls data panel 'presets' preset 'gui' methods show_modal logical \"auto\", whether show modal instead direct rendering viewers; designed users 'WebGL' support; used shiny applications embed whether try embedding viewer current run-time; default false (launch default web browser); set true running 'rmarkdown' 'quarto', see viewer 'RStudio' default panel.","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"Zhengjia Wang","code":""},{"path":"https://dipterix.org/threeBrain/reference/threejs_brain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create a Threejs Brain and View it in Browsers — threejs_brain","text":"","code":"if( interactive() ) { library(threeBrain) # Please use `download_N27` to download N27 Collins template brain n27_path <- file.path(default_template_directory(), \"N27\") if( dir.exists(n27_path) ) { brain <- threeBrain(path = n27_path, subject_code = \"N27\", surface_types = c('pial', 'smoothwm')) print(brain) brain$plot( background = \"#000000\", controllers = list( 'Voxel Type' = 'aparc_aseg', 'Surface Type' = 'smoothwm', 'Blend Factor' = 1, 'Right Opacity' = 0.3, 'Overlay Sagittal' = TRUE ), show_modal = TRUE ) } }"},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":null,"dir":"Reference","previous_headings":"","what":"Add video content to the viewer — video_content","title":"Add video content to the viewer — video_content","text":"Add video content viewer","code":""},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Add video content to the viewer — video_content","text":"","code":"video_content( path, duration = Inf, time_start = 0, asp_ratio = 16/9, local = TRUE )"},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Add video content to the viewer — video_content","text":"path local file path 'URL' duration duration video time_start start time relative stimuli onset asp_ratio aspect ratio; default 16/9 local used path 'URL': whether download video generating viewer; see 'Details'","code":""},{"path":"https://dipterix.org/threeBrain/reference/video_content.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Add video content to the viewer — video_content","text":"video path can either local file path 'URL' websites. path internet, two options: download video generating viewer, directly use 'URL'. download happens viewer generated (local=TRUE), video content local. viewer self-contained. However, distribution contain video, archive size might large. raw 'URL' used (local=FALSE), viewer self-contained video link might break anytime. 'screenshot' 'record' function might limited 'URL' different domain . However, distribution contain video, hence smaller. works scenarios preferred share video files licensed, simply distribution limited. Besides, method slightly faster local alternatives.","code":""},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"Generate surface file 'nii' 'mgz' volume files","code":""},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"","code":"volume_to_surf( volume, save_to = NA, lambda = 0.2, degree = 2, threshold_lb = 0.5, threshold_ub = NA, format = \"auto\" )"},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"volume path volume file, object read_volume. save_to save surface file; default NA (save). lambda 'Laplacian' smooth, higher smoother degree 'Laplacian' degree; default 2 threshold_lb lower threshold volume (create mask); default 0.5 threshold_ub upper threshold volume; default NA (upper bound) format format file save_to valid path, choices include 'auto' Default, supports 'FreeSurfer' binary format 'ASCII' text format, based file name suffix 'bin' 'FreeSurfer' binary format 'asc' 'ASCII' text format 'ply' 'Stanford' 'PLY' format '' Object file format 'obj' 'Wavefront' object format 'gii' 'GIfTI' format. Please avoid using 'gii.gz' file suffix 'mz3' 'Surf-Ice' format 'byu' 'BYU' mesh format 'vtk' Legacy 'VTK' format 'gii', otherwise 'FreeSurfer' format. Please use 'gii.gz' suffix.","code":""},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"Triangle 'rgl' mesh (vertex positions native 'RAS'). save_to valid path, mesh saved location.","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/reference/volume_to_surf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate surface file from 'nii' or 'mgz' volume files — volume_to_surf","text":"","code":"library(threeBrain) N27_path <- file.path(default_template_directory(), \"N27\") if(dir.exists(N27_path)) { aseg <- file.path(N27_path, \"mri\", \"aparc+aseg.mgz\") # generate surface for left-hemisphere insula mesh <- volume_to_surf(aseg, threshold_lb = 1034, threshold_ub = 1036) if(interactive()) { ravetools::rgl_view({ ravetools::rgl_call(\"shade3d\", mesh, color = \"yellow\") }) } }"},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":null,"dir":"Reference","previous_headings":"","what":"Color maps for volume or surface data — voxel_colormap","title":"Color maps for volume or surface data — voxel_colormap","text":"Color maps volume surface data","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Color maps for volume or surface data — voxel_colormap","text":"","code":"create_colormap( gtype = c(\"surface\", \"volume\"), dtype = c(\"continuous\", \"discrete\"), key, color, value, alpha = FALSE, con = NULL, auto_rescale = FALSE, ... ) save_colormap(cmap, con) freeserfer_colormap(con) load_colormap(con)"},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Color maps for volume or surface data — voxel_colormap","text":"gtype geometry type, choices \"surface\", \"volume\" dtype data type, \"continuous\" \"discrete\" key non-negative integer vector corresponding color values; length must exceed 1; see 'Details' color characters, corresponding color strings key value actual value key alpha whether respect transparency con file path write results read . file path can passed voxel_colormap threejs_brain. auto_rescale automatically scale color according image values; valid continuous color maps ... used continuous color maps, passed colorRampPalette cmap color map object","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Color maps for volume or surface data — voxel_colormap","text":"list color map information","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Color maps for volume or surface data — voxel_colormap","text":"Internal 'JavaScript' shader implementation uses integer color keys connect color palettes corresponding values. keys must non-negative. Zero key special color key reserved system. Please avoid using valid values.","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_colormap.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Color maps for volume or surface data — voxel_colormap","text":"","code":"# Creates a symmetric continuous colormap with 3 keys # The color range is -10 to 10 # The colors are 'blue','white','red' for these keys pal <- create_colormap( gtype = \"volume\", dtype = \"continuous\", key = c(1,2,3), value = c(-10,0,10), color = c('blue','white','red')) print( pal ) #> #> Version: 1.1 #> Geometry Type: volume #> Data Type: continuous #> Transparent: FALSE #> # of keys: 3 #> Min Colorkey: 1 #> Max Colorkey: 3 #> Auto-rescale ColorKey: no #> Value Range: -10 ~ 10 # ---------------- Get colormap key from a value ------------ # returns key index starting from pal$get_key( -10 ) #> [1] 1 # nearest value pal$get_key( 2 ) #> [1] 2 # set threshold, key is now 0 (no color) pal$get_key( 2, max_delta = 1 ) #> [1] 0 # ---------------- Save and load ---------------- f <- tempfile( fileext = '.json' ) save_colormap( pal, f ) cat(readLines(f), sep = '\\n') #> {\"__global_data__.VolumeColorLUT\":{\"map\":{\"1\":{\"ColorID\":1,\"Label\":-10,\"R\":0,\"G\":0,\"B\":255},\"2\":{\"ColorID\":2,\"Label\":0,\"R\":255,\"G\":255,\"B\":255},\"3\":{\"ColorID\":3,\"Label\":10,\"R\":255,\"G\":0,\"B\":0}},\"mapAlpha\":false,\"mapMinColorID\":1,\"mapMaxColorID\":3,\"mapValueRange\":[-10,10],\"mapDataType\":\"continuous\",\"mapGeomType\":\"volume\",\"colorIDAutoRescale\":false,\"mapVersion\":1.1}} load_colormap(f) #> #> Version: 1.1 #> Geometry Type: volume #> Data Type: continuous #> Transparent: FALSE #> # of keys: 3 #> Min Colorkey: 1 #> Max Colorkey: 3 #> Auto-rescale ColorKey: no #> Value Range: -10 ~ 10"},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate volume data from 'MNI' coordinates — voxel_cube","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"Generate volume data 'MNI' coordinates","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"","code":"add_voxel_cube( brain, name, cube, size = c(256, 256, 256), trans_mat = NULL, trans_space_from = c(\"model\", \"scannerRAS\"), color_format = c(\"RGBAFormat\", \"RedFormat\") ) add_nifti( brain, name, path, trans_mat = NULL, color_format = c(\"RGBAFormat\", \"RedFormat\"), trans_space_from = c(\"model\", \"scannerRAS\") ) create_voxel_cube( mni_ras, value, colormap, keys = colormap$get_key(value), dimension = c(256, 256, 256) )"},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"brain 'threeBrain' brain object generated freesurfer_brain2 merge_brain. 'rave' package installed, brain can generated rave::rave_brain2 name name voxel cube, letters, digits '_' allowed; characters replaced '_' cube 3-mode array; see following example size actual size volume, usually dot multiplication dimension voxel size trans_mat transform matrix volume. add_voxel_cube, matrix data cube geometry model center world ('tkrRAS') transform. add_nifti, matrix 'Nifti' 'RAS' world ('tkrRAS') transform. trans_space_from trans_mat transform begin; default object 'model' space; alternative space 'scannerRAS', meaning matrix transform volume cube 'scannerRAS' world space. color_format color format internal texture. Default 4-channel 'RGBAFormat'; alternative choice 'RedFormat', saves volume data single red-channel save space path 'Nifti' data path mni_ras 'MNI' 'RAS' coordinates, n--3 matrix value data values (length n); used keys missing colormap color map generated create_colormap; see voxel_colormap details keys integer color-keys generated color map length n; alternatively, specify value colormap generate keys automatically dimension volume dimension; default 256 x 256 x 256 array cube; must integers length 3","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"create_voxel_cube returns list cube data informations; add_voxel_cube returns brain object","code":""},{"path":"https://dipterix.org/threeBrain/reference/voxel_cube.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate volume data from 'MNI' coordinates — voxel_cube","text":"","code":"# requires N27 brain to be installed # use `download_N27()` to download template Collins brain # sample MNI coords tbl <- read.csv(system.file( 'sample_data/example_cube.csv', package = 'threeBrain' )) head(tbl) #> X x y z key #> 1 1 50 -60 -14 215 #> 2 2 62 -22 -22 229 #> 3 3 42 -64 10 209 #> 4 4 36 -60 2 230 #> 5 5 34 -72 10 149 #> 6 6 50 -50 6 229 # load colormap cmap <- load_colormap(system.file( 'palettes/datacube2/Mixed.json', package = 'threeBrain' )) x <- create_voxel_cube( mni_ras = tbl[, c('x', 'y', 'z')], keys = tbl$key, dimension = c(128, 128, 128) ) n27_path <- file.path(default_template_directory(), \"N27\") if( interactive() && dir.exists(n27_path) ) { brain <- merge_brain() # or add_voxel_cube(brain, 'example', x$cube) x$add_to_brain(brain, 'example') brain$plot(controllers = list( \"Voxel Type\" = 'example', 'Right Opacity' = 0.3, 'Left Opacity' = 0.3, 'Background Color' = '#000000' ), voxel_colormap = cmap) }"},{"path":"https://dipterix.org/threeBrain/shortcuts.html","id":null,"dir":"","previous_headings":"","what":"3D Brain Viewer Shortcuts","title":"3D Brain Viewer Shortcuts","text":"shortcut keys active mouse main canvas (controling GUI side panel) Hold Ctrl, Shift, Alt drag brain want fix rotation axis using MacOSX, Alt key equivalent Option [⌥], Ctrl equivalent Control [^]","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"major-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Major Changes","title":"threeBrain 1.1.0","text":"threejs engine upgraded v160; added support NIfTI GIfTI images Allowed data embedded viewer dataURI. results truly standalone viewer: extra engine required, web-browser needed. Added electrode geometry prototype, allowing users see electrode rather using spheres, useful electrodes super micro contacts electrodes segmented contact like DBS Added support showing (cortical sub-cortical) ROI surfaces Implemented drag--drop feature drop arbitrary volume (nii,mgz) surface (fs,gii) files viewer. surface coordinate system inferred file name following BIDS convention. surface color can set via color-map (csv) file name Implemented slice (side viewer) overlay Users can control side camera frustums (near far) separately Implemented worker system viewer can run truly parallel code background line--sight mode, underlay image sliced dynamically plane orthogonal line sight; two (orthogonal) planes parallel line sight snap--electrode, volume slices snapped electrode direction (available electrode prototype used electrode direction defined). two planes dynamically slice MRI Users can localize electrode probe clicking target location, entry location Added option add QR code viewer, allowing people link publication Loading progress informative now Implemented plot_slices allow plotting MRI slices contact canonical order Users can set default colors electrodes via brain$electrodes$fix_electrode_color Users can override underlay images placing rave_slices.nii[.gz] mri/ FreeSurfer folder File/Data loaders use JavaScript workers now (can disabled enable_cache=TRUE) Added mesh clipping see depth electrodes without compromising color Implemented volume clipping Added new mode ACPC alignment Added target flag objects can rendered differently main canvas versus side canvas","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"minor-changes-1-1-0","dir":"Changelog","previous_headings":"","what":"Minor changes","title":"threeBrain 1.1.0","text":"Electrode prototype names follow type-company-version.json format Added compass object side cameras slice mode canonical Remove UV mapping sphere electrodes Added model direction electrodes assist calculating Euler axis angles Volume, atlas threshold asynchronous now Changed default values controller Added broadcast() controllers; Atlas key number displayed users longer need search look-table Added debug flag keyboard shortcuts Viewer finally compiles quarto/rmarkdown Implemented functions create sEEG electrodes Slices write depth buffer rendered side canvas, electrode contacts blocked Allowed anchor fixed localizing electrode prototype Using instancedMesh render actual electrode spheres prototype used users choose see actual contact locations Implemented mapToTemplate electrode prototypes Pial surface write depth buffer ’s super transparent Added drivers set object transform matrix Adjust implementation background color arcball radius Removed composer effects, using shaders render electrode outline Trackball uses longer side canvas instead shorter side radius Added electrode visibility mode: use threshold-show contacts pass threshold even display value given Overlay brightness can adjusted via controller Adjusted title position Updated CITATION New color map used electrodes consistent RAVE color Allow adding additional geometries brain$plot Improved spacing interpolation extrapolation (electrode localization); removed old interpolation logic; added distanceRatio prevent large shift (auto adjust) Electrodes opaque main transparent side canvas Using pial surface center trackball center Dithering datacube2 make rendering natural main canvas default set MRI slices visible surfaces missing Drag & drop file names sanitized avoid displaying issues Electrode contacts (instancedMesh) now click-able dispose cleaner now, also fires events Added makeClickable removeClickable replace previous add_clickable function Renamed register_object registerToMap Better ways sanitize datacube Improved datacube overlay texture, including using clamp--border instead clamp--edge Ray-casting electrode prototypes instancedMesh now works contact-mode Show electrode prototype contacts default Added color modes uploaded images removed normalize method (replaced getNormalizedImage) NiftiImage MGHImage Using script generate change log automatically Git commits Scrolling side canvas faster now Allowed prototype contact colors fixed Prototype control points displays channel information (provided control points channels) Added color (randomColor, testColorString) file-name utility functions Soft removed addColorCoat using ElectrodeMaterial, results massive code improvement electrode instance Allow set default electrode colors contact rendered values fixed color Scrolling side canvas faster now Color look-table can set arbitrary single color (HexString, indicating values rendered color; Drag & Drop volumes can change single colors Remembers state switching volumes (datacube2)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-1-1-0","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 1.1.0","text":"Fixed NamedLut color error value range zero Prototype electrode click information displays channel number Fixed RShinyDriver issue object construction parameters (using getThreeBrainInstance instead) Avoid rendering volume data sub-cortical ROI Fixed UV issues electrode geometry prototypes Fixed bug slice instance missing controller tries set overlay JavaScript map hidden compiled browsers complain missing maps Significantly reduced chances viewer crash R shiny applications Fixed shader crash issue Windows WebGL2 hard requirement now; users notified requirement met Mouse position canvas calculated every mouse instead every resizing fix control issues page scrolled shiny app Fixed controller.load handle invalid set controller request Fixed textsprite depth issues Fixed light new engine Fixed visualization volume cubes using NIfTI files Fixed volume transforms sform qform inconsistent NIfTI Fixed bug interpolation spacing fixed incorrect ROI label as_subcortical_label generates correct white-matter labels Fixed freesurfer_lut Fixed auto-adjust feature (electrode localization) Fixed UV mapping issue sphere electrode geometry Fixed shader issue transparency set negative (treated 1) Using NIfTI headers get calculated color intensities applying heuristic approach","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-102","dir":"Changelog","previous_headings":"","what":"threeBrain 1.0.2","title":"threeBrain 1.0.2","text":"Removed shader loop accidentally used dynamic variable looping, may crash Windows certain situations Updated README.md Composer effects removed Added default color electrodes (JavaScript) fix localization electrode color set correctly issues Added z-index base side canvas layer (div) Removed additional unused parameters material call Used new material type make brain realistic New background color implemented Trackball uses width instead height viewer Arcball radius; mouse positions calculated whenever mouse-event triggered (allowing accurate track-ball calculation Shiny applications) Made col2hexstr internal function Added new electrode visibility mode, allowing show contacts values passing threshold Added brain$electrodes$fix_electrode_color fix electrode colors given data names (display DBS electrodes, example) Made controller.load robust errors Fixed depth issue TextSprite default controller values changed make sense Outline render effect removed; electrode outlines implemented directly shader Updated three.js v160 light model improved Added rave_slices.nii allowed MRI prefix FreeSurfer folder highest priority, image treated default volume load side canvas (default still brain.finalsurfs.mgz) Allow MRI change brightness dynamically viewer Ensure voxels index zeros Added brain$get_atlas_labels guess atlas labels given masks atlas files Allowed spatially transform electrodes desired coordinate system Updated citation standalone viewer require static server anymore: everything self-contained (require pandoc, comes RStudio) Changed mechanism animation color map generator (color accurate discrete variables) Added png dependence Added support AC-PC alignment, available RAVE - YAEL module Allow brain plot additional customized geometries Added plot_slides plot MRI centered electrode contact slide--slide visualization Added Line--Sight view mode side canvas; can enabled using shortcut m (previous shortcut change material type changed shift+M) Fixed CT JavaScript sform qform different (different code) Allowed specify spacing interpolation extrapolation unequally spaced electrodes Added electrode outlines YAEL paper finally Fixed incorrect sub-cortical labels Deprecated old format (cache needed anymore) Made electrodes opaque main transparent side canvas Let controllers check variable valid set avoid invalid viewer state initialization Added get_ijk2ras get Norig Torig matrix","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-101","dir":"Changelog","previous_headings":"","what":"threeBrain 1.0.1","title":"threeBrain 1.0.1","text":"CRAN release: 2023-07-03 Updated controller library reasonable input focus Allow MRI slices NIfTI format Set slices visible default surface available Fixed transform datacube2 Fixed qform reading NIfTI files Fixed auto-refine functions electrode localization Removed clipboard auto-copy auto-paste functions since conflict viewers; instead users can use controllers copy paste state","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-100---egypt","dir":"Changelog","previous_headings":"","what":"threeBrain 1.0.0 - Egypt","title":"threeBrain 1.0.0 - Egypt","text":"CRAN release: 2023-06-03 version major update. Created threeBrain::threeBrain formal way create brain objects Updated JavaScript engine v150 Allow getting HTML tags saved widget widget can used Jupyter notebook Added $render method remember viewer states Allowing set title via proxy driver Added citation information Fixed hemisphere issue localization electrodes closer opposite hemispheres Added electrode registration anatomical slice cross-hair","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-029","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.9","title":"threeBrain 0.2.9","text":"CRAN release: 2023-03-14 version plans major update. highlights: Electrode localization can done original CT instead re-sampled ones Completely isolate JavaScript engine R code. JavaScript code available npm package used via sub-module Implemented file readers directly JavaScript, allows reading files directly viewer, cache needed home-brew version threejs required: standard npm distribution used New controller GUI implemented viewer can driven via JavaScript directly via event dispatchers Anatomical segmentation map visible side panels; voxel values displayed setting crosshair","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"detailed-changes-0-2-9","dir":"Changelog","previous_headings":"","what":"Detailed Changes","title":"threeBrain 0.2.9","text":"Added step size datacube2 material uniforms Upgraded threejs r148, use npm distribution “three” Massive code re-factory (variable names, trackball controls, legacy classes…) Removed data-GUI use lil-GUI Fixed compass (finally…) Added title viewer Reworked whole message signal system, added ThrottledEventDispatcher.js Added MouseKeyboard class track mouse keyboard events, greatly reduced canvas burden Added animParameter object canvas keep track animation parameters reworked shiny drivers fixed one-voxel shift issues Added format support nii, mgh/mgz, FreeSurfer surface, FreeSurfer node value binary formats Added function threeBrain allow 3D viewer run without cache (fs ) Fixed memory leak issues JavaScript code Geometry groups can now change storage path JS completely independent now (available npm now) Peel event dispatcher canvas class events can managed separately Hide time-stamps data/animation available Added experimental support show labels regular electrodes; currently depth-test turned Added GUI support change electrode label visibility size Electrode label size adjusts along electrode radius handle_resize now put resizing function detecting widget size small","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-9","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.9","text":"Fixing xfm parsed correctly line starts blank spaces Stopped rendering canvas canvas small (less 10 pixels)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-027","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.7","title":"threeBrain 0.2.7","text":"CRAN release: 2022-10-15","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-7","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.7","text":"Rewired events, allowing drive viewer via JavaScript events Allowed set animation playback status Remove modal default raveio ravedash loaded Edited launch script always use Python3","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-7","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.7","text":"Fixed installation issues (template brain) Windows, avoid backslashes","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-026","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.6","title":"threeBrain 0.2.6","text":"CRAN release: 2022-08-25","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-6","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.6","text":"Allowed users pan camera localizing electrodes Added line segment geometry type can either display static line segments (DTI), connect two electrodes dynamically Printing brain now uses accurate terms Allowed CT either path actual data calling localizing function","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-6","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.6","text":"Fixed NifTi orientation issues use sform Fixed localization issue NifTi transform matrix determinant equally 1 Fixed volume shader, resolved shift issues panning camera","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-025","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.5","title":"threeBrain 0.2.5","text":"CRAN release: 2022-05-30","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-5","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.5","text":"Surface sync voxels now clamp surface nodes Added Voxel Display controller toggle volume display modes Changed shortcut l Voxel Type Voxel Display Volume fragmentShader uses non-linear function calculate fragment colors combined face normal; create smoother results DataCube2 geometry uses ConvexHull instead box/sphere improve performance DataCube2 longer hidden sync voxels : users can use shortcuts l k easily control visibility. download_template_subject can download templates fsaverage, cvs_avg35, bert.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-2-5","dir":"Changelog","previous_headings":"","what":"Bug fixes","title":"threeBrain 0.2.5","text":"Fixed volume rendering issue ray-marching directions calculated correctly Fixed color set correctly changing Voxel Labels surface colors sync voxels","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-024","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.4","title":"threeBrain 0.2.4","text":"CRAN release: 2021-12-03 version mainly works electrode localization. changes occur JavaScript engine.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-4","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.4","text":"Allows electrodes reset Displays electrode labels along electrodes Allows resizing electrode size fly Allows resizing electrode labels Localization module integrated RAVE Added line mesh mark distance electrode deviating original position. line color changes distance value.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-4","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.4","text":"Improved localization precision Auto-adjusting electrodes now respects topology Electrodes localization mode now LocElectrode class Volume rendering ray-casters now respects transform matrices","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-023","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.3","title":"threeBrain 0.2.3","text":"CRAN release: 2021-10-13","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-3","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.3","text":"Electrode localization now shiny application","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-3","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.3","text":"Added 3 vignettes","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-2","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.2","text":"Supported video content display auditory visual stimuli along response Default closing default volume side folders","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-2","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.2","text":"Fixed electrode localization interpolation issue Proper dispose localized electrodes Fixed screenshot video recording functions Renamed recording button Chrome-specific","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-021","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.1","title":"threeBrain 0.2.1","text":"CRAN release: 2021-08-03","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.1","text":"Finally, electrode localization added! Added TextTexture internal code display text Sprite easily Can download electrodes csv","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-020","dir":"Changelog","previous_headings":"","what":"threeBrain 0.2.0","title":"threeBrain 0.2.0","text":"CRAN release: 2021-07-27","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.2.0","text":"efficient volume rendering transparency Added shader functions surface instances, allowing color rendering volume, electrodes, vertices (major change) Added color-map generator surface volume data Added method generate data cube (volume) MNI305 coordinates Optimized loading procedure Removed crayon, base64enc, htmltools, pryr dependence","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-2-0","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.2.0","text":"Bumped threejs version v131dev Fixed surface transparency losing fragments issue Added loaders shiny applications avoid performance issues old computers Fixed electrodes selected mouse click-(Firefox)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-019","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.9","title":"threeBrain 0.1.9","text":"CRAN release: 2021-01-10","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-9","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.9","text":"Added backend engine volume rendering show atlas files Standalone viewers now use native system tools Mac Linux (Windows, still needs R installed)","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-9","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.9","text":"Allows super slow play speed show animations millisecond level Bumped threejs newer version fixed compatibility issues Animation time range reasonable","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-018","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.8","title":"threeBrain 0.1.8","text":"CRAN release: 2020-06-23","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-8","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.8","text":"Screenshot now downloads pdf format","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-8","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.8","text":"Fixed freesurferformats face index starting 1 instead 0","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-017","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.7","title":"threeBrain 0.1.7","text":"CRAN release: 2020-05-12","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-7","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.7","text":"Now displays MNI305 coordinates instead tkRAS coordinates Removed reticulate related functions support native R functions","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-7","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.7","text":"Fixed MNI305 calculation issues Internally calculates anterior commissure","code":""},{"path":[]},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-6","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.6","text":"Implemented view_ct_t1 view CT aligned T1 images Updated document generate FreeSurfer brain Removed dependency nibabel use native R packages Re-designed legends, added options show, hide display information Added screenshot download image","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-6","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.6","text":"Added hints keyboard shortcuts","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-015","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.5","title":"threeBrain 0.1.5","text":"CRAN release: 2020-01-20","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-5","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.5","text":"Import FreeSurfer SUMA files sulc Control element update Added brain_proxy control shiny element Separated display threshold data FreeMesh material can switched MeshPhongMaterial MeshLambertMaterial","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-5","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.5","text":"UI blur focus clicking canvas Allow customizing widgets background, cex (font magnification), timestamp (display time) Allow controllers (list) override control UI Added preset syncviewers (threejs_brain(control_presets = ...)) synchronize multiple viewers shiny environment","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-014","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.4","title":"threeBrain 0.1.4","text":"CRAN release: 2019-10-18","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-4","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.4","text":"Implemented new mesh type - volume rendering using ray marching Added alternative methods read .nii files, nibabel now optional Customized color palettes value range better visualizations outliers requires T1.mgz brainmask brain.finalsurf found. allows users run FreeSurfer first stage, takes around 8 10 minutes instead 6 hours. Fully compatible htmlwidgets shiny mode. calling threejsBrainOutput shiny::renderUI, DOM element might get reset shiny, causing new 3D viewer created. might consume resource, causing memory leaks even conflict context renderings. Also event listeners couldn’t reset correctly. cache created now reusing canvas.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-4","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.4","text":"flexible directory requirement Added dispose function canvas memory gets cleared correctly Renderer optimization memory optimization","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"bug-fixes-0-1-4","dir":"Changelog","previous_headings":"Changes","what":"Bug Fixes","title":"threeBrain 0.1.4","text":"Fixed keyboard listeners locking keys Fixed huge memory leaks due threejs garbage collecting geometries textures","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-013","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.3","title":"threeBrain 0.1.3","text":"CRAN release: 2019-09-10","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-3","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.3","text":"File structure change: now directly read FreeSurfer folder Added readers .mgz, .m3z files Added coordinate system align volume surface data Implemented side-viewers, added three side cameras XYZ axis Can now read, export electrodes csv file Re-write brain generating function Can display/switch multiple value types Added transparency surfaces Implemented experimental electrode localization Automatically determine color type (continuous discrete) value range","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-3","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.3","text":"Shortcuts available Optimized electrode value settings","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-012","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.2","title":"threeBrain 0.1.2","text":"CRAN release: 2019-06-28","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"changes-0-1-2","dir":"Changelog","previous_headings":"","what":"Changes","title":"threeBrain 0.1.2","text":"Re-draw canvas 2D context make customized overlay directly canvas. Implemented continuous discrete legends replace D3. Added support set main camera position initial zoom level. Added 3D scatter plot examples. Use hybrid render mode animation required save battery usage. Improved color palette calculation. Support customized title.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"improvements-0-1-2","dir":"Changelog","previous_headings":"Changes","what":"Improvements","title":"threeBrain 0.1.2","text":"Support customized datapath saving widgets. Added instructions embed widgets websites without R.","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-011","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.1","title":"threeBrain 0.1.1","text":"Implemented three types geometries: plane, sphere free. free geometry takes arbitrary geometry vertices faces form 3D mesh object. Added animation sphere object. Replaced old JavaScript npx driven modules. Implemented D3 side-widget","code":""},{"path":"https://dipterix.org/threeBrain/news/index.html","id":"threebrain-010","dir":"Changelog","previous_headings":"","what":"threeBrain 0.1.0","title":"threeBrain 0.1.0","text":"Initial private beta release!","code":""}]