DIPlib Documentation - ©1995-2008 Quantitative Imaging Group, Delft University of Technology.

Select

Configurable selection function

SYNOPSIS

#include "dip_math.h"

dip_Error dip_Select ( in1, in2, in3, in4, out, selector )

DATA TYPES

binary, integer, float

FUNCTION

This function can perform various pixel-by-pixel comparisons (smaller, smaller- equal, equal, not equal, greater-equal, greater) between in1 ans in2. If the result of the comparison is true, the corresponding pixel value of in3 is copied to out, otherwise it is copied from in4. In short the following operation is performed for each pixel in the five images:

out = in1 selector in2 ? in3 : in4

The images in2, in3 and in4 can be 0-D images acting as constants.

ARGUMENTS

Data typeNameDescription
dip_Imagein1First input
dip_Imagein2Second input
dip_Imagein3Third input
dip_Imagein4Fourth input
dip_ImageoutOutput
dipf_SelectselectorSelect flag
NameDescription
DIP_SELECT_LESSER<, Lesser than
DIP_SELECT_LESSER_EQUAL<=, Lesser or equal
DIP_SELECT_NOT_EQUAL!=, Unequal
DIP_SELECT_EQUAL==, Equal
DIP_SELECT_GREATER_EQUAL>=, Greater or equal
DIP_SELECT_GREATER>, Greater

SEE ALSO

Compare, Max, Min

DIPlib on-line documentation | Function reference | Global function index