Version: 1.0.0
Release date: 15 June 2024
As the core algorithms for the paper Constructing and Using Cell Type Populations for the Human Reference Atlas, generating 3D cells inside anatomical structures includes two steps: estimating the number of cells in anatomical structures and generating the location of the cells inside the anatomical structures. We design an algorithm for the cell type estimation based on the experimental datasets by using the collision detection API https://github.com/hubmapconsortium/hra-tissue-block-annotation as well as a 3D cell generation algorithm using the Computational Geometry Algorithm Library (CGAL). This project provides
- the proposed algorithm for randomly generate 3D cell locations inside any mesh of anatomical structures using CGAL.
- an Node.js API using Express to generate 3D cells given the distribution of the cells and the mesh of the anatomical structure.
-
CMake
sudo apt-get cmake
-
Boost
sudo apt-get update sudo apt-get install libboost-all-dev
-
GMP
sudo apt-get install libgmp-dev
-
MPFR
sudo apt-get install libmpfr-dev
-
CGAL
sudo apt-get install libcgal-dev
-
Eigen3
sudo apt install libeigen3-dev
-
Node Dependencies
npm ci
We use CMake to configure the program with third-party dependencies and generate the native build system by creating a CMakeLists.txt file.
- for C++ server:
Then, copy the binary executable to the main directory
cd $server mkdir build cd build cmake .. make
cp generate_cell_ctpop ../../
- Start Node.js API:
npm start
POST http://server_ip:port/mesh-3d-cell-population
- JSON request example:
{
"file": "https://cdn.humanatlas.io/digital-objects/ref-organ/kidney-female-left/v1.3/assets/3d-vh-f-kidney-l.glb",
"file_subpath": "VH_F_renal_pyramid_L_a",
"num_nodes": 10,
"node_distribution": {
"KEY1": 0.1,
"KEY2": 0.3
}
}
- Request as a CURL command:
curl -d '@examples/test-request.json' -H "Content-Type: application/json" -X POST http://localhost:8080/mesh-3d-cell-population
- CSV/text response example:
x,y,z,Cell Type
0.0579039,0.269139,-0.103702,KEY1
0.0532916,0.258096,-0.104511,KEY2
0.0520264,0.279228,-0.110894,KEY2
0.0568783,0.264194,-0.10985,KEY2
A docker container for the API can be built locally:
docker build . -t hra-3d-cell-generation-api
And run locally:
docker run -p8080:8080 -it hra-3d-cell-generation-api
The deployed version of this API is at https://apfvtab7fp.us-east-2.awsapprunner.com/mesh-3d-cell-population . You can use the same CURL command to test:
curl -d '@examples/test-request.json' -H "Content-Type: application/json" -X POST https://apfvtab7fp.us-east-2.awsapprunner.com/mesh-3d-cell-population