cpp_transform: Matrix Transformation

View source: R/RcppExports.R

cpp_transformR Documentation

Matrix Transformation

Description

Function to normalize, colorize and add background to images.

Arguments

mat

NumericMatrix.

color

NumericVector, whose members are h,s,v color. This vector has to be named with 1st name being the name of this color.

msk

IntegerMatrix.

size

a length 2 IntegerVector, of final dimensions (height,width) of the image. Default is 0,0 for no change.

mode

string, color mode export. Either "rgb", "gray" or "raw". Default is "raw".

type

uint16_t image object type. Default is 2.

input_range

a finite NumericVector, only apply when 'mode' is not "raw", sets the range of the input intensity values. Values outside this range are clipped. Default is [0.0,4095.0].

add_noise

bool, whether to add normal noise or not. Default is true.

bg

double, mean value of the background added if 'add_noise' is true. Default is 0.0.

sd

double, standard deviation of the background added if 'add_noise' is true. Default is 0.0.

full_range

bool, only apply when 'mode' is not "raw", if 'full_range' is true, then 'input_range' will be set to [0.0,4095.0] and 'gamma' forced to 1.0. Default is false.

force_range

bool, only apply when 'mode' is not "raw", if 'force_range' is true, then 'input_range' will be adjusted to object range in [-4095.0, +inf] and 'gamma' forced to 1.0. Default is false.
Note that this parameter takes the precedence over 'input_range' and 'full_range'.

gamma

correction. Default is 1.0, for no correction.

spatialX

X offset correction. Default is 0.0 for no change.

spatialY

Y offset correction. Default is 0.0 for no change.

Details

When a mask is detected, 'add_noise', 'full_range' and 'force_range' are set to false, 'bg' and 'sd' to 0.0, 'input_range' to [0.0,3.0] and 'gamma' to 1.0.

Experimental (as of v0.2.0.501): when 'mode' is not "raw", if 'input_range' is within ]0,1[, it will be used as 'probs' argument to quantile to determine clipping range from image object, in addition, 'gamma' will be forced to 1.0.


IFC documentation built on Sept. 14, 2023, 1:08 a.m.