Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.57 KB

README.md

File metadata and controls

42 lines (32 loc) · 1.57 KB

CPD-service

❗ This repository is a mirror of the now archived original CPD-service. Further development occurs here. ❗

A microservice, built with flask, to run the Coherent Point Drift (CPD) method, a point set registration algorithm by Myronenko and Song (2010), to estimate the spatial transformations affecting spatiotemporal phenomena. This microservice is part of the SpatioTemporal Features eXtractor (stfX). Section 5.2.1 of the thesis associated to the stfX contains a detailed description of this microservice architecture, guidelines and API.

To run the CPD method, we utilise pycpd.

Usage example

Example of a request to this microservice:

curl -d '{"X": [[10, 10],[10, 11],[11, 11],[11, 10]], "Y": [[0, 0],[0, 1],[1, 1],[1, 0]]}' -H "Content-Type: application/json" -X POST http://localhost:5000/cpd
  • X: represents the target point set
  • Y: represents the moving point set (the one to be altered)

The respective response, in json:

{
    "rotation": 0.0,
    "scale": 0.002487577505966565,
    "translation": [10.498756211247015, 10.498756211247013]
}

Running Instructions

  • Using Docker:
docker build -t cpd-service . --no-cache
docker run -p 5000:5000 cpd-service
  • Using command line:
python -m venv venv
. venv/bin activate
sh init.sh