bwApply: bwApply

Description Usage Arguments Value Examples

Description

bwApply allow to get new object from a black / white matrix All NZs at black positions will be taken

Usage

1
2
3
4
bwApply(object, bwMatrix)

## S4 method for signature 'MassSpectra,matrix'
bwApply(object, bwMatrix)

Arguments

object

object of class MassImage

bwMatrix

matrix with boolean or numeric 1 and 0

Value

object of class MassImage multiplied with B/W matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(tofsimsData)
data(tofsimsData)
testImage <- PCAnalysis(testImage, nComp = 2)
library(EBImage)
mask<-thresh(imageMatrix(analysis(testImage,noAccess = 1),comp = 1), w = 15, h = 15)
#inverse of mask
mask <- (mask-1)^2
par(mfcol=c(1,2), oma=c(0,0,0,0), mar=c(0,0,0,0))
image(testImage)
image(bwApply(testImage, mask))

tofsims documentation built on Nov. 8, 2020, 5:10 p.m.