Temporal SNR (tSNR) per voxel across runs
compute_tsnr.RdComputes per-voxel temporal signal-to-noise ratio across a list of NeuroVec
runs by aggregating first and second moments over time and runs.
Arguments
- nv_list
List of
neuroim2::NeuroVecruns.
Details
For each voxel, the mean and variance are computed over concatenated time
points across runs. tSNR is max(1e-6, mean) / max(1e-6, sd), then lower-
bounded at 1e-6 to avoid degenerate weights.
See also
compute_tsnr_parcel() for parcel-level tSNR computation
Other spatial metrics:
build_spatial_metric(),
build_spatial_metric_parcel(),
compute_tsnr_parcel(),
make_laplacian(),
make_parcel_laplacian()
Examples
# \donttest{
# Create simple test data
dims <- c(10, 10, 5, 20) # 4D: x, y, z, time
space <- neuroim2::NeuroSpace(dims,
spacing = c(1, 1, 1),
origin = c(0, 0, 0))
mask <- array(TRUE, dims[1:3]) # 3D mask
# Create two runs with random data
data1 <- array(rnorm(prod(dims)), dims)
data2 <- array(rnorm(prod(dims)), dims)
nv1 <- neuroim2::NeuroVec(data1, space, mask = mask)
nv2 <- neuroim2::NeuroVec(data2, space, mask = mask)
tsnr <- compute_tsnr(list(nv1, nv2))
# }