From e7bba899f2413701b124ce2b9c6671dc45d66019 Mon Sep 17 00:00:00 2001 From: dipterix <8163576+dipterix@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:31:36 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20dipterix?= =?UTF-8?q?/ieegio@d9731edcac8b4f4761cb4cdbff7ec224a12a024c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE.html | 2 +- articles/read-ephys.html | 2 +- articles/read-imaging-data.html | 14 +++++++------- authors.html | 2 +- index.html | 2 ++ news/index.html | 2 +- pkgdown.yml | 2 +- reference/LazyH5.html | 2 +- reference/NWBHDF5IO.html | 2 +- reference/SignalDataCache.html | 2 +- reference/ieegio_sample_data.html | 2 +- reference/imaging-surface.html | 2 +- reference/imaging-volume.html | 2 +- reference/io_h5_valid.html | 2 +- reference/io_read_h5.html | 2 +- reference/io_write_h5.html | 2 +- reference/low-level-read-write.html | 6 +++--- reference/plot.ieegio_surface.html | 2 +- reference/plot.ieegio_volume.html | 2 +- reference/pynwb_module.html | 2 +- reference/read_bci2000.html | 2 +- reference/read_brainvis.html | 2 +- reference/read_edf.html | 2 +- reference/read_nsx.html | 2 +- reference/read_nwb.html | 2 +- search.json | 2 +- 26 files changed, 35 insertions(+), 33 deletions(-) diff --git a/LICENSE.html b/LICENSE.html index 78cc932..ae9cb55 100644 --- a/LICENSE.html +++ b/LICENSE.html @@ -34,7 +34,7 @@
diff --git a/articles/read-ephys.html b/articles/read-ephys.html index 41c888f..38a3ff7 100644 --- a/articles/read-ephys.html +++ b/articles/read-ephys.html @@ -60,7 +60,7 @@

Read `ephys` data

- Source: vignettes/read-ephys.Rmd + Source: vignettes/read-ephys.Rmd
read-ephys.Rmd
diff --git a/articles/read-imaging-data.html b/articles/read-imaging-data.html index 774e508..c479374 100644 --- a/articles/read-imaging-data.html +++ b/articles/read-imaging-data.html @@ -60,7 +60,7 @@

Read imaging data

- Source: vignettes/read-imaging-data.Rmd + Source: vignettes/read-imaging-data.Rmd
read-imaging-data.Rmd
@@ -190,8 +190,8 @@

Surface files# plot the first column in measurements section plot(merged, name = list("measurements", 1))
- - +

Plot the normalized time-series data

@@ -214,12 +214,12 @@

Surface files) )
- - +
- - + +

diff --git a/authors.html b/authors.html index c5e13e0..b17b044 100644 --- a/authors.html +++ b/authors.html @@ -47,7 +47,7 @@

Authors

Citation

-

Source: DESCRIPTION

+

Source: DESCRIPTION

Wang Z (2024). ieegio: File IO for Intracranial Electroencephalography. diff --git a/index.html b/index.html index 7cb9e79..9b3e560 100644 --- a/index.html +++ b/index.html @@ -294,6 +294,8 @@

Developers

Dev status

diff --git a/news/index.html b/news/index.html index c92546d..96d96c0 100644 --- a/news/index.html +++ b/news/index.html @@ -34,7 +34,7 @@
diff --git a/pkgdown.yml b/pkgdown.yml index facd856..9cbb0ba 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: read-ephys: read-ephys.html read-imaging-data: read-imaging-data.html -last_built: 2024-09-16T14:28Z +last_built: 2024-09-16T14:31Z urls: reference: http://dipterix.org/ieegio/reference article: http://dipterix.org/ieegio/articles diff --git a/reference/LazyH5.html b/reference/LazyH5.html index b2d6b72..df9226c 100644 --- a/reference/LazyH5.html +++ b/reference/LazyH5.html @@ -34,7 +34,7 @@
diff --git a/reference/NWBHDF5IO.html b/reference/NWBHDF5IO.html index ad74d10..3518271 100644 --- a/reference/NWBHDF5IO.html +++ b/reference/NWBHDF5IO.html @@ -36,7 +36,7 @@
diff --git a/reference/SignalDataCache.html b/reference/SignalDataCache.html index 52f7dea..51cebf3 100644 --- a/reference/SignalDataCache.html +++ b/reference/SignalDataCache.html @@ -34,7 +34,7 @@
diff --git a/reference/ieegio_sample_data.html b/reference/ieegio_sample_data.html index 56a9d70..a58e3d3 100644 --- a/reference/ieegio_sample_data.html +++ b/reference/ieegio_sample_data.html @@ -34,7 +34,7 @@
diff --git a/reference/imaging-surface.html b/reference/imaging-surface.html index 3eb6212..c78e796 100644 --- a/reference/imaging-surface.html +++ b/reference/imaging-surface.html @@ -40,7 +40,7 @@
diff --git a/reference/imaging-volume.html b/reference/imaging-volume.html index 53d1fa8..ed6902e 100644 --- a/reference/imaging-volume.html +++ b/reference/imaging-volume.html @@ -40,7 +40,7 @@
diff --git a/reference/io_h5_valid.html b/reference/io_h5_valid.html index c250e5c..c7b9e56 100644 --- a/reference/io_h5_valid.html +++ b/reference/io_h5_valid.html @@ -34,7 +34,7 @@
diff --git a/reference/io_read_h5.html b/reference/io_read_h5.html index d5f16f9..a030e9d 100644 --- a/reference/io_read_h5.html +++ b/reference/io_read_h5.html @@ -36,7 +36,7 @@
diff --git a/reference/io_write_h5.html b/reference/io_write_h5.html index 3af9b5e..ae98e01 100644 --- a/reference/io_write_h5.html +++ b/reference/io_write_h5.html @@ -34,7 +34,7 @@
diff --git a/reference/low-level-read-write.html b/reference/low-level-read-write.html index 0c18fb8..99c0cfb 100644 --- a/reference/low-level-read-write.html +++ b/reference/low-level-read-write.html @@ -34,7 +34,7 @@
@@ -191,7 +191,7 @@

Examples# default reads in proxy io_read_fst(f) #> <fst file> -#> 10 rows, 3 columns (file18b336e070b8.fst) +#> 10 rows, 3 columns (file18a3598ce91.fst) #> #> a b c #> <integer> <double> <character> @@ -238,7 +238,7 @@

