The `NeuroSurfaceSource` class serves as a factory for creating
NeuroSurface instances. It encapsulates all necessary
information to construct a neuroimaging surface, including geometry,
metadata, and indexing information.
Arguments
- surface_geom
the name of the file containing the surface geometry or a
SurfaceGeometryinstance- surface_data_name
the name of the file containing the data values to be mapped to the surface.
- colind
the subset of column indices to load from surface data matrix (if provided)
- nodeind
the subset of node indices to load from surface data matrix (if provided)
Value
An object of class NeuroSurfaceSource or NeuroSurfaceVectorSource
that contains information about the surface geometry and associated data. If the data has multiple columns
(colind > 1), a NeuroSurfaceVectorSource is returned; otherwise, a NeuroSurfaceSource is returned.
These objects can be used to load and map neuroimaging data onto brain surfaces.
Details
This class is designed to facilitate the creation of NeuroSurface
objects by providing a standardized way to store and access all required components.
It combines geometric information, metadata, and indexing details necessary for
constructing a complete neuroimaging surface representation.
Slots
geometryAn object of class
SurfaceGeometryrepresenting the underlying surface structure.data_meta_infoAn object of class
SurfaceDataMetaInfocontaining metadata about the surface data.colindAn integer specifying the column index of the surface map to be loaded.
nodeindAn integer vector specifying the node indices of the surface map to be loaded.
Examples
# \donttest{
# Create a simple mesh for the example
vertices <- c(
0, 0, 0,
1, 0, 0,
0, 1, 0,
0, 0, 1
)
triangles <- c(
1, 2, 3,
1, 2, 4,
1, 3, 4,
2, 3, 4
)
# Create mesh3d object
mesh <- rgl::mesh3d(vertices = vertices, triangles = triangles)
# Create a graph representation
edges <- rbind(
c(1,2), c(1,3), c(1,4),
c(2,3), c(2,4),
c(3,4)
)
graph <- igraph::graph_from_edgelist(edges)
# Create a SurfaceGeometry object
geometry <- new("SurfaceGeometry",
mesh = mesh,
graph = graph,
hemi = "left")
# Create a SurfaceDataMetaInfo object
data_meta_info <- new("SurfaceDataMetaInfo",
header_file = "data_meta.txt",
data_file = "surface_data.1D",
file_descriptor = new("FileFormat"),
node_count = 4L,
nels = 1L,
label = "thickness")
# Create a NeuroSurfaceSource object
neuro_source <- new("NeuroSurfaceSource",
geometry = geometry,
data_meta_info = data_meta_info,
colind = 1L,
nodeind = 1:4)
# }