Sample view REST API#

GET /mxcube/api/v0.1/sampleview/camera/subscribe#
Subscribe to the camera streaming
response:

image as html Content-type

PUT /mxcube/api/v0.1/sampleview/camera/unsubscribe#
SampleCentring: unsubscribe from the camera streaming
statuscode:

200: no error

statuscode:

409: error

POST /mxcube/api/v0.1/sampleview/camera/snapshot#

Take snapshot of the sample view data = {“overlay”: overlay_data} overlay is the image data to overlay on sample image, it should normally contain the data of shapes drawn on canvas. Return: Overlayed image uri, if successful, statuscode 500 otherwise.

GET /mxcube/api/v0.1/sampleview/camera#
Get size of the image of the diffractometer
response Content-type:application/json, example:

{ “imageHeight”: 576, “imageWidth”: 768, “pixelsPerMm”: [1661.1295681063123, 1661.1295681063123] } :statuscode: 200: no error :statuscode: 409: error

POST /mxcube/api/v0.1/sampleview/camera#
PUT /mxcube/api/v0.1/sampleview/centring/(point_id)/moveto#
Move to the given centred position.
parameter id:

centred position identifier, integer

statuscode:

200: no error

statuscode:

409: error

GET /mxcube/api/v0.1/sampleview/shapes#
Retrieve all the stored centred positions.
response Content-type:

application/json, the stored centred positions.

statuscode:

200: no error

statuscode:

409: error

GET /mxcube/api/v0.1/sampleview/shapes/(sid)#
Retrieve requested shape information.
response Content-type:

application/json, the stored centred positions.

statuscode:

200: no error

statuscode:

409: shape not found

POST /mxcube/api/v0.1/sampleview/shapes/(sid)#
Update shape result data.
parameter shape_data:

dict with result info (result value dict, data file path)

response Content-type:

application/json, response status.

statuscode:

200: no error

statuscode:

409: error

POST /mxcube/api/v0.1/sampleview/shapes#
Update shape information.
parameter shape_data:

dict with shape information (id, type, …)

response Content-type:

application/json, the stored centred positions.

statuscode:

200: no error

statuscode:

409: error

DELETE /mxcube/api/v0.1/sampleview/shapes/(sid)#
Retrieve all the stored centred positions.
response Content-type:

application/json, the stored centred positions.

statuscode:

200: no error

statuscode:

409: error

POST /mxcube/api/v0.1/sampleview/shapes/rotate_to#

Rotate Phi to the position where the given shape was defined

parameter sid:

The shape id

response Content-type:

application/json, the stored centred positions.

statuscode:

200: no error

statuscode:

409: error

GET /mxcube/api/v0.1/sampleview/centring/startauto#
Start automatic (lucid) centring procedure.
statuscode:

200: no error

statuscode:

409: error

PUT /mxcube/api/v0.1/sampleview/centring/start3click#
Start 3 click centring procedure.
statuscode:

200: no error

statuscode:

409: error

PUT /mxcube/api/v0.1/sampleview/centring/abort#
Abort centring procedure.
statuscode:

200: no error

statuscode:

409: error

PUT /mxcube/api/v0.1/sampleview/centring/click#

The 3-click method needs the input from the user, a running 3click centring procedure must be set before

Request Content-type:

application/json, integer positions of the clicks, {clickPos={“x”: 123,”y”: 456}}

Response Content-type:

application/json, integer, number of clicks left {‘clickLeft’: 3 | 2 | 1}

Statuscode:

200: no error

Statuscode:

409: error

PUT /mxcube/api/v0.1/sampleview/centring/accept#

Accept the centring position.

PUT /mxcube/api/v0.1/sampleview/centring/reject#

Reject the centring position.

PUT /mxcube/api/v0.1/sampleview/movetobeam#

Go to the beam position from the given (x, y) position.

PUT /mxcube/api/v0.1/sampleview/centring/centring_method#

Set MXCuBE to use automatic (lucid) centring procedure when mounting samples

Statuscode:

200: no error

Statuscode:

409: error