Convenience function that computes DVARS and converts to weights in one step. This is the main user-facing function for volume quality weighting.
Value
If return_dvars is FALSE, a numeric vector of weights. If TRUE, a list with components "weights" and "dvars".
Examples
set.seed(123)
Y <- matrix(rnorm(100 * 50), nrow = 100, ncol = 50)
Y[50, ] <- Y[50, ] + 5 # Add artifact
# One-step computation of weights
result <- volume_weights(Y, return_dvars = TRUE)
#> Error in volume_weights(Y, return_dvars = TRUE): could not find function "volume_weights"
cat("DVARS at artifact:", round(result$dvars[50], 2), "\n")
#> Error in result$dvars: object of type 'closure' is not subsettable
cat("Weight at artifact:", round(result$weights[50], 3), "\n")
#> Error in result$weights: object of type 'closure' is not subsettable
# With Tukey method for more aggressive downweighting
w_tukey <- volume_weights(Y, method = "tukey")
#> Error in volume_weights(Y, method = "tukey"): could not find function "volume_weights"