digitizeProfiles: Digitization

Description Usage Arguments Details Value Author(s) Examples

View source: R/spheroid.R

Description

Digitize 2D section profiles

Usage

1
digitizeProfiles(sp, delta = 0.01, win = NULL)

Arguments

sp

list of section profiles, see intersectSystem

delta

lattice constant for discretization of section profiles

win

list of length two, the intersection window, default NULL

Details

A list of section profiles, e.g. discs, ellipses or segments from intersected spherocylinders, is digitized according to a given resolution according to the lattice constant delta such that the result is an integer matrix which can be interpretated as a binary image. An intersection window can be either provided by the user w.r.t. [l,u]^2 where l,u are lower, respectively, upper bounds of corresponding to a simulation box, or, it is taken from the section profiles sp which stores the intersection window as an attribute.

Value

binary (integer) matrix as an image

Author(s)

M. Baaske

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 # simulation box
 box <- list("xrange"=c(0,5),"yrange"=c(0,5),"zrange"=c(0,5))
 # (exact) bivariate size-shape (isotropic) orientation distribution (spheroids)
 theta <- list("size"=list("mx"=-2.5,"my"=0.5, "sdx"=0.35,"sdy"=0.25,"rho"=0.15),
               "orientation"=list("kappa"=1))

 # return only 3D system
 S <- simPoissonSystem(theta,lam=100,size="rbinorm",box=box,type="prolate",
       intersect="original",n=c(0,1,0),mu=c(0,0,1),perfect=TRUE,pl=1)

 # vertical intersection w.r.t. 'mu' (z axis, see above)
 sp <- intersectSystem(S, 2.5)

 # show intersecting window
 win <- attr(sp,"win")

 # digitize (could also pass some 'win' as an argument) 	
 W <- digitizeProfiles(sp, delta=0.01, win = NULL)  
 image(1:nrow(W),1:ncol(W),W,col=gray(1:0))

unfoldr documentation built on Sept. 25, 2021, 1:07 a.m.