binning {tofsims} | R Documentation

## binning

### Description

binning

### Usage

    binning(object, binningFactor, ...)

    ## S4 method for signature 'MassImage'
    binning(object, binningFactor = 2)

### Arguments

`object` | object of class MassImage
`binningFactor` | numeric factor for binning (2, 4, etc)
`...` | additional args

### Details

bining is used to reduce the resolution/size of MassImage objects. Optionally `mclapply` from the parallel package is used to speed up processing time.

### Value

binned object of class MassImage

### Examples

    library(BiocParallel)
    testImage<-MassImage('dummy')
    par(mfcol=c(1,2), oma=c(0,0,0,0), mar=c(0,0,0,0))
    image(testImage)
    ## the following param will cause to run non parallel
    register(SerialParam(), default=TRUE)
    testImage <- binning(testImage,binningFactor = 4)
    image(testImage)
    ## Not run:
    library(tofsimsData)
    data(tofsimsData)
    par(mfcol=c(1,2), oma=c(0,0,0,0), mar=c(0,0,0,0))
    image(testImage)
    testImage <- binning(testImage,binningFactor = 4)
    image(testImage)
    ## End(Not run)

[Package tofsims version 1.16.0 Index]