import BorderPixelsByCell from 'Artistoo/src/stats/BorderPixelsByCell.js'
public class

# BorderPixelsByCell

#### Extends:

Stat → BorderPixelsByCell

This Stat creates a CellArrayObject with the border cellpixels of each cell on the grid. Keys are the CellId of cells on the grid, corresponding values are arrays containing the pixels belonging to that cell. Coordinates are stored as ArrayCoordinate.

#### Example:

let CPM = require( "path/to/build" )

// Make a CPM, seed a cell, and get the BorderPixelsByCell
let C = new CPM.CPM( [100,100], {
T:20,
J:[[0,20],[20,10]],
V:[0,200],
LAMBDA_V:[0,2]
} )
C.setpix( [50,50], 1 )
C.getStat( CPM.BorderPixelsByCell )

## Member Summary

 Public Members public M: CPM The CPM to compute borderpixels for. public set model(M: CPM) The set model function of BorderPixelsByCell requires an object of type CPM.

## Method Summary

 Public Methods public The compute method of BorderPixelsByCell creates an object with the borderpixels of each cell on the grid.

## Inherited Summary

 From class Stat public set model(M: GridBasedModel) Every stat is linked to a specific model. public The model to compute the stat on. public Configuration object for the stat, which should not change its value but may be used for logging and debugging options. public abstract compute() The compute method of the base Stat class throws an error, enforcing that you have to implement this method when you build a new stat class extending this base class.

## Public Members

### publicM: CPM source

The CPM to compute borderpixels for.

Stat#M

### publicsetmodel(M: CPM) source

The set model function of BorderPixelsByCell requires an object of type CPM.

Stat#model

## Public Methods

### publiccompute(): CellArrayObject source

The compute method of BorderPixelsByCell creates an object with the borderpixels of each cell on the grid.

Stat#compute

#### Return:

 CellArrayObject An object with a key for each cell on the grid, and as corresponding value an array with all the borderpixels of that cell. Each pixel is stored by its ArrayCoordinate.