where
Contents: Description, Arguments, Usage, Examples Supported Under Version: >1.69 Current Davinci Version: 2.27 64-bit Safe: No
Description Partial replacement for arrays. This is not a function in the normal sense.
Arguments and Return Values Arguments: A boolean expression involving an array; must be used in conjunction with an array assignment (see below) Return Value: Returns new array
Usage The unary operator 'where' provides partial array replacement, based on a boolean expression. The 'where' operator can only be used during array assignment, and only on a named array. The Syntax is as follows: array [ where expr1 ] = expr2 Array is a named array. Expr1 must evaluate to an array with the same organization and dimensions as array, and where expr1 is true, the corresponding element of array is replaced with the value of expr2. Expr2 must be a single value.
"array" is a named array "?=" is a boolean operator (e.g. >=) "value" is the test value (a 1x1x1 array)
dv> data[ where (data < 0) ] = 0
Examples dv> x = create(7) - 3 7x1x1 array of int, bsq format [28 bytes] -3 -2 -1 0 1 2 3 dv> x[where x<0] = 0 7x1x1 array of int, bsq format [28 bytes] 0 0 0 0 1 2 3 dv> image[where stddev(image) > 3] = 0 |
DavinciWiki Mini-Nav Bar Contents
Contact Developers
All other topics
Recent Core Changes Modified On: 06-24-2008 |