NWBHDF5IO {ieegio} | R Documentation |
NWBHDF5IO
file containerClass definition for 'PyNWB' container; use read_nwb
for construction function.
opened
Whether the container is opened.
new()
Initialize the class
NWBHDF5IO$new(path = NULL, mode = c("r", "w", "r+", "a", "w-", "x"), ...)
path
Path to a '.nwb'
file
mode
Mode for opening the file
...
Other parameters passed to nwb$NWBHDF5IO
get_handler()
Get internal file handler. Please make sure you close the handler correctly.
NWBHDF5IO$get_handler()
File handler, i.e. 'PyNWB' NWBHDF5IO
instance.
open()
Open the connections, must be used together with $close
method.
For high-level method, see $with
NWBHDF5IO$open()
container itself
\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() }
close()
Close the connections (low-level method, see 'with' method below)
NWBHDF5IO$close(close_links = TRUE)
close_links
Whether to close all files linked to from this file; default is true
Nothing
close_linked_files()
Close all opened, linked-to files. 'MacOS'
and 'Linux'
automatically release the linked-to file after the linking file is
closed, but 'Windows'
does not, which prevents the linked-to
file from being deleted or truncated. Use this method to close all
opened, linked-to files.
NWBHDF5IO$close_linked_files()
Nothing
read()
Read the 'NWB'
file from the 'IO' source. Please use along with
'$with'
method
NWBHDF5IO$read()
'NWBFile'
container
with()
Safe wrapper for reading and handling 'NWB'
file. See class examples.
NWBHDF5IO$with(expr, quoted = FALSE, envir = parent.frame())
expr
R expression to evaluate
quoted
Whether expr
is quoted; default is false
envir
environment for expr
to evaluate; default is the
parent frame (see parent.frame
)
Whatever results generated by expr
\dontrun{ container$with({ data <- container$read() # process data }) }
clone()
The objects of this class are cloneable with this method.
NWBHDF5IO$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run:
# 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)
## End(Not run)
## ------------------------------------------------
## Method `NWBHDF5IO$open`
## ------------------------------------------------
## Not run:
# 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()
## End(Not run)
## ------------------------------------------------
## Method `NWBHDF5IO$with`
## ------------------------------------------------
## Not run:
container$with({
data <- container$read()
# process data
})
## End(Not run)