Comparison: Relational operators for antsImage

Description Usage Arguments Details Value Author(s) Examples

Description

Relational operators to compare pixel values of an antsImage with a scalar value within a given antsRegion.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
img == value
img != value
img <= value
img >= value
img < value
img > value

img == lst
img != lst
img <= lst
img >= lst
img < lst
img > lst

Arguments

img

Image object of S4 class 'antsImage' to be indexed.

value

Scalar numeric to be compared to the pixel values.

lst

list of named arguments containing names 'value' and 'region'. lst$value is used as 'value' and lst$region is used as the antsRegion within the image for comparison.

Details

img == value

Image-region considered is the largest-possible-region( entire image ) of the image.

Value

logical vector of dimensions equal to that of 'region' considered – Success ; NA – Failure

Author(s)

Shrinidhi KL

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# compare all the values in the region starting at index 'c(1,1,1)' with size 'c(10,10,10)' with value '20' ;
# here the logical vector 'vect' will have dimensions '10*10*10'
reg = new( "antsRegion" , index = c(1,1,1) , size = c(10,10,10) )
vect = ( img = list( value = 20 , region = reg ) )
# compare all the pixels in the image with value '30' ;
# here the logical vector 'vect' will have dimensions of the image
vect = ( img == 30 )

## End(Not run)

klshrinidhi/ANTsR documentation built on May 20, 2019, 12:37 p.m.