Examples# get header io_read_fst(f, "header_only") #> <fst file> -#> 10 rows, 3 columns (file18b336e070b8.fst) +#> 10 rows, 3 columns (file18a3598ce91.fst) #> #> * 'a': integer #> * 'b': double diff --git a/reference/plot.ieegio_surface.html b/reference/plot.ieegio_surface.html index 84f4c9f..4b62675 100644 --- a/reference/plot.ieegio_surface.html +++ b/reference/plot.ieegio_surface.html @@ -34,7 +34,7 @@
diff --git a/reference/plot.ieegio_volume.html b/reference/plot.ieegio_volume.html index f10581c..3738077 100644 --- a/reference/plot.ieegio_volume.html +++ b/reference/plot.ieegio_volume.html @@ -34,7 +34,7 @@
diff --git a/reference/pynwb_module.html b/reference/pynwb_module.html index 25b717b..89d9875 100644 --- a/reference/pynwb_module.html +++ b/reference/pynwb_module.html @@ -34,7 +34,7 @@
diff --git a/reference/read_bci2000.html b/reference/read_bci2000.html index fa85e28..1a50fec 100644 --- a/reference/read_bci2000.html +++ b/reference/read_bci2000.html @@ -34,7 +34,7 @@
diff --git a/reference/read_brainvis.html b/reference/read_brainvis.html index 628c814..d733d3f 100644 --- a/reference/read_brainvis.html +++ b/reference/read_brainvis.html @@ -34,7 +34,7 @@
diff --git a/reference/read_edf.html b/reference/read_edf.html index 7eb509c..d363bac 100644 --- a/reference/read_edf.html +++ b/reference/read_edf.html @@ -34,7 +34,7 @@
diff --git a/reference/read_nsx.html b/reference/read_nsx.html index 1004913..a3b16d3 100644 --- a/reference/read_nsx.html +++ b/reference/read_nsx.html @@ -34,7 +34,7 @@
diff --git a/reference/read_nwb.html b/reference/read_nwb.html index 7977b4e..eef31b7 100644 --- a/reference/read_nwb.html +++ b/reference/read_nwb.html @@ -40,7 +40,7 @@
diff --git a/search.json b/search.json index b5e3896..c631c1c 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"http://dipterix.org/ieegio/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Zhengjia Wang Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://dipterix.org/ieegio/articles/read-imaging-data.html","id":"volume-files","dir":"Articles","previous_headings":"","what":"Volume files","title":"Read imaging data","text":"ieegio::read_volume ieegio::write_volume provides high-level interfaces reading writing volume data MRI, CT. fMRI, etc. volume data (NIfTI, MGH, …) contains header, data, transforms list. transforms contain transforms volume (column, row, slice) index coordinate systems. commonly used one vox2ras, 4x4 matrix mapping voxels scanner (usually T1-weighted) RAS (right-anterior-superior) system. Accessing image values via [ operator. example, Plotting anatomical slices:","code":"volume <- read_volume(nifti_file) volume #> #> Type : rnifti/nifti #> Shape: c(256L, 256L, 256L) #> Transforms: #> vox2ras: #> [-1 0 0 131.6] #> [ 0 0 1 -127.5] #> [ 0 -1 0 127.5] #> [ 0 0 0 1] #> vox2ras_tkr: #> [-1 0 0 -128] #> [ 0 0 1 -128] #> [ 0 -1 0 -128] #> [ 0 0 0 1] #> vox2fsl: #> [1 0 0 0] #> [0 1 0 0] #> [0 0 1 0] #> [0 0 0 1] volume[128, , ] par(mfrow = c(1, 3), mar = c(0, 0, 3.1, 0)) ras_position <- c(-50, -10, 15) ras_str <- paste(sprintf(\"%.0f\", ras_position), collapse = \",\") for(which in c(\"coronal\", \"axial\", \"sagittal\")) { plot(x = volume, position = ras_position, crosshair_gap = 10, crosshair_lty = 2, zoom = 3, which = which, main = sprintf(\"%s T1RAS=[%s]\", which, ras_str)) }"},{"path":"http://dipterix.org/ieegio/articles/read-imaging-data.html","id":"surface-files","dir":"Articles","previous_headings":"","what":"Surface files","title":"Read imaging data","text":"Reading surface file using read_surface supports multiple data types can merge single object, making object multiple embedding data-sets: Plot surfaces 3D viewer, colored shape measurement Plot normalized time-series data","code":"library(ieegio) # geometry geometry <- read_surface(geom_file) # measurements measurement <- read_surface(shape_file) # time series time_series <- read_surface(ts_file) merged <- merge(geometry, measurement, time_series) print(merged) #> #> Header class: gifti #> Geometry : #> # of Vertex : 12 #> # of Face index : 20 #> # of transforms : 1 #> Transform Targets : Unknown #> Measurements: `Shape001` #> Time series: #> # of time points: 4 #> Average slice duration: 1 #> #> Contains: `geometry`, `measurements`, `time_series` # plot the first column in measurements section plot(merged, name = list(\"measurements\", 1)) ts_demean <- apply( merged$time_series$value, MARGIN = 1L, FUN = function(x) { x - mean(x) } ) merged$time_series$value <- t(ts_demean) plot( merged, name = \"time_series\", col = c( \"#053061\", \"#2166ac\", \"#4393c3\", \"#92c5de\", \"#d1e5f0\", \"#ffffff\", \"#fddbc7\", \"#f4a582\", \"#d6604d\", \"#b2182b\", \"#67001f\" ) )"},{"path":"http://dipterix.org/ieegio/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Zhengjia Wang. Author, maintainer.","code":""},{"path":"http://dipterix.org/ieegio/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wang Z (2024). ieegio: File IO Intracranial Electroencephalography. R package version 0.0.1, http://dipterix.org/ieegio/.","code":"@Manual{, title = {ieegio: File IO for Intracranial Electroencephalography}, author = {Zhengjia Wang}, year = {2024}, note = {R package version 0.0.1}, url = {http://dipterix.org/ieegio/}, }"},{"path":"http://dipterix.org/ieegio/index.html","id":"ieegio-io-toolbox-for-intracranial-electroencephalography","dir":"","previous_headings":"","what":"File IO for Intracranial Electroencephalography","title":"File IO for Intracranial Electroencephalography","text":"goal ieegio provide integrated toolbox common file formats used intracranial Electroencephalography (iEEG) deep-brain stimulation (DBS). Currently package active development.","code":""},{"path":"http://dipterix.org/ieegio/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"File IO for Intracranial Electroencephalography","text":"can install development version ieegio GitHub : ieegio provides additional sample data. download :","code":"# install.packages(\"pak\") pak::pak(\"dipterix/ieegio\") # list all the sample data sample_names <- ieegio::ieegio_sample_data() lapply(sample_names, ieegio::ieegio_sample_data)"},{"path":"http://dipterix.org/ieegio/index.html","id":"list-1-read-formatted-ephys-data-examples","dir":"","previous_headings":"","what":"List 1: read formatted ephys data (examples)","title":"File IO for Intracranial Electroencephalography","text":"following formats () supported. Please feel free make wish-list posting issue repository. Electrophysiology * - NWB format low-level support due format nature. Please see examples help(read_nwb)","code":""},{"path":"http://dipterix.org/ieegio/index.html","id":"list-2-read-imaging-data-examples","dir":"","previous_headings":"","what":"List 2: read imaging data (examples)","title":"File IO for Intracranial Electroencephalography","text":"Imaging","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":null,"dir":"Reference","previous_headings":"","what":"Lazy 'HDF5' file loader — LazyH5","title":"Lazy 'HDF5' file loader — LazyH5","text":"provides hybrid data structure 'HDF5' file","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Lazy 'HDF5' file loader — LazyH5","text":"quiet whether suppress messages","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Lazy 'HDF5' file loader — LazyH5","text":"LazyH5$finalize() LazyH5$print() LazyH5$new() LazyH5$save() LazyH5$open() LazyH5$close() LazyH5$subset() LazyH5$get_dims() LazyH5$get_type()","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"Lazy 'HDF5' file loader — LazyH5","text":"garbage collection method","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$finalize()"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"none","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Lazy 'HDF5' file loader — LazyH5","text":"overrides print method","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$print()"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"self instance","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Lazy 'HDF5' file loader — LazyH5","text":"constructor","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$new(file_path, data_name, read_only = FALSE, quiet = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"file_path data stored 'HDF5' format data_name data stored file read_only whether open file read-mode. highly recommended set true, otherwise file connection exclusive. quiet whether suppress messages, default false","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"self instance","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-save-","dir":"Reference","previous_headings":"","what":"Method save()","title":"Lazy 'HDF5' file loader — LazyH5","text":"save data 'HDF5' file","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$save( x, chunk = \"auto\", level = 7, replace = TRUE, new_file = FALSE, force = TRUE, ctype = NULL, size = NULL, ... )"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"x vector, matrix, array chunk chunk size, length matches data dimension level compress level, 1 9 replace data exists file, replace file new_file remove whole file exists writing? force open file read-mode, saving objects file raise error. Use force=TRUE force write data ctype data type, see mode, usually data type x. Try mode(x) storage.mode(x) hints. size deprecated, compatibility issues ... passed self open() method","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-open-","dir":"Reference","previous_headings":"","what":"Method open()","title":"Lazy 'HDF5' file loader — LazyH5","text":"open connection","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$open(new_dataset = FALSE, robj, ...)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"new_dataset used internal pointer closed, write data robj data array save ... passed createDataSet hdf5r package","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-close-","dir":"Reference","previous_headings":"","what":"Method close()","title":"Lazy 'HDF5' file loader — LazyH5","text":"close connection","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$close(all = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"whether close connections associated data file. true, connections, including access programs, closed","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-subset-","dir":"Reference","previous_headings":"","what":"Method subset()","title":"Lazy 'HDF5' file loader — LazyH5","text":"subset data","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$subset(..., drop = FALSE, stream = FALSE, envir = parent.frame())"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"drop whether apply drop subset stream whether read partial data time envir ,j,... expressions, expression evaluated , j, ... index along dimension","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"subset data","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-get-dims-","dir":"Reference","previous_headings":"","what":"Method get_dims()","title":"Lazy 'HDF5' file loader — LazyH5","text":"get data dimension","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$get_dims(stay_open = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"stay_open whether leave connection opened","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"dimension array","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-get-type-","dir":"Reference","previous_headings":"","what":"Method get_type()","title":"Lazy 'HDF5' file loader — LazyH5","text":"get data type","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$get_type(stay_open = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"stay_open whether leave connection opened","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"data type, currently character, integer, raw, double, complex available, types yield \"unknown\"","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates a NWBHDF5IO file container — NWBHDF5IO","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Class definition 'PyNWB' container; use read_nwb construction function.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"opened Whether container opened.","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"NWBHDF5IO$new() NWBHDF5IO$get_handler() NWBHDF5IO$open() NWBHDF5IO$close() NWBHDF5IO$close_linked_files() NWBHDF5IO$read() NWBHDF5IO$() NWBHDF5IO$clone()","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Initialize class","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$new(path = NULL, mode = c(\"r\", \"w\", \"r+\", \"a\", \"w-\", \"x\"), ...)"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"path Path '.nwb' file mode Mode opening file ... parameters passed nwb$NWBHDF5IO","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-get-handler-","dir":"Reference","previous_headings":"","what":"Method get_handler()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Get internal file handler. Please make sure close handler correctly.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$get_handler()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"File handler, .e. 'PyNWB' NWBHDF5IO instance.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-open-","dir":"Reference","previous_headings":"","what":"Method open()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Open connections, must used together $close method. high-level method, see $","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$open()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"container ","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"\\dontrun{ # low-level method to open NWB file, for safer methods, see # `container$with()` below container$open() data <- container$read() # process data... # Make sure the container is closed! container$close() }"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-close-","dir":"Reference","previous_headings":"","what":"Method close()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Close connections (low-level method, see '' method )","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$close(close_links = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"close_links Whether close files linked file; default true","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Nothing","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-close-linked-files-","dir":"Reference","previous_headings":"","what":"Method close_linked_files()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Close opened, linked-files. 'MacOS' 'Linux' automatically release linked-file linking file closed, 'Windows' , prevents linked-file deleted truncated. Use method close opened, linked-files.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$close_linked_files()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Nothing","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-read-","dir":"Reference","previous_headings":"","what":"Method read()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Read 'NWB' file 'IO' source. Please use along '$' method","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$read()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"'NWBFile' container","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-with-","dir":"Reference","previous_headings":"","what":"Method with()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Safe wrapper reading handling 'NWB' file. See class examples.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$with(expr, quoted = FALSE, envir = parent.frame())"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"expr R expression evaluate quoted Whether expr quoted; default false envir environment expr evaluate; default parent frame (see parent.frame)","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Whatever results generated expr","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"examples-1","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"\\dontrun{ container$with({ data <- container$read() # process data }) }"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"objects class cloneable method.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$clone(deep = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"deep Whether make deep clone.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"if (FALSE) { # \\dontrun{ # Running this example requires a .nwb file library(rnwb) container <- NWBHDF5IO$new(path = file) container$with({ data <- container$read() electrode_table <- data$electrodes[convert = TRUE] }) print(electrode_table) } # } ## ------------------------------------------------ ## Method `NWBHDF5IO$open` ## ------------------------------------------------ if (FALSE) { # \\dontrun{ # low-level method to open NWB file, for safer methods, see # `container$with()` below container$open() data <- container$read() # process data... # Make sure the container is closed! container$close() } # } ## ------------------------------------------------ ## Method `NWBHDF5IO$with` ## ------------------------------------------------ if (FALSE) { # \\dontrun{ container$with({ data <- container$read() # process data }) } # }"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":null,"dir":"Reference","previous_headings":"","what":"Class definition for signal cache — SignalDataCache","title":"Class definition for signal cache — SignalDataCache","text":"class internal abstract class","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Class definition for signal cache — SignalDataCache","text":"SignalDataCache$get_header() SignalDataCache$get_annotations() SignalDataCache$get_channel_table() SignalDataCache$get_channel() SignalDataCache$delete()","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-header-","dir":"Reference","previous_headings":"","what":"Method get_header()","title":"Class definition for signal cache — SignalDataCache","text":"Get header information, often small list object","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_header(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-annotations-","dir":"Reference","previous_headings":"","what":"Method get_annotations()","title":"Class definition for signal cache — SignalDataCache","text":"Get annotation information, often large table","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_annotations(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-channel-table-","dir":"Reference","previous_headings":"","what":"Method get_channel_table()","title":"Class definition for signal cache — SignalDataCache","text":"Get channel table","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_channel_table(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-channel-","dir":"Reference","previous_headings":"","what":"Method get_channel()","title":"Class definition for signal cache — SignalDataCache","text":"Get channel data","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_channel(x, ...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"x channel order label ... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Class definition for signal cache — SignalDataCache","text":"Channel signal time-stamps inheriting class 'ieegio_get_channel'","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-delete-","dir":"Reference","previous_headings":"","what":"Method delete()","title":"Class definition for signal cache — SignalDataCache","text":"Delete file cache","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$delete(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download sample files — ieegio_sample_data","title":"Download sample files — ieegio_sample_data","text":"Download sample files","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download sample files — ieegio_sample_data","text":"","code":"ieegio_sample_data(file, test = FALSE, cache_ok = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download sample files — ieegio_sample_data","text":"file file download; set NULL view possible files test test whether sample file exists instead downloading ; default FALSE cache_ok whether use cache","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download sample files — ieegio_sample_data","text":"test false, returns downloaded file path (character); test true, returns whether expected sample exists (logical).","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download sample files — ieegio_sample_data","text":"","code":"# list available files ieegio_sample_data() #> Available sample files: #> #> - bci2k.dat #> - brain.demosubject.mgz #> - brain.demosubject.nii.gz #> - brainvis.dat #> - brainvis.vhdr #> - brainvis.vmrk #> - edfPlusD.edf #> - gifti/ASCII/fmri_sujet01_Lwhite_projection.time.gii #> - gifti/ASCII/sujet01_Lwhite.inflated.surf.gii #> - gifti/ASCII/sujet01_Lwhite.shape.gii #> - gifti/ASCII/sujet01_Lwhite.surf.gii #> - gifti/Base64/fmri_sujet01_Lwhite_projection.time.gii #> - gifti/Base64/sujet01_Lwhite.inflated.surf.gii #> - gifti/Base64/sujet01_Lwhite.shape.gii #> - gifti/Base64/sujet01_Lwhite.surf.gii #> - gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii #> - gifti/GzipBase64/sujet01_Lwhite.inflated.surf.gii #> - gifti/GzipBase64/sujet01_Lwhite.shape.gii #> - gifti/GzipBase64/sujet01_Lwhite.surf.gii #> - gifti/icosahedron3d/geometry.gii #> - gifti/icosahedron3d/rand.curv #> - gifti/icosahedron3d/rand.gii #> - gifti/icosahedron3d/ts.gii #> - mat_v73.mat #> - nwb_sample.nwb #> - placeholder #> # check if file edfPlusD.edf exists ieegio_sample_data(\"edfPlusD.edf\", test = TRUE) #> /home/runner/.cache/R/ieegio/sample_data/edfPlusD.edf #> FALSE if (FALSE) { # \\dontrun{ ieegio_sample_data(\"edfPlusD.edf\") } # }"},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and write surface files — imaging-surface","title":"Read and write surface files — imaging-surface","text":"Supports surface geometry, annotation, measurement, time-series data. Please use high-level function read_surface, calls low-level functions internally.","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and write surface files — imaging-surface","text":"","code":"read_surface(file, format = \"auto\", type = NULL, ...) write_surface( x, con, format = c(\"gifti\", \"freesurfer\"), type = c(\"geometry\", \"annotations\", \"measurements\", \"color\", \"time_series\"), ... ) io_read_fs( file, type = c(\"geometry\", \"annotations\", \"measurements\"), format = \"auto\", name = basename(file), ... ) io_read_gii(file) io_write_gii(x, con, ...)"},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and write surface files — imaging-surface","text":"file, con path file format format file, see 'Arguments' section read.fs.surface (file type 'geometry') read.fs.curv (file type 'measurements') type type data; ignored file format 'GIfTI'. 'FreeSurfer' files, supported types 'geometry' contains positions mesh vertex nodes face indices; 'annotations' annotation file (usually file extension 'annot') containing color look-table array color keys. files used display discrete values surface brain atlas; 'measurements' measurement file 'sulc' 'curv' files, containing numerical values (often continuous domain) vertex node ... read_surface, arguments passed io_read_fs file 'FreeSurfer' file. x surface (geometry, annotation, measurement) data name name data; default file name","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and write surface files — imaging-surface","text":"surface object container","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and write surface files — imaging-surface","text":"","code":"library(ieegio) # geometry geom_file <- \"gifti/GzipBase64/sujet01_Lwhite.surf.gii\" # measurements shape_file <- \"gifti/GzipBase64/sujet01_Lwhite.shape.gii\" # time series ts_file <- \"gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii\" if(ieegio_sample_data(geom_file, test = TRUE)) { geometry <- read_surface(ieegio_sample_data(geom_file)) print(geometry) measurement <- read_surface(ieegio_sample_data(shape_file)) print(measurement) time_series <- read_surface(ieegio_sample_data(ts_file)) print(time_series) # merge measurement & time_series into geometry merged <- merge(geometry, measurement, time_series) print(merged) # make sure you install `rgl` package plot(merged, name = c(\"measurements\", \"Shape001\")) plot(merged, name = \"time_series\", slice_index = c(1, 11, 21, 31)) }"},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and write volume data — imaging-volume","title":"Read and write volume data — imaging-volume","text":"Read write volume data ('MRI', 'CT', etc.) 'NIfTI' 'MGH' formats. Please use read_volume write_volume high-level function. functions call low-level functions internally.","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and write volume data — imaging-volume","text":"","code":"read_volume(file, header_only = FALSE, format = c(\"auto\", \"nifti\", \"mgh\"), ...) write_volume(x, con, format = c(\"auto\", \"nifti\", \"mgh\"), ...) io_read_mgz(file, header_only = FALSE) io_write_mgz(x, con, ...) # S3 method for class 'ieegio_volume' io_write_mgz(x, con, ...) # S3 method for class 'ieegio_mgh' io_write_mgz(x, con, ...) # S3 method for class 'nifti' io_write_mgz(x, con, ...) # S3 method for class 'niftiImage' io_write_mgz(x, con, ...) # S3 method for class 'ants.core.ants_image.ANTsImage' io_write_mgz(x, con, ...) # S3 method for class 'array' io_write_mgz(x, con, vox2ras = NULL, ...) io_read_nii( file, method = c(\"oro\", \"rnifti\", \"ants\"), header_only = FALSE, ... ) io_write_nii(x, con, ...) # S3 method for class 'array' io_write_nii(x, con, vox2ras = NULL, ...)"},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Read and write volume data — imaging-volume","text":"format file; default auto-detection, choices 'nifti' 'mgh';","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and write volume data — imaging-volume","text":"file file path read volume data header_only whether read header data ; default FALSE format format file written; choices 'auto', 'nifti' 'mgh'; default 'auto' detect format based file names, save 'MGH' file file extension 'mgz' 'mgh', otherwise 'NIfTI' format. recommend explicitly setting argument ... passed methods x volume data ('NIfTI' image, array, 'MGH') saved con file path store image vox2ras 4x4 transform matrix voxel indexing (column, row, slice) scanner (often 'T1-weighted' image) 'RAS' (right-anterior-superior) coordinate method method read file; choices 'oro' (using readNIfTI), 'rnifti' (using readNifti), 'ants' (using as_ANTsImage).","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and write volume data — imaging-volume","text":"imaging readers return ieegio_volume objects.","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and write volume data — imaging-volume","text":"","code":"library(ieegio) nifti_file <- \"brain.demosubject.nii.gz\" # Use `ieegio_sample_data(nifti_file)` # to download sample data if( ieegio_sample_data(nifti_file, test = TRUE) ) { # ---- NIfTI examples --------------------------------------------- file <- ieegio_sample_data(nifti_file) # basic read vol <- read_volume(file) # voxel to scanner RAS vol$transforms$vox2ras # to freesurfer surface vol$transforms$vox2ras_tkr # to FSL vol$transforms$vox2fsl image(vol$data[,,128], asp = 1, axes = FALSE) # ---- using other methods -------------------------------------- # default vol <- read_volume(file, method = \"oro\", format = \"nifti\") vol$header # lazy-load nifti vol2 <- read_volume(file, method = \"rnifti\", format = \"nifti\") vol2$header # Using ANTsPyx vol3 <- read_volume(file, method = \"ants\", format = \"nifti\") vol3$header # ---- write -------------------------------------------------------- # write as NIfTI f <- tempfile(fileext = \".nii.gz\") write_volume(vol, f, format = \"nifti\") # alternative method write_volume(vol$header, f, format = \"nifti\") # write to mgz/mgh f2 <- tempfile(fileext = \".mgz\") write_volume(vol, f, format = \"mgh\") # clean up unlink(f) unlink(f2) }"},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":null,"dir":"Reference","previous_headings":"","what":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"Check whether 'HDF5' file can opened read/write","code":""},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"","code":"io_h5_valid(file, mode = c(\"r\", \"w\"), close_all = FALSE) io_h5_names(file)"},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"file path file mode 'r' read access 'w' write access close_all whether close connections just close current connection; default false. Set TRUE want close connections file","code":""},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"io_h5_valid returns logical value indicating whether file can opened. io_h5_names returns character vector dataset names.","code":""},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"","code":"x <- array(1:27, c(3,3,3)) f <- tempfile() # No data written to the file, hence invalid io_h5_valid(f, 'r') #> [1] FALSE io_write_h5(x, f, 'dset') #> {private$file} => {private$name} (Dataset Created) #> {private$file} => {private$name} (Dataset Removed) #> {private$file} => {private$name} (Dataset Created) io_h5_valid(f, 'w') #> [1] TRUE # Open the file and hold a connection ptr <- hdf5r::H5File$new(filename = f, mode = 'w') # Can read, but cannot write io_h5_valid(f, 'r') # TRUE #> [1] TRUE io_h5_valid(f, 'w') # FALSE #> [1] FALSE # However, this can be reset via `close_all=TRUE` io_h5_valid(f, 'r', close_all = TRUE) #> [1] TRUE io_h5_valid(f, 'w') # TRUE #> [1] TRUE # Now the connection is no longer valid ptr #> Class: H5File #> ID: Object invalid # clean up unlink(f)"},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":null,"dir":"Reference","previous_headings":"","what":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"Wrapper class LazyH5, load data \"lazy\" mode - read part dataset needed.","code":""},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"","code":"io_read_h5(file, name, read_only = TRUE, ram = FALSE, quiet = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"file 'HDF5' file name group/data_name path dataset (H5D data) read_only used ram=FALSE, whether returned LazyH5 instance read ram load data memory immediately, default false quiet whether suppress messages","code":""},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"ram true, return data arrays, otherwise return LazyH5 instance.","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"","code":"file <- tempfile() x <- array(1:120, dim = c(4,5,6)) # save x to file with name /group/dataset/1 io_write_h5(x, file, '/group/dataset/1', quiet = TRUE) # read data y <- io_read_h5(file, '/group/dataset/1', ram = TRUE) class(y) # array #> [1] \"array\" z <- io_read_h5(file, '/group/dataset/1', ram = FALSE) class(z) # LazyH5 #> [1] \"LazyH5\" \"R6\" dim(z) #> [1] 4 5 6 # clean up unlink(file)"},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":null,"dir":"Reference","previous_headings":"","what":"Save objects to 'HDF5' file without trivial checks — io_write_h5","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"Save objects 'HDF5' file without trivial checks","code":""},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"","code":"io_write_h5( x, file, name, chunk = \"auto\", level = 4, replace = TRUE, new_file = FALSE, ctype = NULL, quiet = FALSE, ... )"},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"x array, matrix, vector file path 'HDF5' file name path/name data; example, \"group/data_name\" chunk chunk size level compress level 0 - compression 10 - max compression replace data replaced exists new_file removing file old one exists ctype data type \"character\", \"integer\", \"numeric\". set NULL automatically detect types. Note complex data please store separately real imaginary parts. quiet whether suppress messages, default false ... passed LazyH5$save","code":""},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"Absolute path file saved","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"","code":"file <- tempfile() x <- array(1:120, dim = 2:5) # save x to file with name /group/dataset/1 io_write_h5(x, file, '/group/dataset/1', chunk = dim(x)) #> {private$file} => {nm} (Group Created) #> {private$file} => {nm} (Group Created) #> {private$file} => {private$name} (Dataset Created) #> {private$file} => {private$name} (Dataset Removed) #> {private$file} => {private$name} (Dataset Created) # load data y <- io_read_h5(file, '/group/dataset/1') # read data to memory y[] #> , , 1, 1 #> #> [,1] [,2] [,3] #> [1,] 1 3 5 #> [2,] 2 4 6 #> #> , , 2, 1 #> #> [,1] [,2] [,3] #> [1,] 7 9 11 #> [2,] 8 10 12 #> #> , , 3, 1 #> #> [,1] [,2] [,3] #> [1,] 13 15 17 #> [2,] 14 16 18 #> #> , , 4, 1 #> #> [,1] [,2] [,3] #> [1,] 19 21 23 #> [2,] 20 22 24 #> #> , , 1, 2 #> #> [,1] [,2] [,3] #> [1,] 25 27 29 #> [2,] 26 28 30 #> #> , , 2, 2 #> #> [,1] [,2] [,3] #> [1,] 31 33 35 #> [2,] 32 34 36 #> #> , , 3, 2 #> #> [,1] [,2] [,3] #> [1,] 37 39 41 #> [2,] 38 40 42 #> #> , , 4, 2 #> #> [,1] [,2] [,3] #> [1,] 43 45 47 #> [2,] 44 46 48 #> #> , , 1, 3 #> #> [,1] [,2] [,3] #> [1,] 49 51 53 #> [2,] 50 52 54 #> #> , , 2, 3 #> #> [,1] [,2] [,3] #> [1,] 55 57 59 #> [2,] 56 58 60 #> #> , , 3, 3 #> #> [,1] [,2] [,3] #> [1,] 61 63 65 #> [2,] 62 64 66 #> #> , , 4, 3 #> #> [,1] [,2] [,3] #> [1,] 67 69 71 #> [2,] 68 70 72 #> #> , , 1, 4 #> #> [,1] [,2] [,3] #> [1,] 73 75 77 #> [2,] 74 76 78 #> #> , , 2, 4 #> #> [,1] [,2] [,3] #> [1,] 79 81 83 #> [2,] 80 82 84 #> #> , , 3, 4 #> #> [,1] [,2] [,3] #> [1,] 85 87 89 #> [2,] 86 88 90 #> #> , , 4, 4 #> #> [,1] [,2] [,3] #> [1,] 91 93 95 #> [2,] 92 94 96 #> #> , , 1, 5 #> #> [,1] [,2] [,3] #> [1,] 97 99 101 #> [2,] 98 100 102 #> #> , , 2, 5 #> #> [,1] [,2] [,3] #> [1,] 103 105 107 #> [2,] 104 106 108 #> #> , , 3, 5 #> #> [,1] [,2] [,3] #> [1,] 109 111 113 #> [2,] 110 112 114 #> #> , , 4, 5 #> #> [,1] [,2] [,3] #> [1,] 115 117 119 #> [2,] 116 118 120 #> # clean up unlink(file)"},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":null,"dir":"Reference","previous_headings":"","what":"Low-level file read and write — low-level-read-write","title":"Low-level file read and write — low-level-read-write","text":"Interfaces read write files common formats.","code":""},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Low-level file read and write — low-level-read-write","text":"","code":"io_read_fst( con, method = c(\"proxy\", \"data_table\", \"data_frame\", \"header_only\"), ..., old_format = FALSE ) io_write_fst(x, con, compress = 50, ...) io_read_ini(con, ...) io_read_json(con, ...) io_write_json( x, con = stdout(), ..., digits = ceiling(-log10(.Machine$double.eps)), pretty = TRUE, serialize = TRUE ) io_read_mat( con, method = c(\"auto\", \"R.matlab\", \"pymatreader\", \"mat73\"), verbose = TRUE, on_convert_error = c(\"warning\", \"error\", \"ignore\"), ... ) io_write_mat(x, con, method = c(\"R.matlab\", \"scipy\"), ...) io_read_yaml(con, ...) io_write_yaml(x, con, ..., sorted = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Low-level file read and write — low-level-read-write","text":"con connection file method method read table. 'fst', choices 'proxy' read data memory, query table needed; 'data_table' read data.table; 'data_frame' read data.frame; 'header_only' read 'fst' table header. 'mat', choices 'auto' automatically try native option, 'pymatreader' fails; 'R.matlab' use native method (provided readMat); support 'MAT 5.0' format; 'pymatreader' use 'Python' library 'pymatreader'; 'mat73' use 'Python' library 'mat73'. ... passed internal function calls old_format see fst x data write disk compress compress level 0 100; default 50 digits, pretty writing numeric values 'json' format serialize set TRUE serialize data 'json' format (data types, default); FALSE save values without types verbose whether print process on_convert_error reading 'mat' files 'Python' modules, results converted R objects end. objects can converted. input defines behavior conversion fails; choices \"error\", \"warning\", \"ignore\" sorted whether sort list; default FALSE","code":""},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Low-level file read and write — low-level-read-write","text":"reader functions returns data extracted files, mostly R objects, exceptions 'Matlab' files. reading 'Matlab' file requires using 'Python' modules, io_read_mat try best effort convert 'Python' objects R. However, conversion might fail. case, result might partially contain 'Python' objects warnings.","code":""},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Low-level file read and write — low-level-read-write","text":"","code":"# ---- fst ---------------------------------------------------------------- f <- tempfile(fileext = \".fst\") x <- data.frame( a = 1:10, b = rnorm(10), c = letters[1:10] ) io_write_fst(x, con = f) # default reads in proxy io_read_fst(f) #> #> 10 rows, 3 columns (file18b336e070b8.fst) #> #> a b c #> #> 1 1 -1.400043517 a #> 2 2 0.255317055 b #> 3 3 -2.437263611 c #> 4 4 -0.005571287 d #> 5 5 0.621552721 e #> 6 6 1.148411606 f #> 7 7 -1.821817661 g #> 8 8 -0.247325302 h #> 9 9 -0.244199607 i #> 10 10 -0.282705449 j # load as data.table io_read_fst(f, \"data_table\") #> a b c #> #> 1: 1 -1.400043517 a #> 2: 2 0.255317055 b #> 3: 3 -2.437263611 c #> 4: 4 -0.005571287 d #> 5: 5 0.621552721 e #> 6: 6 1.148411606 f #> 7: 7 -1.821817661 g #> 8: 8 -0.247325302 h #> 9: 9 -0.244199607 i #> 10: 10 -0.282705449 j # load as data.frame io_read_fst(f, \"data_frame\") #> a b c #> 1 1 -1.400043517 a #> 2 2 0.255317055 b #> 3 3 -2.437263611 c #> 4 4 -0.005571287 d #> 5 5 0.621552721 e #> 6 6 1.148411606 f #> 7 7 -1.821817661 g #> 8 8 -0.247325302 h #> 9 9 -0.244199607 i #> 10 10 -0.282705449 j # get header io_read_fst(f, \"header_only\") #> #> 10 rows, 3 columns (file18b336e070b8.fst) #> #> * 'a': integer #> * 'b': double #> * 'c': character # clean up unlink(f) # ---- json --------------------------------------------------------------- f <- tempfile(fileext = \".json\") x <- list(a = 1L, b = 2.3, c = \"a\", d = 1+1i) # default is serialize io_write_json(x, f) io_read_json(f) #> $a #> [1] 1 #> #> $b #> [1] 2.3 #> #> $c #> [1] \"a\" #> #> $d #> [1] 1+1i #> cat(readLines(f), sep = \"\\n\") #> { #> \"type\": \"list\", #> \"attributes\": { #> \"names\": { #> \"type\": \"character\", #> \"attributes\": {}, #> \"value\": [\"a\", \"b\", \"c\", \"d\"] #> } #> }, #> \"value\": [ #> { #> \"type\": \"integer\", #> \"attributes\": {}, #> \"value\": [1] #> }, #> { #> \"type\": \"double\", #> \"attributes\": {}, #> \"value\": [2.2999999999999998] #> }, #> { #> \"type\": \"character\", #> \"attributes\": {}, #> \"value\": [\"a\"] #> }, #> { #> \"type\": \"complex\", #> \"attributes\": {}, #> \"value\": [\"1+1i\"] #> } #> ] #> } # just values io_write_json(x, f, serialize = FALSE, pretty = FALSE) io_read_json(f) #> $a #> [1] 1 #> #> $b #> [1] 2.3 #> #> $c #> [1] \"a\" #> #> $d #> [1] \"1+1i\" #> cat(readLines(f), sep = \"\\n\") #> {\"a\":[1],\"b\":[2.2999999999999998],\"c\":[\"a\"],\"d\":[\"1+1i\"]} # clean up unlink(f) # ---- Matlab .mat -------------------------------------------------------- if (FALSE) { # \\dontrun{ f <- tempfile(fileext = \".mat\") x <- list(a = 1L, b = 2.3, c = \"a\", d = 1+1i) # save as MAT 5.0 io_write_mat(x, f) io_read_mat(f) # require setting up Python environment io_read_mat(f, method = \"pymatreader\") # MAT 7.3 example sample_data <- ieegio_sample_data(\"mat_v73.mat\") io_read_mat(sample_data) # clean up unlink(f) } # } # ---- yaml --------------------------------------------------------------- f <- tempfile(fileext = \".yaml\") x <- list(a = 1L, b = 2.3, c = \"a\") io_write_yaml(x, f) io_read_yaml(f) #> $a #> [1] 1 #> #> $b #> [1] 2.3 #> #> $c #> [1] \"a\" #> # clean up unlink(f)"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot '3D' surface objects — plot.ieegio_surface","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"Plot '3D' surface objects","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"","code":"# S3 method for class 'ieegio_surface' plot( x, method = c(\"basic\", \"full\"), transform = 1L, name = \"auto\", vlim = NULL, col = c(\"black\", \"white\"), slice_index = NULL, ... )"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"x 'ieegio_surface' object, see read_surface method plot method; 'basic' just rendering surfaces; 'full' rendering axes title transform transform use, can 4--4 matrix; surface contains transform matrix, argument can integer index transform embedded, target (transformed) space name; print names(x$transforms) choices name attribute name used colors, options can 'color' surface color matrix; c('annotations', varname) rendering colors annotations variable varname; c('measurements', varname) rendering colors measurements variable varname; 'time_series' plotting time series slices; \"flat\" flat color; default 'auto', plot first available data. details see 'Examples'. vlim plotting continuous data (name measurements time-series), value limit used generate color palette; default NULL: range values. argument can length 1 ( creating symmetric value range) 2. set, values exceeding range trimmed limit col color colors form color palette value data continuous; name=\"flat\", last color used slice_index plotting name=\"time_series\" data, slice indices plot; default select maximum 4 slices ... ignored","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"","code":"library(ieegio) # geometry geom_file <- \"gifti/GzipBase64/sujet01_Lwhite.surf.gii\" # measurements shape_file <- \"gifti/GzipBase64/sujet01_Lwhite.shape.gii\" # time series ts_file <- \"gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii\" if(ieegio_sample_data(geom_file, test = TRUE)) { geometry <- read_surface(ieegio_sample_data(geom_file)) measurement <- read_surface(ieegio_sample_data(shape_file)) time_series <- read_surface(ieegio_sample_data(ts_file)) ts_demean <- apply( time_series$time_series$value, MARGIN = 1L, FUN = function(x) { x - mean(x) } ) time_series$time_series$value <- t(ts_demean) # merge measurement & time_series into geometry (optional) merged <- merge(geometry, measurement, time_series) print(merged) # ---- plot method/style ------------------------------------ plot(merged, \"basic\") plot(merged, \"full\") # ---- plot data -------------------------------------------- ## Measurements or annotations # the first column of `measurements` plot(merged, name = \"measurements\") # equivalent to plot(merged, name = list(\"measurements\", 1L)) # equivalent to measurement_names <- names(merged$measurements$data_table) plot(merged, name = list(\"measurements\", measurement_names[[1]])) ## Time-series # automatically select 4 slices, trim the color palette # from -25 to 25 plot(merged, name = \"time_series\", vlim = c(-25, 25)) plot( merged, name = \"time_series\", vlim = c(-25, 25), slice_index = c(1, 17, 33, 49, 64, 80, 96, 112, 128), col = c(\"#053061\", \"#2166ac\", \"#4393c3\", \"#92c5de\", \"#d1e5f0\", \"#ffffff\", \"#fddbc7\", \"#f4a582\", \"#d6604d\", \"#b2182b\", \"#67001f\") ) }"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"Plot '3D' volume anatomical slices","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"","code":"# S3 method for class 'ieegio_volume' plot( x, position = c(0, 0, 0), center_position = FALSE, which = c(\"coronal\", \"axial\", \"sagittal\"), slice_index = 1L, transform = \"vox2ras\", zoom = 1, pixel_width = max(zoom/2, 1), crosshair_gap = 4, crosshair_lty = 2, col = c(\"black\", \"white\"), crosshair_col = \"#00FF00A0\", continuous = TRUE, vlim = NULL, add = FALSE, main = \"\", axes = FALSE, background = col[[1]], foreground = col[[length(col)]], ..., .xdata = x$data )"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"x 'ieegio_volume' object; see read_volume position cross-hair focused position center_position whether center canvas position, default FALSE slice plot; choices \"coronal\", \"axial\", \"sagittal\" slice_index length 1: x fourth dimension (e.g. 'fMRI'), slice index draw transform transform apply, can 4--4 matrix, integer name indicating matrix x$transforms; needs transform matrix voxel index 'RAS' (right-anterior-superior coordinate system), often called 'xform', 'sform', 'qform' 'NIfTI' terms, 'Norig' 'FreeSurfer' zoom zoom-level pixel_width pixel size, ranging 0.05 50; default half zoom 1, whichever greater; unit pixel_width divided zoom milliliter crosshair_gap cross-hair gap milliliter crosshair_lty cross-hair line type col color palette continuous x values crosshair_col cross-hair color; set NA hide continuous reserved vlim range limit data; default computed range x$data; data values exceeding range trimmed add whether add plot existing underlay; default FALSE main, ... passed image axes whether draw axes; default FALSE background, foreground background foreground colors; default first last elements col .xdata default x$data, used speed calculation multiple different angles plotted","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"","code":"library(ieegio) nifti_file <- \"brain.demosubject.nii.gz\" # Use `ieegio_sample_data(nifti_file)` # to download sample data if( ieegio_sample_data(nifti_file, test = TRUE) ) { # ---- NIfTI examples --------------------------------------------- file <- ieegio_sample_data(nifti_file) # basic read vol <- read_volume(file) par(mfrow = c(1, 3), mar = c(0, 0, 3.1, 0)) ras_position <- c(-50, -10, 15) ras_str <- paste(sprintf(\"%.0f\", ras_position), collapse = \",\") for(which in c(\"coronal\", \"axial\", \"sagittal\")) { plot(x = vol, position = ras_position, crosshair_gap = 10, crosshair_lty = 2, zoom = 3, which = which, main = sprintf(\"%s T1RAS=[%s]\", which, ras_str)) } }"},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":null,"dir":"Reference","previous_headings":"","what":"Install 'NWB' via 'pynwb' — pynwb_module","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"Install 'NWB' via 'pynwb'","code":""},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"","code":"install_pynwb(python_ver = \"auto\", verbose = TRUE) pynwb_module(force = FALSE, error_if_missing = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"python_ver 'Python' version, see configure_conda; default \"auto\", suggested verbose whether print installation messages force whether force-reload module error_if_missing whether raise errors module fails load; default true","code":""},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"'Python' module pynwb.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'BCI2000' data file — read_bci2000","title":"Read 'BCI2000' data file — read_bci2000","text":"Read 'BCI2000' data file","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'BCI2000' data file — read_bci2000","text":"","code":"read_bci2000( file, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'BCI2000' data file — read_bci2000","text":"file file path data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'BCI2000' data file — read_bci2000","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'BCI2000' data file — read_bci2000","text":"","code":"if( ieegio_sample_data(\"bci2k.dat\", test = TRUE) ) { file <- ieegio_sample_data(\"bci2k.dat\") x <- read_bci2000(file) print(x) channel <- x$get_channel(1) plot( channel$time, channel$value, type = \"l\", main = channel$info$Label, xlab = \"Time\", ylab = channel$info$Unit ) }"},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'BrainVision' data — read_brainvis","title":"Read 'BrainVision' data — read_brainvis","text":"Read 'BrainVision' data","code":""},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'BrainVision' data — read_brainvis","text":"","code":"read_brainvis( file, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'BrainVision' data — read_brainvis","text":"file file path data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'BrainVision' data — read_brainvis","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'BrainVision' data — read_brainvis","text":"","code":"if( ieegio_sample_data(\"brainvis.dat\", test = TRUE) ) { # ensure the header and marker files are downloaded as well ieegio_sample_data(\"brainvis.vhdr\") ieegio_sample_data(\"brainvis.dat\") file <- ieegio_sample_data(\"brainvis.vmrk\") x <- read_brainvis(file) print(x) x$get_header() x$get_channel_table() x$get_annotations() channel <- x$get_channel(10) plot( channel$time, channel$value, type = \"l\", main = channel$info$Label, xlab = \"Time\", ylab = channel$info$Unit ) }"},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'EDF' or 'BDF' data file — read_edf","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"Read 'EDF' 'BDF' data file","code":""},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"","code":"read_edf( con, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, begin = 0, end = Inf, convert = TRUE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"con file connection data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. begin, end begin end data read convert whether convert digital numbers analog signals; default TRUE verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"","code":"# ---- EDF/BDF(+) --------------------------------------------------------- # Run `ieegio_sample_data(\"edfPlusD.edf\")` to download sample data # Tun example if the sample data exists if(ieegio_sample_data(\"edfPlusD.edf\", test = TRUE)) { edf_path <- ieegio_sample_data(\"edfPlusD.edf\") data <- read_edf(edf_path) data$get_header() data$get_annotations() data$get_channel_table() channel <- data$get_channel(1) plot( channel$time, channel$value, type = \"l\", main = channel$info$Label, xlab = \"Time\", ylab = channel$info$Unit ) }"},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":null,"dir":"Reference","previous_headings":"","what":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"Read ('BlackRock') 'NEV' 'NSx' data","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"","code":"read_nsx( file, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, include_waveform = FALSE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"file file path data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. include_waveform whether include 'waveform' data (usually online spike sorting); default FALSE verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'NWB' format — read_nwb","title":"Read 'NWB' format — read_nwb","text":"Life cycle: experimental. Read \"Neurodata Without Borders\" ('NWB' format) file. Unlike readers read_nwb returns low-level 'Python' class handler via pynwb module.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'NWB' format — read_nwb","text":"","code":"read_nwb(file, mode = c(\"r\", \"w\", \"r+\", \"a\", \"w-\", \"x\"), ...)"},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'NWB' format — read_nwb","text":"file path 'NWB' file mode file open mode; default 'r' (read-) ... passed NWBHDF5IO initialize function","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'NWB' format — read_nwb","text":"NWBHDF5IO instance","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'NWB' format — read_nwb","text":"","code":"if(ieegio_sample_data(\"nwb_sample.nwb\", test = TRUE)) { file <- ieegio_sample_data(\"nwb_sample.nwb\") # Create NWBIO container container <- read_nwb(file) # Open connection container$open() # read meta data data <- container$read() data # get `test_timeseries` data ts_data <- data$get_acquisition(\"test_timeseries\") ts_data # read timeseries data into memory ts_arr <- ts_data$data[] ts_arr # Convert Python array to R # using `rpymat::py_to_r(ts_arr)` or as.numeric(ts_arr) # Make sure you close the connection container$close() } # Requires setting up Python environment # run `ieegio::install_pynwb()` to set up environment first if (FALSE) { # \\dontrun{ # Replicating tutorial # https://pynwb.readthedocs.io/en/stable/tutorials/general/plot_file.html library(rpymat) # Load Python module pynwb <- import(\"pynwb\") uuid <- import(\"uuid\") datetime <- import(\"datetime\") np <- import(\"numpy\") tz <- import(\"dateutil.tz\") # 2018L is 2018 as integer session_start_time <- datetime$datetime( 2018L, 4L, 25L, 2L, 30L, 3L, tzinfo=tz$gettz(\"US/Pacific\")) # ---- Create NWB file object ------------------------ nwbfile <- pynwb$NWBFile( session_description=\"Mouse exploring a closed field\", identifier=py_str(uuid$uuid4()), session_start_time=session_start_time, session_id=\"session_4321\", experimenter=py_list(c(\"Baggins, Frodo\")), lab=\"Bag End Laboratory\", institution=\"University of Middle Earth at the Shire\", experiment_description=\"Thank you Bilbo Baggins.\", keywords=py_list(c(\"behavior\", \"exploration\")) ) # ---- Add subject ------------------------------------ subject <- pynwb$file$Subject( subject_id=\"001\", age=\"P90D\", description=\"mouse 5\", species=\"Mus musculus\", sex=\"M\" ) nwbfile$subject <- subject nwbfile # ---- Add TimeSeries ------------------------------------ data <- seq(100, 190, by = 10) time_series_with_rate <- pynwb$TimeSeries( name=\"test_timeseries\", description=\"an example time series\", data=data, unit=\"m\", starting_time=0.0, rate=1.0 ) time_series_with_rate nwbfile$add_acquisition(time_series_with_rate) # ---- New Spatial positions ------------------------------------ position_data <- cbind( seq(0, 10, length.out = 50), seq(0, 9, length.out = 50) ) position_timestamps = seq(0, 49) / 200 spatial_series_obj = pynwb$behavior$SpatialSeries( name=\"SpatialSeries\", description=\"(x,y) position in open field\", data=position_data, timestamps=position_timestamps, reference_frame=\"(0,0) is bottom left corner\", ) spatial_series_obj position_obj = pynwb$behavior$Position( spatial_series=spatial_series_obj) position_obj # ---- Behavior Processing Module ------------------------------ behavior_module <- nwbfile$create_processing_module( name=\"behavior\", description=\"processed behavioral data\" ) behavior_module$add(position_obj) nwbfile$processing$behavior # omit some process # ---- Write --------------------------------------------------- f <- normalizePath(tempfile(fileext = \".nwb\"), winslash = \"/\", mustWork = FALSE) io <- pynwb$NWBHDF5IO(f, mode = \"w\") io$write(nwbfile) io$close() } # }"},{"path":"http://dipterix.org/ieegio/news/index.html","id":"ieegio-001","dir":"Changelog","previous_headings":"","what":"ieegio 0.0.1","title":"ieegio 0.0.1","text":"Initial CRAN submission.","code":""}] +[{"path":"http://dipterix.org/ieegio/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2024 Zhengjia Wang Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://dipterix.org/ieegio/articles/read-imaging-data.html","id":"volume-files","dir":"Articles","previous_headings":"","what":"Volume files","title":"Read imaging data","text":"ieegio::read_volume ieegio::write_volume provides high-level interfaces reading writing volume data MRI, CT. fMRI, etc. volume data (NIfTI, MGH, …) contains header, data, transforms list. transforms contain transforms volume (column, row, slice) index coordinate systems. commonly used one vox2ras, 4x4 matrix mapping voxels scanner (usually T1-weighted) RAS (right-anterior-superior) system. Accessing image values via [ operator. example, Plotting anatomical slices:","code":"volume <- read_volume(nifti_file) volume #> #> Type : rnifti/nifti #> Shape: c(256L, 256L, 256L) #> Transforms: #> vox2ras: #> [-1 0 0 131.6] #> [ 0 0 1 -127.5] #> [ 0 -1 0 127.5] #> [ 0 0 0 1] #> vox2ras_tkr: #> [-1 0 0 -128] #> [ 0 0 1 -128] #> [ 0 -1 0 -128] #> [ 0 0 0 1] #> vox2fsl: #> [1 0 0 0] #> [0 1 0 0] #> [0 0 1 0] #> [0 0 0 1] volume[128, , ] par(mfrow = c(1, 3), mar = c(0, 0, 3.1, 0)) ras_position <- c(-50, -10, 15) ras_str <- paste(sprintf(\"%.0f\", ras_position), collapse = \",\") for(which in c(\"coronal\", \"axial\", \"sagittal\")) { plot(x = volume, position = ras_position, crosshair_gap = 10, crosshair_lty = 2, zoom = 3, which = which, main = sprintf(\"%s T1RAS=[%s]\", which, ras_str)) }"},{"path":"http://dipterix.org/ieegio/articles/read-imaging-data.html","id":"surface-files","dir":"Articles","previous_headings":"","what":"Surface files","title":"Read imaging data","text":"Reading surface file using read_surface supports multiple data types can merge single object, making object multiple embedding data-sets: Plot surfaces 3D viewer, colored shape measurement Plot normalized time-series data","code":"library(ieegio) # geometry geometry <- read_surface(geom_file) # measurements measurement <- read_surface(shape_file) # time series time_series <- read_surface(ts_file) merged <- merge(geometry, measurement, time_series) print(merged) #> #> Header class: gifti #> Geometry : #> # of Vertex : 12 #> # of Face index : 20 #> # of transforms : 1 #> Transform Targets : Unknown #> Measurements: `Shape001` #> Time series: #> # of time points: 4 #> Average slice duration: 1 #> #> Contains: `geometry`, `measurements`, `time_series` # plot the first column in measurements section plot(merged, name = list(\"measurements\", 1)) ts_demean <- apply( merged$time_series$value, MARGIN = 1L, FUN = function(x) { x - mean(x) } ) merged$time_series$value <- t(ts_demean) plot( merged, name = \"time_series\", col = c( \"#053061\", \"#2166ac\", \"#4393c3\", \"#92c5de\", \"#d1e5f0\", \"#ffffff\", \"#fddbc7\", \"#f4a582\", \"#d6604d\", \"#b2182b\", \"#67001f\" ) )"},{"path":"http://dipterix.org/ieegio/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Zhengjia Wang. Author, maintainer.","code":""},{"path":"http://dipterix.org/ieegio/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Wang Z (2024). ieegio: File IO Intracranial Electroencephalography. R package version 0.0.1, http://dipterix.org/ieegio/.","code":"@Manual{, title = {ieegio: File IO for Intracranial Electroencephalography}, author = {Zhengjia Wang}, year = {2024}, note = {R package version 0.0.1}, url = {http://dipterix.org/ieegio/}, }"},{"path":"http://dipterix.org/ieegio/index.html","id":"ieegio-io-toolbox-for-intracranial-electroencephalography","dir":"","previous_headings":"","what":"File IO for Intracranial Electroencephalography","title":"File IO for Intracranial Electroencephalography","text":"goal ieegio provide integrated toolbox common file formats used intracranial Electroencephalography (iEEG) deep-brain stimulation (DBS). Currently package active development.","code":""},{"path":"http://dipterix.org/ieegio/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"File IO for Intracranial Electroencephalography","text":"can install development version ieegio GitHub : ieegio provides additional sample data. download :","code":"# install.packages(\"pak\") pak::pak(\"dipterix/ieegio\") # list all the sample data sample_names <- ieegio::ieegio_sample_data() lapply(sample_names, ieegio::ieegio_sample_data)"},{"path":"http://dipterix.org/ieegio/index.html","id":"list-1-read-formatted-ephys-data-examples","dir":"","previous_headings":"","what":"List 1: read formatted ephys data (examples)","title":"File IO for Intracranial Electroencephalography","text":"following formats () supported. Please feel free make wish-list posting issue repository. Electrophysiology * - NWB format low-level support due format nature. Please see examples help(read_nwb)","code":""},{"path":"http://dipterix.org/ieegio/index.html","id":"list-2-read-imaging-data-examples","dir":"","previous_headings":"","what":"List 2: read imaging data (examples)","title":"File IO for Intracranial Electroencephalography","text":"Imaging","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":null,"dir":"Reference","previous_headings":"","what":"Lazy 'HDF5' file loader — LazyH5","title":"Lazy 'HDF5' file loader — LazyH5","text":"provides hybrid data structure 'HDF5' file","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"public-fields","dir":"Reference","previous_headings":"","what":"Public fields","title":"Lazy 'HDF5' file loader — LazyH5","text":"quiet whether suppress messages","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Lazy 'HDF5' file loader — LazyH5","text":"LazyH5$finalize() LazyH5$print() LazyH5$new() LazyH5$save() LazyH5$open() LazyH5$close() LazyH5$subset() LazyH5$get_dims() LazyH5$get_type()","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-finalize-","dir":"Reference","previous_headings":"","what":"Method finalize()","title":"Lazy 'HDF5' file loader — LazyH5","text":"garbage collection method","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$finalize()"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"none","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-print-","dir":"Reference","previous_headings":"","what":"Method print()","title":"Lazy 'HDF5' file loader — LazyH5","text":"overrides print method","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$print()"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"self instance","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Lazy 'HDF5' file loader — LazyH5","text":"constructor","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$new(file_path, data_name, read_only = FALSE, quiet = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"file_path data stored 'HDF5' format data_name data stored file read_only whether open file read-mode. highly recommended set true, otherwise file connection exclusive. quiet whether suppress messages, default false","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"self instance","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-save-","dir":"Reference","previous_headings":"","what":"Method save()","title":"Lazy 'HDF5' file loader — LazyH5","text":"save data 'HDF5' file","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$save( x, chunk = \"auto\", level = 7, replace = TRUE, new_file = FALSE, force = TRUE, ctype = NULL, size = NULL, ... )"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"x vector, matrix, array chunk chunk size, length matches data dimension level compress level, 1 9 replace data exists file, replace file new_file remove whole file exists writing? force open file read-mode, saving objects file raise error. Use force=TRUE force write data ctype data type, see mode, usually data type x. Try mode(x) storage.mode(x) hints. size deprecated, compatibility issues ... passed self open() method","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-open-","dir":"Reference","previous_headings":"","what":"Method open()","title":"Lazy 'HDF5' file loader — LazyH5","text":"open connection","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$open(new_dataset = FALSE, robj, ...)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"new_dataset used internal pointer closed, write data robj data array save ... passed createDataSet hdf5r package","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-close-","dir":"Reference","previous_headings":"","what":"Method close()","title":"Lazy 'HDF5' file loader — LazyH5","text":"close connection","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$close(all = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"whether close connections associated data file. true, connections, including access programs, closed","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-subset-","dir":"Reference","previous_headings":"","what":"Method subset()","title":"Lazy 'HDF5' file loader — LazyH5","text":"subset data","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$subset(..., drop = FALSE, stream = FALSE, envir = parent.frame())"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"drop whether apply drop subset stream whether read partial data time envir ,j,... expressions, expression evaluated , j, ... index along dimension","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"subset data","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-get-dims-","dir":"Reference","previous_headings":"","what":"Method get_dims()","title":"Lazy 'HDF5' file loader — LazyH5","text":"get data dimension","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$get_dims(stay_open = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-5","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"stay_open whether leave connection opened","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"dimension array","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"method-get-type-","dir":"Reference","previous_headings":"","what":"Method get_type()","title":"Lazy 'HDF5' file loader — LazyH5","text":"get data type","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"usage-8","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy 'HDF5' file loader — LazyH5","text":"","code":"LazyH5$get_type(stay_open = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"arguments-6","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy 'HDF5' file loader — LazyH5","text":"stay_open whether leave connection opened","code":""},{"path":"http://dipterix.org/ieegio/reference/LazyH5.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Lazy 'HDF5' file loader — LazyH5","text":"data type, currently character, integer, raw, double, complex available, types yield \"unknown\"","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":null,"dir":"Reference","previous_headings":"","what":"Creates a NWBHDF5IO file container — NWBHDF5IO","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Class definition 'PyNWB' container; use read_nwb construction function.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"active-bindings","dir":"Reference","previous_headings":"","what":"Active bindings","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"opened Whether container opened.","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"NWBHDF5IO$new() NWBHDF5IO$get_handler() NWBHDF5IO$open() NWBHDF5IO$close() NWBHDF5IO$close_linked_files() NWBHDF5IO$read() NWBHDF5IO$() NWBHDF5IO$clone()","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-new-","dir":"Reference","previous_headings":"","what":"Method new()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Initialize class","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$new(path = NULL, mode = c(\"r\", \"w\", \"r+\", \"a\", \"w-\", \"x\"), ...)"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"path Path '.nwb' file mode Mode opening file ... parameters passed nwb$NWBHDF5IO","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-get-handler-","dir":"Reference","previous_headings":"","what":"Method get_handler()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Get internal file handler. Please make sure close handler correctly.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$get_handler()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"File handler, .e. 'PyNWB' NWBHDF5IO instance.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-open-","dir":"Reference","previous_headings":"","what":"Method open()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Open connections, must used together $close method. high-level method, see $","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$open()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-1","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"container ","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"\\dontrun{ # low-level method to open NWB file, for safer methods, see # `container$with()` below container$open() data <- container$read() # process data... # Make sure the container is closed! container$close() }"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-close-","dir":"Reference","previous_headings":"","what":"Method close()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Close connections (low-level method, see '' method )","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$close(close_links = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"close_links Whether close files linked file; default true","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-2","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Nothing","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-close-linked-files-","dir":"Reference","previous_headings":"","what":"Method close_linked_files()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Close opened, linked-files. 'MacOS' 'Linux' automatically release linked-file linking file closed, 'Windows' , prevents linked-file deleted truncated. Use method close opened, linked-files.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$close_linked_files()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-3","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Nothing","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-read-","dir":"Reference","previous_headings":"","what":"Method read()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Read 'NWB' file 'IO' source. Please use along '$' method","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-5","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$read()"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-4","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"'NWBFile' container","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-with-","dir":"Reference","previous_headings":"","what":"Method with()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Safe wrapper reading handling 'NWB' file. See class examples.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-6","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$with(expr, quoted = FALSE, envir = parent.frame())"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"expr R expression evaluate quoted Whether expr quoted; default false envir environment expr evaluate; default parent frame (see parent.frame)","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"returns-5","dir":"Reference","previous_headings":"","what":"Returns","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"Whatever results generated expr","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"examples-1","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"\\dontrun{ container$with({ data <- container$read() # process data }) }"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"method-clone-","dir":"Reference","previous_headings":"","what":"Method clone()","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"objects class cloneable method.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"usage-7","dir":"Reference","previous_headings":"","what":"Usage","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"NWBHDF5IO$clone(deep = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"deep Whether make deep clone.","code":""},{"path":"http://dipterix.org/ieegio/reference/NWBHDF5IO.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Creates a NWBHDF5IO file container — NWBHDF5IO","text":"","code":"if (FALSE) { # \\dontrun{ # Running this example requires a .nwb file library(rnwb) container <- NWBHDF5IO$new(path = file) container$with({ data <- container$read() electrode_table <- data$electrodes[convert = TRUE] }) print(electrode_table) } # } ## ------------------------------------------------ ## Method `NWBHDF5IO$open` ## ------------------------------------------------ if (FALSE) { # \\dontrun{ # low-level method to open NWB file, for safer methods, see # `container$with()` below container$open() data <- container$read() # process data... # Make sure the container is closed! container$close() } # } ## ------------------------------------------------ ## Method `NWBHDF5IO$with` ## ------------------------------------------------ if (FALSE) { # \\dontrun{ container$with({ data <- container$read() # process data }) } # }"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":null,"dir":"Reference","previous_headings":"","what":"Class definition for signal cache — SignalDataCache","title":"Class definition for signal cache — SignalDataCache","text":"class internal abstract class","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"public-methods","dir":"Reference","previous_headings":"","what":"Public methods","title":"Class definition for signal cache — SignalDataCache","text":"SignalDataCache$get_header() SignalDataCache$get_annotations() SignalDataCache$get_channel_table() SignalDataCache$get_channel() SignalDataCache$delete()","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-header-","dir":"Reference","previous_headings":"","what":"Method get_header()","title":"Class definition for signal cache — SignalDataCache","text":"Get header information, often small list object","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_header(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-annotations-","dir":"Reference","previous_headings":"","what":"Method get_annotations()","title":"Class definition for signal cache — SignalDataCache","text":"Get annotation information, often large table","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-1","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_annotations(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-1","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-channel-table-","dir":"Reference","previous_headings":"","what":"Method get_channel_table()","title":"Class definition for signal cache — SignalDataCache","text":"Get channel table","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-2","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_channel_table(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-2","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-get-channel-","dir":"Reference","previous_headings":"","what":"Method get_channel()","title":"Class definition for signal cache — SignalDataCache","text":"Get channel data","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-3","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$get_channel(x, ...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-3","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"x channel order label ... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"returns","dir":"Reference","previous_headings":"","what":"Returns","title":"Class definition for signal cache — SignalDataCache","text":"Channel signal time-stamps inheriting class 'ieegio_get_channel'","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"method-delete-","dir":"Reference","previous_headings":"","what":"Method delete()","title":"Class definition for signal cache — SignalDataCache","text":"Delete file cache","code":""},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"usage-4","dir":"Reference","previous_headings":"","what":"Usage","title":"Class definition for signal cache — SignalDataCache","text":"","code":"SignalDataCache$delete(...)"},{"path":"http://dipterix.org/ieegio/reference/SignalDataCache.html","id":"arguments-4","dir":"Reference","previous_headings":"","what":"Arguments","title":"Class definition for signal cache — SignalDataCache","text":"... passed child methods","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Download sample files — ieegio_sample_data","title":"Download sample files — ieegio_sample_data","text":"Download sample files","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Download sample files — ieegio_sample_data","text":"","code":"ieegio_sample_data(file, test = FALSE, cache_ok = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Download sample files — ieegio_sample_data","text":"file file download; set NULL view possible files test test whether sample file exists instead downloading ; default FALSE cache_ok whether use cache","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Download sample files — ieegio_sample_data","text":"test false, returns downloaded file path (character); test true, returns whether expected sample exists (logical).","code":""},{"path":"http://dipterix.org/ieegio/reference/ieegio_sample_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Download sample files — ieegio_sample_data","text":"","code":"# list available files ieegio_sample_data() #> Available sample files: #> #> - bci2k.dat #> - brain.demosubject.mgz #> - brain.demosubject.nii.gz #> - brainvis.dat #> - brainvis.vhdr #> - brainvis.vmrk #> - edfPlusD.edf #> - gifti/ASCII/fmri_sujet01_Lwhite_projection.time.gii #> - gifti/ASCII/sujet01_Lwhite.inflated.surf.gii #> - gifti/ASCII/sujet01_Lwhite.shape.gii #> - gifti/ASCII/sujet01_Lwhite.surf.gii #> - gifti/Base64/fmri_sujet01_Lwhite_projection.time.gii #> - gifti/Base64/sujet01_Lwhite.inflated.surf.gii #> - gifti/Base64/sujet01_Lwhite.shape.gii #> - gifti/Base64/sujet01_Lwhite.surf.gii #> - gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii #> - gifti/GzipBase64/sujet01_Lwhite.inflated.surf.gii #> - gifti/GzipBase64/sujet01_Lwhite.shape.gii #> - gifti/GzipBase64/sujet01_Lwhite.surf.gii #> - gifti/icosahedron3d/geometry.gii #> - gifti/icosahedron3d/rand.curv #> - gifti/icosahedron3d/rand.gii #> - gifti/icosahedron3d/ts.gii #> - mat_v73.mat #> - nwb_sample.nwb #> - placeholder #> # check if file edfPlusD.edf exists ieegio_sample_data(\"edfPlusD.edf\", test = TRUE) #> /home/runner/.cache/R/ieegio/sample_data/edfPlusD.edf #> FALSE if (FALSE) { # \\dontrun{ ieegio_sample_data(\"edfPlusD.edf\") } # }"},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and write surface files — imaging-surface","title":"Read and write surface files — imaging-surface","text":"Supports surface geometry, annotation, measurement, time-series data. Please use high-level function read_surface, calls low-level functions internally.","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and write surface files — imaging-surface","text":"","code":"read_surface(file, format = \"auto\", type = NULL, ...) write_surface( x, con, format = c(\"gifti\", \"freesurfer\"), type = c(\"geometry\", \"annotations\", \"measurements\", \"color\", \"time_series\"), ... ) io_read_fs( file, type = c(\"geometry\", \"annotations\", \"measurements\"), format = \"auto\", name = basename(file), ... ) io_read_gii(file) io_write_gii(x, con, ...)"},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and write surface files — imaging-surface","text":"file, con path file format format file, see 'Arguments' section read.fs.surface (file type 'geometry') read.fs.curv (file type 'measurements') type type data; ignored file format 'GIfTI'. 'FreeSurfer' files, supported types 'geometry' contains positions mesh vertex nodes face indices; 'annotations' annotation file (usually file extension 'annot') containing color look-table array color keys. files used display discrete values surface brain atlas; 'measurements' measurement file 'sulc' 'curv' files, containing numerical values (often continuous domain) vertex node ... read_surface, arguments passed io_read_fs file 'FreeSurfer' file. x surface (geometry, annotation, measurement) data name name data; default file name","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and write surface files — imaging-surface","text":"surface object container","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-surface.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and write surface files — imaging-surface","text":"","code":"library(ieegio) # geometry geom_file <- \"gifti/GzipBase64/sujet01_Lwhite.surf.gii\" # measurements shape_file <- \"gifti/GzipBase64/sujet01_Lwhite.shape.gii\" # time series ts_file <- \"gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii\" if(ieegio_sample_data(geom_file, test = TRUE)) { geometry <- read_surface(ieegio_sample_data(geom_file)) print(geometry) measurement <- read_surface(ieegio_sample_data(shape_file)) print(measurement) time_series <- read_surface(ieegio_sample_data(ts_file)) print(time_series) # merge measurement & time_series into geometry merged <- merge(geometry, measurement, time_series) print(merged) # make sure you install `rgl` package plot(merged, name = c(\"measurements\", \"Shape001\")) plot(merged, name = \"time_series\", slice_index = c(1, 11, 21, 31)) }"},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Read and write volume data — imaging-volume","title":"Read and write volume data — imaging-volume","text":"Read write volume data ('MRI', 'CT', etc.) 'NIfTI' 'MGH' formats. Please use read_volume write_volume high-level function. functions call low-level functions internally.","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read and write volume data — imaging-volume","text":"","code":"read_volume(file, header_only = FALSE, format = c(\"auto\", \"nifti\", \"mgh\"), ...) write_volume(x, con, format = c(\"auto\", \"nifti\", \"mgh\"), ...) io_read_mgz(file, header_only = FALSE) io_write_mgz(x, con, ...) # S3 method for class 'ieegio_volume' io_write_mgz(x, con, ...) # S3 method for class 'ieegio_mgh' io_write_mgz(x, con, ...) # S3 method for class 'nifti' io_write_mgz(x, con, ...) # S3 method for class 'niftiImage' io_write_mgz(x, con, ...) # S3 method for class 'ants.core.ants_image.ANTsImage' io_write_mgz(x, con, ...) # S3 method for class 'array' io_write_mgz(x, con, vox2ras = NULL, ...) io_read_nii( file, method = c(\"oro\", \"rnifti\", \"ants\"), header_only = FALSE, ... ) io_write_nii(x, con, ...) # S3 method for class 'array' io_write_nii(x, con, vox2ras = NULL, ...)"},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Read and write volume data — imaging-volume","text":"format file; default auto-detection, choices 'nifti' 'mgh';","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read and write volume data — imaging-volume","text":"file file path read volume data header_only whether read header data ; default FALSE format format file written; choices 'auto', 'nifti' 'mgh'; default 'auto' detect format based file names, save 'MGH' file file extension 'mgz' 'mgh', otherwise 'NIfTI' format. recommend explicitly setting argument ... passed methods x volume data ('NIfTI' image, array, 'MGH') saved con file path store image vox2ras 4x4 transform matrix voxel indexing (column, row, slice) scanner (often 'T1-weighted' image) 'RAS' (right-anterior-superior) coordinate method method read file; choices 'oro' (using readNIfTI), 'rnifti' (using readNifti), 'ants' (using as_ANTsImage).","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read and write volume data — imaging-volume","text":"imaging readers return ieegio_volume objects.","code":""},{"path":"http://dipterix.org/ieegio/reference/imaging-volume.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read and write volume data — imaging-volume","text":"","code":"library(ieegio) nifti_file <- \"brain.demosubject.nii.gz\" # Use `ieegio_sample_data(nifti_file)` # to download sample data if( ieegio_sample_data(nifti_file, test = TRUE) ) { # ---- NIfTI examples --------------------------------------------- file <- ieegio_sample_data(nifti_file) # basic read vol <- read_volume(file) # voxel to scanner RAS vol$transforms$vox2ras # to freesurfer surface vol$transforms$vox2ras_tkr # to FSL vol$transforms$vox2fsl image(vol$data[,,128], asp = 1, axes = FALSE) # ---- using other methods -------------------------------------- # default vol <- read_volume(file, method = \"oro\", format = \"nifti\") vol$header # lazy-load nifti vol2 <- read_volume(file, method = \"rnifti\", format = \"nifti\") vol2$header # Using ANTsPyx vol3 <- read_volume(file, method = \"ants\", format = \"nifti\") vol3$header # ---- write -------------------------------------------------------- # write as NIfTI f <- tempfile(fileext = \".nii.gz\") write_volume(vol, f, format = \"nifti\") # alternative method write_volume(vol$header, f, format = \"nifti\") # write to mgz/mgh f2 <- tempfile(fileext = \".mgz\") write_volume(vol, f, format = \"mgh\") # clean up unlink(f) unlink(f2) }"},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":null,"dir":"Reference","previous_headings":"","what":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"Check whether 'HDF5' file can opened read/write","code":""},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"","code":"io_h5_valid(file, mode = c(\"r\", \"w\"), close_all = FALSE) io_h5_names(file)"},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"file path file mode 'r' read access 'w' write access close_all whether close connections just close current connection; default false. Set TRUE want close connections file","code":""},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"io_h5_valid returns logical value indicating whether file can opened. io_h5_names returns character vector dataset names.","code":""},{"path":"http://dipterix.org/ieegio/reference/io_h5_valid.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check whether a 'HDF5' file can be opened for read/write — io_h5_valid","text":"","code":"x <- array(1:27, c(3,3,3)) f <- tempfile() # No data written to the file, hence invalid io_h5_valid(f, 'r') #> [1] FALSE io_write_h5(x, f, 'dset') #> {private$file} => {private$name} (Dataset Created) #> {private$file} => {private$name} (Dataset Removed) #> {private$file} => {private$name} (Dataset Created) io_h5_valid(f, 'w') #> [1] TRUE # Open the file and hold a connection ptr <- hdf5r::H5File$new(filename = f, mode = 'w') # Can read, but cannot write io_h5_valid(f, 'r') # TRUE #> [1] TRUE io_h5_valid(f, 'w') # FALSE #> [1] FALSE # However, this can be reset via `close_all=TRUE` io_h5_valid(f, 'r', close_all = TRUE) #> [1] TRUE io_h5_valid(f, 'w') # TRUE #> [1] TRUE # Now the connection is no longer valid ptr #> Class: H5File #> ID: Object invalid # clean up unlink(f)"},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":null,"dir":"Reference","previous_headings":"","what":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"Wrapper class LazyH5, load data \"lazy\" mode - read part dataset needed.","code":""},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"","code":"io_read_h5(file, name, read_only = TRUE, ram = FALSE, quiet = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"file 'HDF5' file name group/data_name path dataset (H5D data) read_only used ram=FALSE, whether returned LazyH5 instance read ram load data memory immediately, default false quiet whether suppress messages","code":""},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"ram true, return data arrays, otherwise return LazyH5 instance.","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/io_read_h5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Lazy Load 'HDF5' File via hdf5r-package — io_read_h5","text":"","code":"file <- tempfile() x <- array(1:120, dim = c(4,5,6)) # save x to file with name /group/dataset/1 io_write_h5(x, file, '/group/dataset/1', quiet = TRUE) # read data y <- io_read_h5(file, '/group/dataset/1', ram = TRUE) class(y) # array #> [1] \"array\" z <- io_read_h5(file, '/group/dataset/1', ram = FALSE) class(z) # LazyH5 #> [1] \"LazyH5\" \"R6\" dim(z) #> [1] 4 5 6 # clean up unlink(file)"},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":null,"dir":"Reference","previous_headings":"","what":"Save objects to 'HDF5' file without trivial checks — io_write_h5","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"Save objects 'HDF5' file without trivial checks","code":""},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"","code":"io_write_h5( x, file, name, chunk = \"auto\", level = 4, replace = TRUE, new_file = FALSE, ctype = NULL, quiet = FALSE, ... )"},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"x array, matrix, vector file path 'HDF5' file name path/name data; example, \"group/data_name\" chunk chunk size level compress level 0 - compression 10 - max compression replace data replaced exists new_file removing file old one exists ctype data type \"character\", \"integer\", \"numeric\". set NULL automatically detect types. Note complex data please store separately real imaginary parts. quiet whether suppress messages, default false ... passed LazyH5$save","code":""},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"Absolute path file saved","code":""},{"path":[]},{"path":"http://dipterix.org/ieegio/reference/io_write_h5.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Save objects to 'HDF5' file without trivial checks — io_write_h5","text":"","code":"file <- tempfile() x <- array(1:120, dim = 2:5) # save x to file with name /group/dataset/1 io_write_h5(x, file, '/group/dataset/1', chunk = dim(x)) #> {private$file} => {nm} (Group Created) #> {private$file} => {nm} (Group Created) #> {private$file} => {private$name} (Dataset Created) #> {private$file} => {private$name} (Dataset Removed) #> {private$file} => {private$name} (Dataset Created) # load data y <- io_read_h5(file, '/group/dataset/1') # read data to memory y[] #> , , 1, 1 #> #> [,1] [,2] [,3] #> [1,] 1 3 5 #> [2,] 2 4 6 #> #> , , 2, 1 #> #> [,1] [,2] [,3] #> [1,] 7 9 11 #> [2,] 8 10 12 #> #> , , 3, 1 #> #> [,1] [,2] [,3] #> [1,] 13 15 17 #> [2,] 14 16 18 #> #> , , 4, 1 #> #> [,1] [,2] [,3] #> [1,] 19 21 23 #> [2,] 20 22 24 #> #> , , 1, 2 #> #> [,1] [,2] [,3] #> [1,] 25 27 29 #> [2,] 26 28 30 #> #> , , 2, 2 #> #> [,1] [,2] [,3] #> [1,] 31 33 35 #> [2,] 32 34 36 #> #> , , 3, 2 #> #> [,1] [,2] [,3] #> [1,] 37 39 41 #> [2,] 38 40 42 #> #> , , 4, 2 #> #> [,1] [,2] [,3] #> [1,] 43 45 47 #> [2,] 44 46 48 #> #> , , 1, 3 #> #> [,1] [,2] [,3] #> [1,] 49 51 53 #> [2,] 50 52 54 #> #> , , 2, 3 #> #> [,1] [,2] [,3] #> [1,] 55 57 59 #> [2,] 56 58 60 #> #> , , 3, 3 #> #> [,1] [,2] [,3] #> [1,] 61 63 65 #> [2,] 62 64 66 #> #> , , 4, 3 #> #> [,1] [,2] [,3] #> [1,] 67 69 71 #> [2,] 68 70 72 #> #> , , 1, 4 #> #> [,1] [,2] [,3] #> [1,] 73 75 77 #> [2,] 74 76 78 #> #> , , 2, 4 #> #> [,1] [,2] [,3] #> [1,] 79 81 83 #> [2,] 80 82 84 #> #> , , 3, 4 #> #> [,1] [,2] [,3] #> [1,] 85 87 89 #> [2,] 86 88 90 #> #> , , 4, 4 #> #> [,1] [,2] [,3] #> [1,] 91 93 95 #> [2,] 92 94 96 #> #> , , 1, 5 #> #> [,1] [,2] [,3] #> [1,] 97 99 101 #> [2,] 98 100 102 #> #> , , 2, 5 #> #> [,1] [,2] [,3] #> [1,] 103 105 107 #> [2,] 104 106 108 #> #> , , 3, 5 #> #> [,1] [,2] [,3] #> [1,] 109 111 113 #> [2,] 110 112 114 #> #> , , 4, 5 #> #> [,1] [,2] [,3] #> [1,] 115 117 119 #> [2,] 116 118 120 #> # clean up unlink(file)"},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":null,"dir":"Reference","previous_headings":"","what":"Low-level file read and write — low-level-read-write","title":"Low-level file read and write — low-level-read-write","text":"Interfaces read write files common formats.","code":""},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Low-level file read and write — low-level-read-write","text":"","code":"io_read_fst( con, method = c(\"proxy\", \"data_table\", \"data_frame\", \"header_only\"), ..., old_format = FALSE ) io_write_fst(x, con, compress = 50, ...) io_read_ini(con, ...) io_read_json(con, ...) io_write_json( x, con = stdout(), ..., digits = ceiling(-log10(.Machine$double.eps)), pretty = TRUE, serialize = TRUE ) io_read_mat( con, method = c(\"auto\", \"R.matlab\", \"pymatreader\", \"mat73\"), verbose = TRUE, on_convert_error = c(\"warning\", \"error\", \"ignore\"), ... ) io_write_mat(x, con, method = c(\"R.matlab\", \"scipy\"), ...) io_read_yaml(con, ...) io_write_yaml(x, con, ..., sorted = FALSE)"},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Low-level file read and write — low-level-read-write","text":"con connection file method method read table. 'fst', choices 'proxy' read data memory, query table needed; 'data_table' read data.table; 'data_frame' read data.frame; 'header_only' read 'fst' table header. 'mat', choices 'auto' automatically try native option, 'pymatreader' fails; 'R.matlab' use native method (provided readMat); support 'MAT 5.0' format; 'pymatreader' use 'Python' library 'pymatreader'; 'mat73' use 'Python' library 'mat73'. ... passed internal function calls old_format see fst x data write disk compress compress level 0 100; default 50 digits, pretty writing numeric values 'json' format serialize set TRUE serialize data 'json' format (data types, default); FALSE save values without types verbose whether print process on_convert_error reading 'mat' files 'Python' modules, results converted R objects end. objects can converted. input defines behavior conversion fails; choices \"error\", \"warning\", \"ignore\" sorted whether sort list; default FALSE","code":""},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Low-level file read and write — low-level-read-write","text":"reader functions returns data extracted files, mostly R objects, exceptions 'Matlab' files. reading 'Matlab' file requires using 'Python' modules, io_read_mat try best effort convert 'Python' objects R. However, conversion might fail. case, result might partially contain 'Python' objects warnings.","code":""},{"path":"http://dipterix.org/ieegio/reference/low-level-read-write.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Low-level file read and write — low-level-read-write","text":"","code":"# ---- fst ---------------------------------------------------------------- f <- tempfile(fileext = \".fst\") x <- data.frame( a = 1:10, b = rnorm(10), c = letters[1:10] ) io_write_fst(x, con = f) # default reads in proxy io_read_fst(f) #> #> 10 rows, 3 columns (file18a3598ce91.fst) #> #> a b c #> #> 1 1 -1.400043517 a #> 2 2 0.255317055 b #> 3 3 -2.437263611 c #> 4 4 -0.005571287 d #> 5 5 0.621552721 e #> 6 6 1.148411606 f #> 7 7 -1.821817661 g #> 8 8 -0.247325302 h #> 9 9 -0.244199607 i #> 10 10 -0.282705449 j # load as data.table io_read_fst(f, \"data_table\") #> a b c #> #> 1: 1 -1.400043517 a #> 2: 2 0.255317055 b #> 3: 3 -2.437263611 c #> 4: 4 -0.005571287 d #> 5: 5 0.621552721 e #> 6: 6 1.148411606 f #> 7: 7 -1.821817661 g #> 8: 8 -0.247325302 h #> 9: 9 -0.244199607 i #> 10: 10 -0.282705449 j # load as data.frame io_read_fst(f, \"data_frame\") #> a b c #> 1 1 -1.400043517 a #> 2 2 0.255317055 b #> 3 3 -2.437263611 c #> 4 4 -0.005571287 d #> 5 5 0.621552721 e #> 6 6 1.148411606 f #> 7 7 -1.821817661 g #> 8 8 -0.247325302 h #> 9 9 -0.244199607 i #> 10 10 -0.282705449 j # get header io_read_fst(f, \"header_only\") #> #> 10 rows, 3 columns (file18a3598ce91.fst) #> #> * 'a': integer #> * 'b': double #> * 'c': character # clean up unlink(f) # ---- json --------------------------------------------------------------- f <- tempfile(fileext = \".json\") x <- list(a = 1L, b = 2.3, c = \"a\", d = 1+1i) # default is serialize io_write_json(x, f) io_read_json(f) #> $a #> [1] 1 #> #> $b #> [1] 2.3 #> #> $c #> [1] \"a\" #> #> $d #> [1] 1+1i #> cat(readLines(f), sep = \"\\n\") #> { #> \"type\": \"list\", #> \"attributes\": { #> \"names\": { #> \"type\": \"character\", #> \"attributes\": {}, #> \"value\": [\"a\", \"b\", \"c\", \"d\"] #> } #> }, #> \"value\": [ #> { #> \"type\": \"integer\", #> \"attributes\": {}, #> \"value\": [1] #> }, #> { #> \"type\": \"double\", #> \"attributes\": {}, #> \"value\": [2.2999999999999998] #> }, #> { #> \"type\": \"character\", #> \"attributes\": {}, #> \"value\": [\"a\"] #> }, #> { #> \"type\": \"complex\", #> \"attributes\": {}, #> \"value\": [\"1+1i\"] #> } #> ] #> } # just values io_write_json(x, f, serialize = FALSE, pretty = FALSE) io_read_json(f) #> $a #> [1] 1 #> #> $b #> [1] 2.3 #> #> $c #> [1] \"a\" #> #> $d #> [1] \"1+1i\" #> cat(readLines(f), sep = \"\\n\") #> {\"a\":[1],\"b\":[2.2999999999999998],\"c\":[\"a\"],\"d\":[\"1+1i\"]} # clean up unlink(f) # ---- Matlab .mat -------------------------------------------------------- if (FALSE) { # \\dontrun{ f <- tempfile(fileext = \".mat\") x <- list(a = 1L, b = 2.3, c = \"a\", d = 1+1i) # save as MAT 5.0 io_write_mat(x, f) io_read_mat(f) # require setting up Python environment io_read_mat(f, method = \"pymatreader\") # MAT 7.3 example sample_data <- ieegio_sample_data(\"mat_v73.mat\") io_read_mat(sample_data) # clean up unlink(f) } # } # ---- yaml --------------------------------------------------------------- f <- tempfile(fileext = \".yaml\") x <- list(a = 1L, b = 2.3, c = \"a\") io_write_yaml(x, f) io_read_yaml(f) #> $a #> [1] 1 #> #> $b #> [1] 2.3 #> #> $c #> [1] \"a\" #> # clean up unlink(f)"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot '3D' surface objects — plot.ieegio_surface","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"Plot '3D' surface objects","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"","code":"# S3 method for class 'ieegio_surface' plot( x, method = c(\"basic\", \"full\"), transform = 1L, name = \"auto\", vlim = NULL, col = c(\"black\", \"white\"), slice_index = NULL, ... )"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"x 'ieegio_surface' object, see read_surface method plot method; 'basic' just rendering surfaces; 'full' rendering axes title transform transform use, can 4--4 matrix; surface contains transform matrix, argument can integer index transform embedded, target (transformed) space name; print names(x$transforms) choices name attribute name used colors, options can 'color' surface color matrix; c('annotations', varname) rendering colors annotations variable varname; c('measurements', varname) rendering colors measurements variable varname; 'time_series' plotting time series slices; \"flat\" flat color; default 'auto', plot first available data. details see 'Examples'. vlim plotting continuous data (name measurements time-series), value limit used generate color palette; default NULL: range values. argument can length 1 ( creating symmetric value range) 2. set, values exceeding range trimmed limit col color colors form color palette value data continuous; name=\"flat\", last color used slice_index plotting name=\"time_series\" data, slice indices plot; default select maximum 4 slices ... ignored","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_surface.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot '3D' surface objects — plot.ieegio_surface","text":"","code":"library(ieegio) # geometry geom_file <- \"gifti/GzipBase64/sujet01_Lwhite.surf.gii\" # measurements shape_file <- \"gifti/GzipBase64/sujet01_Lwhite.shape.gii\" # time series ts_file <- \"gifti/GzipBase64/fmri_sujet01_Lwhite_projection.time.gii\" if(ieegio_sample_data(geom_file, test = TRUE)) { geometry <- read_surface(ieegio_sample_data(geom_file)) measurement <- read_surface(ieegio_sample_data(shape_file)) time_series <- read_surface(ieegio_sample_data(ts_file)) ts_demean <- apply( time_series$time_series$value, MARGIN = 1L, FUN = function(x) { x - mean(x) } ) time_series$time_series$value <- t(ts_demean) # merge measurement & time_series into geometry (optional) merged <- merge(geometry, measurement, time_series) print(merged) # ---- plot method/style ------------------------------------ plot(merged, \"basic\") plot(merged, \"full\") # ---- plot data -------------------------------------------- ## Measurements or annotations # the first column of `measurements` plot(merged, name = \"measurements\") # equivalent to plot(merged, name = list(\"measurements\", 1L)) # equivalent to measurement_names <- names(merged$measurements$data_table) plot(merged, name = list(\"measurements\", measurement_names[[1]])) ## Time-series # automatically select 4 slices, trim the color palette # from -25 to 25 plot(merged, name = \"time_series\", vlim = c(-25, 25)) plot( merged, name = \"time_series\", vlim = c(-25, 25), slice_index = c(1, 17, 33, 49, 64, 80, 96, 112, 128), col = c(\"#053061\", \"#2166ac\", \"#4393c3\", \"#92c5de\", \"#d1e5f0\", \"#ffffff\", \"#fddbc7\", \"#f4a582\", \"#d6604d\", \"#b2182b\", \"#67001f\") ) }"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":null,"dir":"Reference","previous_headings":"","what":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"Plot '3D' volume anatomical slices","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"","code":"# S3 method for class 'ieegio_volume' plot( x, position = c(0, 0, 0), center_position = FALSE, which = c(\"coronal\", \"axial\", \"sagittal\"), slice_index = 1L, transform = \"vox2ras\", zoom = 1, pixel_width = max(zoom/2, 1), crosshair_gap = 4, crosshair_lty = 2, col = c(\"black\", \"white\"), crosshair_col = \"#00FF00A0\", continuous = TRUE, vlim = NULL, add = FALSE, main = \"\", axes = FALSE, background = col[[1]], foreground = col[[length(col)]], ..., .xdata = x$data )"},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"x 'ieegio_volume' object; see read_volume position cross-hair focused position center_position whether center canvas position, default FALSE slice plot; choices \"coronal\", \"axial\", \"sagittal\" slice_index length 1: x fourth dimension (e.g. 'fMRI'), slice index draw transform transform apply, can 4--4 matrix, integer name indicating matrix x$transforms; needs transform matrix voxel index 'RAS' (right-anterior-superior coordinate system), often called 'xform', 'sform', 'qform' 'NIfTI' terms, 'Norig' 'FreeSurfer' zoom zoom-level pixel_width pixel size, ranging 0.05 50; default half zoom 1, whichever greater; unit pixel_width divided zoom milliliter crosshair_gap cross-hair gap milliliter crosshair_lty cross-hair line type col color palette continuous x values crosshair_col cross-hair color; set NA hide continuous reserved vlim range limit data; default computed range x$data; data values exceeding range trimmed add whether add plot existing underlay; default FALSE main, ... passed image axes whether draw axes; default FALSE background, foreground background foreground colors; default first last elements col .xdata default x$data, used speed calculation multiple different angles plotted","code":""},{"path":"http://dipterix.org/ieegio/reference/plot.ieegio_volume.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Plot '3D' volume in anatomical slices — plot.ieegio_volume","text":"","code":"library(ieegio) nifti_file <- \"brain.demosubject.nii.gz\" # Use `ieegio_sample_data(nifti_file)` # to download sample data if( ieegio_sample_data(nifti_file, test = TRUE) ) { # ---- NIfTI examples --------------------------------------------- file <- ieegio_sample_data(nifti_file) # basic read vol <- read_volume(file) par(mfrow = c(1, 3), mar = c(0, 0, 3.1, 0)) ras_position <- c(-50, -10, 15) ras_str <- paste(sprintf(\"%.0f\", ras_position), collapse = \",\") for(which in c(\"coronal\", \"axial\", \"sagittal\")) { plot(x = vol, position = ras_position, crosshair_gap = 10, crosshair_lty = 2, zoom = 3, which = which, main = sprintf(\"%s T1RAS=[%s]\", which, ras_str)) } }"},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":null,"dir":"Reference","previous_headings":"","what":"Install 'NWB' via 'pynwb' — pynwb_module","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"Install 'NWB' via 'pynwb'","code":""},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"","code":"install_pynwb(python_ver = \"auto\", verbose = TRUE) pynwb_module(force = FALSE, error_if_missing = TRUE)"},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"python_ver 'Python' version, see configure_conda; default \"auto\", suggested verbose whether print installation messages force whether force-reload module error_if_missing whether raise errors module fails load; default true","code":""},{"path":"http://dipterix.org/ieegio/reference/pynwb_module.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Install 'NWB' via 'pynwb' — pynwb_module","text":"'Python' module pynwb.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'BCI2000' data file — read_bci2000","title":"Read 'BCI2000' data file — read_bci2000","text":"Read 'BCI2000' data file","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'BCI2000' data file — read_bci2000","text":"","code":"read_bci2000( file, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'BCI2000' data file — read_bci2000","text":"file file path data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'BCI2000' data file — read_bci2000","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_bci2000.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'BCI2000' data file — read_bci2000","text":"","code":"if( ieegio_sample_data(\"bci2k.dat\", test = TRUE) ) { file <- ieegio_sample_data(\"bci2k.dat\") x <- read_bci2000(file) print(x) channel <- x$get_channel(1) plot( channel$time, channel$value, type = \"l\", main = channel$info$Label, xlab = \"Time\", ylab = channel$info$Unit ) }"},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'BrainVision' data — read_brainvis","title":"Read 'BrainVision' data — read_brainvis","text":"Read 'BrainVision' data","code":""},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'BrainVision' data — read_brainvis","text":"","code":"read_brainvis( file, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'BrainVision' data — read_brainvis","text":"file file path data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'BrainVision' data — read_brainvis","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_brainvis.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'BrainVision' data — read_brainvis","text":"","code":"if( ieegio_sample_data(\"brainvis.dat\", test = TRUE) ) { # ensure the header and marker files are downloaded as well ieegio_sample_data(\"brainvis.vhdr\") ieegio_sample_data(\"brainvis.dat\") file <- ieegio_sample_data(\"brainvis.vmrk\") x <- read_brainvis(file) print(x) x$get_header() x$get_channel_table() x$get_annotations() channel <- x$get_channel(10) plot( channel$time, channel$value, type = \"l\", main = channel$info$Label, xlab = \"Time\", ylab = channel$info$Unit ) }"},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'EDF' or 'BDF' data file — read_edf","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"Read 'EDF' 'BDF' data file","code":""},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"","code":"read_edf( con, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, begin = 0, end = Inf, convert = TRUE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"con file connection data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. begin, end begin end data read convert whether convert digital numbers analog signals; default TRUE verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_edf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'EDF' or 'BDF' data file — read_edf","text":"","code":"# ---- EDF/BDF(+) --------------------------------------------------------- # Run `ieegio_sample_data(\"edfPlusD.edf\")` to download sample data # Tun example if the sample data exists if(ieegio_sample_data(\"edfPlusD.edf\", test = TRUE)) { edf_path <- ieegio_sample_data(\"edfPlusD.edf\") data <- read_edf(edf_path) data$get_header() data$get_annotations() data$get_channel_table() channel <- data$get_channel(1) plot( channel$time, channel$value, type = \"l\", main = channel$info$Label, xlab = \"Time\", ylab = channel$info$Unit ) }"},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":null,"dir":"Reference","previous_headings":"","what":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"Read ('BlackRock') 'NEV' 'NSx' data","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"","code":"read_nsx( file, extract_path = getOption(\"ieegio.extract_path\", NULL), header_only = FALSE, cache_ok = TRUE, include_waveform = FALSE, verbose = TRUE )"},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"file file path data file extract_path location extracted information stored header_only whether load header data cache_ok whether existing cache reused; default TRUE. input can speed reading large data files; set FALSE delete cache importing. include_waveform whether include 'waveform' data (usually online spike sorting); default FALSE verbose whether print processing messages; default TRUE","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nsx.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read ('BlackRock') 'NEV' 'NSx' data — read_nsx","text":"cached object readily loaded memory; see SignalDataCache class definition.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":null,"dir":"Reference","previous_headings":"","what":"Read 'NWB' format — read_nwb","title":"Read 'NWB' format — read_nwb","text":"Life cycle: experimental. Read \"Neurodata Without Borders\" ('NWB' format) file. Unlike readers read_nwb returns low-level 'Python' class handler via pynwb module.","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Read 'NWB' format — read_nwb","text":"","code":"read_nwb(file, mode = c(\"r\", \"w\", \"r+\", \"a\", \"w-\", \"x\"), ...)"},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Read 'NWB' format — read_nwb","text":"file path 'NWB' file mode file open mode; default 'r' (read-) ... passed NWBHDF5IO initialize function","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Read 'NWB' format — read_nwb","text":"NWBHDF5IO instance","code":""},{"path":"http://dipterix.org/ieegio/reference/read_nwb.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Read 'NWB' format — read_nwb","text":"","code":"if(ieegio_sample_data(\"nwb_sample.nwb\", test = TRUE)) { file <- ieegio_sample_data(\"nwb_sample.nwb\") # Create NWBIO container container <- read_nwb(file) # Open connection container$open() # read meta data data <- container$read() data # get `test_timeseries` data ts_data <- data$get_acquisition(\"test_timeseries\") ts_data # read timeseries data into memory ts_arr <- ts_data$data[] ts_arr # Convert Python array to R # using `rpymat::py_to_r(ts_arr)` or as.numeric(ts_arr) # Make sure you close the connection container$close() } # Requires setting up Python environment # run `ieegio::install_pynwb()` to set up environment first if (FALSE) { # \\dontrun{ # Replicating tutorial # https://pynwb.readthedocs.io/en/stable/tutorials/general/plot_file.html library(rpymat) # Load Python module pynwb <- import(\"pynwb\") uuid <- import(\"uuid\") datetime <- import(\"datetime\") np <- import(\"numpy\") tz <- import(\"dateutil.tz\") # 2018L is 2018 as integer session_start_time <- datetime$datetime( 2018L, 4L, 25L, 2L, 30L, 3L, tzinfo=tz$gettz(\"US/Pacific\")) # ---- Create NWB file object ------------------------ nwbfile <- pynwb$NWBFile( session_description=\"Mouse exploring a closed field\", identifier=py_str(uuid$uuid4()), session_start_time=session_start_time, session_id=\"session_4321\", experimenter=py_list(c(\"Baggins, Frodo\")), lab=\"Bag End Laboratory\", institution=\"University of Middle Earth at the Shire\", experiment_description=\"Thank you Bilbo Baggins.\", keywords=py_list(c(\"behavior\", \"exploration\")) ) # ---- Add subject ------------------------------------ subject <- pynwb$file$Subject( subject_id=\"001\", age=\"P90D\", description=\"mouse 5\", species=\"Mus musculus\", sex=\"M\" ) nwbfile$subject <- subject nwbfile # ---- Add TimeSeries ------------------------------------ data <- seq(100, 190, by = 10) time_series_with_rate <- pynwb$TimeSeries( name=\"test_timeseries\", description=\"an example time series\", data=data, unit=\"m\", starting_time=0.0, rate=1.0 ) time_series_with_rate nwbfile$add_acquisition(time_series_with_rate) # ---- New Spatial positions ------------------------------------ position_data <- cbind( seq(0, 10, length.out = 50), seq(0, 9, length.out = 50) ) position_timestamps = seq(0, 49) / 200 spatial_series_obj = pynwb$behavior$SpatialSeries( name=\"SpatialSeries\", description=\"(x,y) position in open field\", data=position_data, timestamps=position_timestamps, reference_frame=\"(0,0) is bottom left corner\", ) spatial_series_obj position_obj = pynwb$behavior$Position( spatial_series=spatial_series_obj) position_obj # ---- Behavior Processing Module ------------------------------ behavior_module <- nwbfile$create_processing_module( name=\"behavior\", description=\"processed behavioral data\" ) behavior_module$add(position_obj) nwbfile$processing$behavior # omit some process # ---- Write --------------------------------------------------- f <- normalizePath(tempfile(fileext = \".nwb\"), winslash = \"/\", mustWork = FALSE) io <- pynwb$NWBHDF5IO(f, mode = \"w\") io$write(nwbfile) io$close() } # }"},{"path":"http://dipterix.org/ieegio/news/index.html","id":"ieegio-001","dir":"Changelog","previous_headings":"","what":"ieegio 0.0.1","title":"ieegio 0.0.1","text":"Initial CRAN submission.","code":""}]