bwApply {tofsims} | R Documentation

## bwApply

### Description

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

### Usage

    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

    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))

[Package tofsims version 1.8.0 Index]