SebastiaanRam / artistoo

CPM implementation in pure javascript (Node module)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Artistoo (Artificial Tissue Toolbox)

Implements a simple Cellular Potts Model in JavaScript. Code includes the extension for cell migration published in

Ioana Niculescu, Johannes Textor, Rob J. de Boer: Crawling and Gliding: A Computational Model for Shape-Driven Cell Migration PLoS Computational Biology 11(10): e1004280 http://dx.doi.org/10.1371/journal.pcbi.1004280

Note: Artistoo was formerly called CPMjs.

Documentation Inline docs

You can find full documentation of available methods here, or have a look at the manual for tutorials to get started. Alternatively, see below for a brief description and a list of examples.

How it works

This code has been ported over from our older "cpm" repository. This is now an ES6 module, which is compiled trough "rollup" for use in the browser. Users who wish to use this version of Artistoo can use the compiled code in the build/ folder as it is; there is no need to compile anything. See below for examples and how to use them.

Developers can extend the code with their own modules; documentation will follow later (see the Makefile).

Browser examples

Artistoo can be used to create interactive simulations in the webbrowser. We have implemented several examples showing various processes that can be simulated with a CPM; see the links below. (Please note that these examples may not work properly in Internet Explorer).

We have the following examples for web-browser CPMs (see also examples/html):

We also have a few examples of plain cellular automata (CAs):

Node examples

Simulations can also be run from the command line using nodejs. The first time you do this, you have to install several dependencies. Go to the base folder of this package and run

npm install

which will automatically install the dependencies as supplied in the package.json file.

Here's an example of how to run the node script:

cd examples/node
node run-ActModel.js

This may give an error the first time, because the script is trying to store images of the simulation to a file output/img/ActModel which does not exist. Create this directory and try again:

mkdir -p output/img/ActModel
node run-ActModel.js

This will print some output to the console; typically the centroid of each cell at each timepoint. See the node script and the Simulation class for details.

To create a movie, run:

mkdir -p output/mp4
ffmpeg -r 60 -f image2 -i output/img/ActModel/ActModel-t%d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p output/mp4/ActModel.mp4

About

CPM implementation in pure javascript (Node module)

License:MIT License


Languages

Language:JavaScript 90.5%Language:HTML 7.6%Language:CSS 1.6%Language:Shell 0.2%Language:Makefile 0.1%