Skip to contents

Get the mask volume

Get the mask object via generic

Usage

mask(x, ...)

# S4 method for class 'H5ClusteredArray'
mask(x)

# S4 method for class 'H5ClusterExperiment'
mask(x)

# S4 method for class 'LatentNeuroVec'
mask(x)

Arguments

x

H5ClusterExperiment object

...

Additional arguments

Value

The mask object (e.g., a LogicalNeuroVol)

The mask object from the first run.

Examples

if (FALSE) { # \dontrun{
# For LatentNeuroVec:
if (!is.null(fmristore:::create_minimal_LatentNeuroVec)) {
  lnv <- NULL
  tryCatch({
    lnv <- fmristore:::create_minimal_LatentNeuroVec(space_dims = c(3L,3L,2L))
    mask_vol <- mask(lnv)
    print(mask_vol)
    # if (requireNamespace("neuroim2", quietly=TRUE)) print(is(mask_vol, "LogicalNeuroVol"))
  }, error = function(e) {
    message("mask example for LatentNeuroVec failed: ", e$message)
  })
} else {
  message("Skipping mask example for LatentNeuroVec: helper not available.")
}

# For H5ClusterExperiment:
if (!is.null(fmristore:::create_minimal_h5_for_H5ClusterExperiment)) {
  temp_exp_file <- NULL
  exp_obj <- NULL
  tryCatch({
    temp_exp_file <- fmristore:::create_minimal_h5_for_H5ClusterExperiment()
    exp_obj <- fmristore::H5ClusterExperiment(file_path = temp_exp_file)
    mask_vol_exp <- mask(exp_obj)
    print(mask_vol_exp)
  }, error = function(e) {
    message("mask example for H5ClusterExperiment failed: ", e$message)
  }, finally = {
    if (!is.null(exp_obj)) try(close(exp_obj), silent = TRUE)
    if (!is.null(temp_exp_file) && file.exists(temp_exp_file)) {
      unlink(temp_exp_file)
    }
  })
} else {
  message("Skipping mask example for H5ClusterExperiment: helper not available.")
}
} # }