JSON:API Holo3 Reference

We describe in this document the requests/responses interface using the JSON:API specs.

1. Resources

1.1. Cases

Definition

Cases represent an acquisition of data by polymap

1.2. Config

Definition

Configuration of acquisition. It defines the setup of polymap for a set of measurements. A config may be shared by by different cases

2. Interface

2.1. Retrieve all cases

This is a basic request retrieves all cases stored on the server

GET /cases HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
 "data": [
  {
   "attributes": {
    "coordinates": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/deformed/MetricData/0.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/deformed/MetricData/1.hbf"
    },
    "has_contrast": "0",
    "has_coordinates": "1",
    "has_intensity": "0",
    "has_phase": "0",
    "has_slopes": "1",
    "has_surface": "0",
    "name": "deformed",
    "path": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/deformed",
    "slopes": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/deformed/MetricData/2.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/deformed/MetricData/3.hbf"
    }
   },
   "id": "deformed",
   "links": {
    "self": "http://cemosis.feelpp.org:8080/cases/deformed"
   },
   "type": "cases"
  },
  {
   "attributes": {
    "coordinates": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalonSin/MetricData/0.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalonSin/MetricData/1.hbf"
    },
    "has_contrast": "0",
    "has_coordinates": "1",
    "has_intensity": "0",
    "has_phase": "0",
    "has_slopes": "1",
    "has_surface": "1",
    "name": "mesureEtalonSin",
    "path": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalonSin",
    "slopes": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalonSin/MetricData/2.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalonSin/MetricData/3.hbf"
    },
    "surface": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalonSin/MetricData/10.hbf"
   },
   "id": "mesureEtalonSin",
   "links": {
    "self": "http://cemosis.feelpp.org:8080/cases/mesureEtalonSin"
   },
   "type": "cases"
  },
 ]
}

2.2. Retrieve a specific case

This is a basic request retrieves the specific case angle0 stored on the server.

GET /cases/angle0 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

{
 "data": [
  {
   "attributes": {
    "contrast": {
     "x": [
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/1008.hbf",
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/3008.hbf",
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/5008.hbf"
     ],
     "y": [
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/2008.hbf",
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/4008.hbf",
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/6008.hbf",
      "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/7008.hbf"
     ]
    },
    "coordinates": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/MetricData/0.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/MetricData/1.hbf"
    },
    "has_contrast": "1",
    "has_coordinates": "1",
    "has_intensity": "0",
    "has_phase": "1",
    "has_slopes": "1",
    "has_surface": "1",
    "name": "angle0",
    "path": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0",
    "phase": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/70002.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/PostProcData/80002.hbf"
    },
    "slopes": {
     "x": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/MetricData/2.hbf",
     "y": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/MetricData/3.hbf"
    },
    "surface": "/home/prudhomm/scratch/feelpp/holo3/Release/src/feelpp/surface_reconstruction/surface_rec/mesureEtalon2020/angle0/MetricData/10.hbf"
   },
   "id": "angle0",
   "links": {
    "self": "http://cemosis.feelpp.org:8080/cases/angle0"
   },
   "type": "cases"
  }
 ]
}

2.3. Post a new configuration

This is a basic request configures the server with a new polymap configuration.

POST /config HTTP/1.1

{
 "data": {
  "attributes": {
   "coordinates": {
    "x": "1.hbf",
    "y": "2.hbf"
   },
   "resolution": {
    "nx": "100",
    "ny": "100",
    "pixelsize": "4e-3"
   },
   "use-coordinates": false
  },
  "id": "1",
  "type": "config"
 }
}
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

2.4. Compute surface from slopes

This request computes the surface from the slopes.

GET /work/[id] HTTP/1.1
Content-Type: application/vnd.api+json

Success will generate the following response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

2.5. Compute quality metrics

This request computes the quality metrics from phase and contrast.

GET /quality/[id]/[metric] HTTP/1.1
Content-Type: application/vnd.api+json

metric can be of the following values:

  • contrast-low

  • phase-spikes

  • phase-border

Success will generate the following response

HTTP/1.1 200 OK
Content-Type: application/vnd.api+json

References