cross_ratio: 3D cross-ratio

View source: R/cross_ratio.R

cross_ratioR Documentation

3D cross-ratio

Description

Function to calculate 3D cross-ratio between three channels. The ratio is between first and second target channel at the distance from the focal channel.

Usage

cross_ratio(
  imgs,
  focal.channel,
  target.channels,
  size,
  npixel,
  R = 10,
  dstep = 1,
  pwidth,
  zstep,
  cores = 1,
  kern.smooth = NULL,
  layers = NULL,
  naming = NULL
)

cross_ratio.default(
  imgs,
  focal.channel,
  target.channels,
  size,
  npixel,
  dstep = 1,
  pwidth,
  zstep,
  cores = 1,
  kern.smooth = NULL,
  layers = NULL,
  naming = NULL
)

Arguments

imgs

The paths of array files; i.e. output from loadIMG or findIMG functions.

focal.channel

Character of name of channel of focus.

target.channels

Character vector with names of the two target channels to calculate cross-ratio between

size

The maximum distance (microns) to examine. Has to be a multiple of both pwidth and zstep. Beware, increasing size will increase runtime exponetially!

npixel

Number of random pixels to examine. Increasing this will increase precision (and runtime in a linear fashion)

R

Number of times to run the cross-ratio analysis

dstep

The interval between examined distances (microns). Increasing this decreases resolution but speeds up function linearly. Defaults to 1

pwidth

Width of pixels in microns

zstep

z-step in microns

cores

The number of cores to use.Defaults to 1

kern.smooth

Optional. Numeric vector indicating range of median smoothing in the x,y,z directions. Has to be odd intergers. c(1,1,1) means no smoothing.

layers

Optional. Should the function only look in a subset of layers. A list with lists of layers to use for each image. Can also be the output from extract_layers

naming

Optional. Add metadata to the output dataframe by looking through names of array files. Should be a list of character vectors, each list element will be added as a variable. Example: naming=list(Time=c("T0","T1","T2")). The function inserts a variable called Time, and then looks through the names of the array files and inserts characters mathcing either T0, T1 or T2

Value

A dataframe with the cross-ratio values for each distance


Russel88/RCon3D documentation built on Dec. 14, 2022, 11:06 p.m.