Title: | Morphological description of 3D categorical arrays |
---|---|
Description: | The {morphology} package implements a flexible API for the calculation of nearest-neighbour based morphological quantities for one-, two- or three-dimensional categorical arrays. |
Authors: | Bart Rogiers [cre, aut] (<https://orcid.org/0000-0002-8836-0988>, <https://rogiersbart.github.io>), SCK CEN [cph, fnd] |
Maintainer: | Bart Rogiers <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2025-02-21 04:15:46 UTC |
Source: | https://github.com/rogiersbart/morphology |
Describe morphology using summary functions
describe( .list, what = mean, of = "neighbours", in_function_of = switch(of, neighbours = "distance", distance = "neighbours", pathlength = "distance"), at = NULL, connected = NULL, cumulative = FALSE, name = NULL )
describe( .list, what = mean, of = "neighbours", in_function_of = switch(of, neighbours = "distance", distance = "neighbours", pathlength = "distance"), at = NULL, connected = NULL, cumulative = FALSE, name = NULL )
.list |
List with the |
what |
Summary function. |
of |
Quantity to summarise, and return as |
in_function_of |
Quantity to return as |
at |
Distances at which to describe the results. Defaults to the integer
sequence from |
connected |
Logical. Count connected or disconnected neighbours only.
Defaults to |
cumulative |
Logical. Provide cumulative results (distances <= threshold) or binned results (distances at center of provided breaks; default). |
name |
Name to use for the current described dataset in an extra name
column. If provided, the input list is included as attribute to the output,
and |
Data frame with distance
and neighbours
columns. If name
is
provided, an additional name
column is included for identifying different
described summaries. In case a name
column is there, the object has an
extra morphology.list
attribute, to enable piping into additional
describe()
calls.
Remove all morphology object attributes to allow garbage collection
finalise(.x)
finalise(.x)
.x |
Object to remove the attributes from. |
Same object, but without the morphology attributes.
Fully penetrable spheres generator
gen_fully_penetrable_spheres( dimensions = rep(200, 3), proportion = 0.5, radius = 15 )
gen_fully_penetrable_spheres( dimensions = rep(200, 3), proportion = 0.5, radius = 15 )
dimensions |
Dimensions of the generated array. |
proportion |
Proportion of the spheres category in the generated array. |
radius |
Radius of the spheres. |
Array with fully penetrable spheres
Define what category to look at
look_at( .array, what = "voxels", of_category, in_relation_to = NULL, kernel_width = 3, kernel_shape = "diamond" )
look_at( .array, what = "voxels", of_category, in_relation_to = NULL, kernel_width = 3, kernel_shape = "diamond" )
.array |
Array to analyze. |
what |
Either |
of_category |
Vector of categories to consider. If negative, these are omitted. |
in_relation_to |
Vector of categories to consider for cross-category morphology. If negative, these are omitted. |
kernel_width |
Width of the kernel for determining connectivity. Can be a vector (row, column, layer). Not used when looking at voxels. |
kernel_shape |
Shape of the kernel for determining connectivity. Can be
|
Data frame (tibble) with x
, y
, z
and value
or component
columns.
Define what neighbours to look for
look_for(.df, neighbours = 1, within = Inf, from_border = FALSE, error = 0)
look_for(.df, neighbours = 1, within = Inf, from_border = FALSE, error = 0)
.df |
Data frame with |
neighbours |
Number of nearest neighbours to look for. Can be |
within |
Maximum search distance. |
from_border |
Look for neighbours of border voxels. Defaults to TRUE. If FALSE, minus sampling is performed. |
error |
Approximate error bound, for approximate nearest neighbour search. |
List with the distance
matrix and xyz
data frame. When looking at
components, additionally a connected
matrix.
Define what direction to look in
look_in(.df, direction = "xyz", every = 1)
look_in(.df, direction = "xyz", every = 1)
.df |
Data frame with |
direction |
Direction to consider. Either 1D ( |
every |
Value indicating how many voxels to consider, e.g. one of two
( |
Data frame (tibble) with x
, y
, and/or z
, and value
or
component
columns.
Calculate the 0.05 quantile
q05(...)
q05(...)
... |
Arguments passed to the |
Sample quantile.
Calculate the 0.25 quantile
q25(...)
q25(...)
... |
Arguments passed to the |
Sample quantile.
Calculate the 0.50 quantile
q50(...)
q50(...)
... |
Arguments passed to the |
Sample quantile.
Calculate the 0.75 quantile
q75(...)
q75(...)
... |
Arguments passed to the |
Sample quantile.
Calculate the 0.95 quantile
q95(...)
q95(...)
... |
Arguments passed to the |
Sample quantile.
Scale the morphological description
scale_by(df, ...)
scale_by(df, ...)
df |
Data frame |
... |
Things to scale the description by. Can be |
Data frame with scaled neighbours
column.
Visualise the morphological description
visualise(df, ...)
visualise(df, ...)
df |
Data frame resulting from a |
... |
Arguments passed to |
A ggplot2 plot.