Hello, this project intends to bridge imageJ and nodeJs, the main idea is to create a wrapper so we can run imageJ in nodeJs. CellCounter does what it's name says, it count cells for a given folder following a defined algorithm. BUT the project is designed to be able to host many more algorithms and particularities, so feel free to contribute!
We need to specify an input folder and then for each image inside that folder the algorithm will run, in this example we show the steps taken by the cell counter from an input image, see the following:
-
So we have a folder filled with photos such as the following:
Format: -
We configure cell-Counter to use that directory with a .env file (there is an .env_example feel free to rename it to .env) see
-
We output the result into the output directory in this case the following image with its csv.
| #Cell | Area |
|---|---|
| 1 | 35 |
| 2 | 34 |
| 3 | 27 |
| 4 | 44 |
| ... |
This project is intended to be used with the latest Active LTS release of Node.js.
- Install NodeJs
- Install npm
- Download ImageJ (Fiji) from here link
- Unzip Fiji anywhere you want
- Download the source code of this project as a zip or with git
- open a terminal and navigate to the project
- execute "npm i"
- rename .env_example to .env and check the compulsory properties and optionals are for the algorithm to run.
- place the needed configurations into the .env file you might need to comment some lines
- run "npm build"
- run "npm start"
- examine the results, you are now free to touch stuff like FILTER_MIN_SIZE or FILTER_GAUSS_SIGMA to have better results depending on your data.
If you think that your work can be usefull to others (which im sure it will) why not add it here? it easy:
- Add a new folder with a descreptive name inside /src/algorithms/
- Create a new class and extend from AlgorithmToRun
- Specify what params are needed in order to run this algorithm in the method hasValidInputConfig().
- Transform and add information to your custom class with the method loadConfig().
- At last create the sequence of instructions in img nedded using the start(ij: IImageJ, NodeJavaCore: NodeAPI) method.
- Remember to test everything expect start in the class with a unit test.
- Remember to add good E2E tests to check that the exepcted behaviour is covered.
From there create a pull request and BANG! antoher algorithm added!
clean- remove coverage data, Jest cache and transpiled files,build- transpile TypeScript to ES6,start- runs ImageJ with the inputs given in the .env file,build:watch- interactive watch mode to automatically transpile source files,lint- lint source files and tests,test- run tests,test:watch- interactive watch mode to automatically re-run teststest:debug- to debug using google's chromium console.
The initial code is based on imagej/imagej-node
Licensed under the APLv2. See the LICENSE file for details.

