| Specs | R Documentation |
Specs objects store compressed spectral data for large hyperspectral
datasets. They use a structure similar to OpenSpecy, but store
physical or latent variables, active values, coordinate data,
and metadata separately. Version 0.2 objects may represent regular grids and
repeated metadata compactly and reserve source mapping 0 for explicitly
background-suppressed pixels.
Specs(variables, values, coords = NULL, metadata = NULL, attributes = list())
is_Specs(x)
check_Specs(x, ...)
## Default S3 method:
check_Specs(x, ...)
## S3 method for class 'Specs'
check_Specs(x, ...)
as_Specs(x, ...)
## Default S3 method:
as_Specs(x, ...)
## S3 method for class 'Specs'
as_Specs(
x,
model = NULL,
steps = NULL,
background_filter = NULL,
n_components = NULL,
centers = NULL,
bits_per_variable = NULL,
limits = NULL,
...
)
## S3 method for class 'OpenSpecy'
as_Specs(
x,
model = NULL,
steps = c("pca", "hilbert"),
background_filter = NULL,
n_components = NULL,
centers = NULL,
bits_per_variable = NULL,
limits = NULL,
...
)
fit_specs_pca(x, n_components, center = TRUE, scale. = FALSE, ...)
decompress_spec(x, ...)
## Default S3 method:
decompress_spec(x, ...)
## S3 method for class 'Specs'
decompress_spec(x, expand = TRUE, index = NULL, ...)
## S3 method for class 'Specs'
as_OpenSpecy(x, ...)
encode_specs_hilbert(x, bits_per_variable = NULL, limits = NULL, ...)
decode_specs_hilbert(x, ...)
write_specs(x, file, compress = "xz", ...)
## Default S3 method:
write_specs(x, file, compress = "xz", ...)
## S3 method for class 'Specs'
write_specs(x, file, compress = "xz", ...)
read_specs(file, ...)
specs_background_filter(
metric = "run_sig_over_noise",
minimum,
maximum = Inf,
sigma = NULL,
step = 10,
intensity_type = NULL
)
specs_source_count(x)
specs_background_mask(x, index = NULL)
specs_source_values(x, index = NULL)
specs_coordinates(x, index = NULL, columns = NULL)
specs_metadata(x, index = NULL, columns = NULL)
## S3 method for class 'FileSpecs'
write_specs(x, file, compress = "xz", ...)
## S3 method for class 'Specs'
cor_spec(x, library, na.rm = TRUE, compute = "optimized", ...)
## S3 method for class 'Specs'
match_spec(
x,
library,
top_n = NULL,
expand = FALSE,
top_n_by = NULL,
add_library_metadata = NULL,
add_object_metadata = NULL,
compute = "optimized",
na.rm = TRUE,
...
)
## S3 method for class 'Specs'
def_features(
x,
features,
shape_kernel = c(3, 3),
shape_type = "box",
close = FALSE,
close_kernel = c(4, 4),
close_type = "box",
img = NULL,
bottom_left = NULL,
top_right = NULL,
...
)
## S3 method for class 'Specs'
collapse_spec(x, fun = mean, column = "feature_id", ...)
variables |
vector of latent variable names. |
values |
numeric matrix with one row per variable and one column per active spectrum or cluster. |
coords |
coordinate |
metadata |
metadata |
attributes |
list of Specs attributes to attach. |
x |
an object to test, convert, decompress, or write. |
model |
optional |
steps |
character vector of compression steps. Supported values are
|
background_filter |
optional policy returned by
|
n_components |
number of PCA components to keep. |
centers |
initial centers or the number of centers for weighted Lloyd K-means. Source mapping multiplicities supply the weights and mapping 0 is excluded. |
bits_per_variable |
positive whole number of bits used for each
Hilbert-encoded variable. If |
limits |
optional two-column matrix, data frame, or Hilbert model with per-variable minimum and maximum values used for quantization. |
center, scale. |
arguments passed to |
expand |
logical; if |
index |
optional positive integer vector selecting spectra to
decompress. With |
file |
file path for reading or writing a Specs object. |
compress |
compression argument passed to |
metric |
signal/noise metric passed to |
minimum, maximum |
strict accepted signal/noise bounds. |
sigma |
optional three-dimensional Gaussian smoothing sigma. |
step |
run-length step passed to |
intensity_type |
optional intensity units passed to |
columns |
optional coordinate or metadata columns to return. |
library |
a |
na.rm |
logical; should missing values be removed for latent matching? |
compute |
correlation compute strategy, |
top_n |
integer; number of top latent matches to return. |
top_n_by |
optional single library metadata column name; when supplied,
retain |
add_library_metadata |
name of a library metadata column to join. |
add_object_metadata |
name of an object metadata column to join. |
features |
logical or character vector with one value per row in
|
shape_kernel, shape_type, close, close_kernel, close_type, img, bottom_left, top_right |
arguments passed to the feature-definition routine. |
fun |
function used to collapse latent values. |
column |
coordinate column used to group spectra for collapse. |
... |
additional arguments passed to submethods. |
Specs(), as_Specs(), encode_specs_hilbert(), and
decode_specs_hilbert() return a Specs object.
fit_specs_pca() returns a SpecsPCA model.
decompress_spec() returns an exact OpenSpecy object for
uncompressed values, an approximate reconstruction after PCA/Hilbert, and an
exact zero line for every background-suppressed source.
read_specs() returns a Specs object.
Win Cowger
data("raman_hdpe")
specs <- as_Specs(raman_hdpe, n_components = 1)
decompress_spec(specs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.