voxelize: Voxelize xyz coordinates

Description Usage Arguments Examples

View source: R/high_density.R

Description

Converts xyz coordinates in pixels to voxels of a specified µm size. The function summarizes the number of samples per group. It outputs a list where the first element ("data") is the data voxelized, and the second element ("summary") is the data summarized, i.e. the number of samples per voxel per group

Usage

1
voxelize(data, conv_factor = 5.16, voxel_size = 30)

Arguments

data

dataframe with xyz coordinates ("xPos", "yPox", "zPos") for example output of calculate_density(). It includes a variable ("sample_id") that is the quantity that will be summarizes over the group variable ("group").

conv_factor

number to be used for the conversion. The conversion factor depends on the imaging settings. For more information, see for example: https://mindresearchfacility.nl/wp-content/uploads/2019/12/Zoom-factor-and-corresponding-NA-and-resolution-by-pixel-size.pdf Defaults to 5.16

voxel_size

in µm. Defaults to 30. If you want to specify in pixels, put conv_factor = 1

Examples

1
2
3
4
5
6
x <- data.frame(
xPos = rnorm(100, 300, 100), yPos = rnorm(100, 300, 100), zPos = rnorm(100, 300, 100),
group = rep(c("control", "exp"), each = 50),
sample_id = rep(c(1:10), each = 10)
)
y <- voxelize(x, voxel_size = 100)

valeriabonapersona/abc4d documentation built on Dec. 23, 2021, 2:09 p.m.