calcContrast {MaxContrastProjection} | R Documentation

## Calculate Local Image Contrast

### Description

Calculate the local contrast of an input image for every pixel of the image over a given window centered on that pixel.

### Usage

    calcContrast(image, w_x, w_y, brushShape = "disc", validate = TRUE)

### Arguments

`image` | A numeric 2D matrix-like on which the contrast should be determined
`w_x` | The size of the window in x-direction
`w_y` | The size of the window in y-direction
`brushShape` | A string indicating the shape of the window. Currently supported values are `"box", "disc"` and the default is "disc".
`validate` | A boolean value indicating if the variables need to be validated or if this function is being called internally, i.e. the variables have already been validated once. This is only used to marginally speed up internal calls to functions and has no bearing on the actual functionality of the method.

### Details

The local contrast is calculated for every pixel of `image`. This means that a window is centered around a given pixel and the variance of the intensity values within this window are determined via Var = E[X^2] - (E[X])^2.

The `brushShape` indicates the shape of the window over which to calculate the variance. Depending on the symmetry of the objects being imaged, the window shape may have a significant impact on the quality of the projection.

### Value

A 2D matrix with the same dimensions as `image`, which shows the local contrast at each corresponding pixel of `image`.

### Author(s)

Jan Sauer

### Examples

    print(calcContrast)

[Package MaxContrastProjection version 1.6.1 Index]