% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bundle.R
\name{bundle_set}
\alias{bundle_set}
\title{Bundle set S7 class}
\usage{
bundle_set(bundles = list(), set_data = list())
}
\arguments{
\item{bundles}{A named list of \link{bundle} objects.}

\item{set_data}{A named list of set-level metadata.}
}
\value{
A \code{bundle_set} S7 object.
}
\description{
A \code{bundle_set} is a \strong{named collection of \link{bundle} objects}, designed for
multi-subject or multi-session studies where each element represents one
subject's (or session's) tractogram. It stores two compartments:
\itemize{
\item \verb{@bundles} — a \emph{named} list of \link{bundle} objects. Names typically encode
subject or session identifiers (e.g. \code{"sub-01"}, \code{"sub-02"}).
\item \verb{@set_data} — a named list of set-level metadata (arbitrary R objects,
e.g. study name, atlas used, acquisition protocol).
}
}
\section{Methods for standard generics}{

The following methods are defined for \code{bundle_set} objects:
\itemize{
\item \code{format(x, ...)}: Returns a compact character string.
\item \code{print(x, ...)}: Prints the formatted string to the console and
invisibly returns \code{x}.
\item \code{length(x)}: Returns the number of bundles.
\item \code{x[[i]]}: Extracts the \code{i}-th (or named) \link{bundle} from the set.
\item \code{x[i]}: Returns a new \link{bundle_set} containing only the selected bundles,
preserving \verb{@set_data}.
\item \code{names(x)}: Returns the names of the bundles.
}
}

\examples{
pts <- matrix(runif(15), ncol = 3, dimnames = list(NULL, c("X", "Y", "Z")))
b1 <- bundle(streamlines = list(streamline(points = pts)),
             bundle_data = list(subject = "sub-01"))
b2 <- bundle(streamlines = list(streamline(points = pts)),
             bundle_data = list(subject = "sub-02"))
bs <- bundle_set(bundles = list("sub-01" = b1, "sub-02" = b2))
bs@n_bundles      # 2
bs@bundle_names   # c("sub-01", "sub-02")
bs[["sub-01"]]    # first bundle
}
\section{Additional properties}{

\describe{
\item{\code{@n_bundles}}{An integer scalar giving the number of bundles in the set
(read-only).}

\item{\code{@bundle_names}}{A character vector of the names of the bundles
(read-only).}

\item{\code{@set_attributes}}{A character vector of the names of the set-level
attributes (read-only).}
}}

