AIAA Server APIs


Once you have AIAA server running, you can also check detailed schema for every API at:$LOCAL_PORT/docs. The $LOCAL_PORT is the port you use when launching the container in Installation.


Admin APIs are host controlled. When you start the AIAA server you can use --admin_hosts option to specify from which client hosts you can invoke the following APIs. The default is * which means no restrictions, that is every client can invoke Admin APIs.

Following are the important ones:


GET Model

You can get the current configuration for a given model by using this command.

curl -X GET "$LOCAL_PORT/admin/model/clara_ct_seg_spleen_amp" \
     -H "accept: application/json"


If you want to update the config only (without updating the model), you can do so by refreshing the configs and reloading an existing model with new configs.

curl -X PATCH "$LOCAL_PORT/admin/model/clara_ct_seg_spleen_amp" \
     -H "Content-Type: application/json" \
     -d @config_aiaa.json

PUT Model

This API will help to load a model into AIAA server.

curl -X PUT "$LOCAL_PORT/admin/model/clara_ct_seg_spleen_amp" \
     -F "config=@config_aiaa.json;type=application/json" \
     -F "data=@model.trt.pb"


Refer to Loading Models for detailed usage of loading a model.


You can remove the model from AIAA server using this API.

curl -X DELETE "$LOCAL_PORT/admin/model/clara_ct_seg_spleen_amp"


If you have multiple AIAA server running and they share common workspace for saving all the models and configurations, you should enable --auto_reload option while starting the AIAA Server. This will help to keep all the AIAA Server in sync when a model is loaded/updated/removed.


APIs that are designed for all regular clients.


List models loaded in AIAA Server

# Query All Models
curl -X GET "$LOCAL_PORT/v1/models"

# Query Matching Models for a given Label and Type
curl -X GET "$LOCAL_PORT/v1/models?label=spleen&type=segmentation"

# Query Specific Model
curl -X GET "$LOCAL_PORT/v1/models?model=clara_ct_seg_spleen_amp"


Run Segmentation model in AIAA Server for an input image.

curl -X POST "$LOCAL_PORT/v1/segmentation?model=clara_ct_seg_spleen_amp&output=image" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params={}" \
     -F "image=@spleen.nii.gz;type=application/x-gzip" \
     -o output_image.nii.gz


Run DExtr3D in AIAA Server for an input image and extreme points.

curl -X POST "$LOCAL_PORT/v1/dextr3d?model=clara_ct_annotation_spleen_amp&output=image" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params={\"points\":\"[[93,106,64],[40,108,64],[29,66,64],[47,20,64],[93,32,64],[99,68,64]]\"}" \
     -F "image=@cropped_spleen.nii.gz;type=application/x-gzip" \
     -o output_image.nii.gz


Run DeepGrow in AIAA server given foreground/background points.

curl -X POST "$LOCAL_PORT/v1/deepgrow?model=clara_deepgrow&output=image" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params={\"foreground\":\"[[155, 189, 78], [184, 192, 78], [114,225,78]]\", \"background\":\"[]\"}" \
     -F "image=@spleen.nii.gz;type=application/x-gzip" \
     -o output_image.nii.gz


Run inference on any generic model in AIAA server.

Please refer to Model Config for details on type of models supported in AIAA.

curl -X POST "$LOCAL_PORT/v1/inference?model=my_model&output=image" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params={\"mydata\":[1,2,3]}" \
     -F "image=@spleen.nii.gz;type=application/x-gzip" \
     -o output_image.nii.gz


You can use /inference API to run model pipelines, classification models etc.


Given a 3D mask in NIFTI file, generate polygons (0 or more) on each 2D slices.

curl -X POST "$LOCAL_PORT/v1/mask2polygon" \
     -H "accept: application/json" \
     -H "Content-Type: multipart/form-data" \
     -F "params={ "more_points": 10 }" \
     -F "image=@mask2polygon.input.nii.gz;type=application/gzip"


Adjust the polygons to a better fit 2D/3D polygons.

# 2D Image/Input => Output: Result Json
curl -X POST "$LOCAL_PORT/v1/fixpolygon?output=results" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params=`cat fixpolygon.input.json`" \
     -F "image=@fixpolygon.input.png;type=image/png" \
     -o new_polygons.json

# 2D Image/Input => Output: Image
curl -X POST "$LOCAL_PORT/v1/fixpolygon?output=image" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params=`cat fixpolygon.input.json`" \
     -F "image=@fixpolygon.input.png;type=image/png" \
     -o new_mask.png

# 3D Image/Input => Output: Image
curl -X POST "$LOCAL_PORT/v1/fixpolygon?output=image" \
     -H "accept: multipart/form-data" \
     -H "Content-Type: multipart/form-data" \
     -F "params=`cat fixpolygon.3d.input.json`" \
     -F "image=@label.nii.gz;type=application/x-gzip" \
     -o new_label.nii.gz

The following is a schema for the FixPolygon input json file.




Dimension to represent 2D or 3D


Represents new polygon points (not required if vertex_offset is used)


Represents current polygon points


Represents current slice in case of 3D image


Represents modified polygon index among poly


Represents modified vertex index


Represents new vertex after adding offset (x,y) for 2D/3D


Propagation size for neighborhood


Propagation size for neighborhood in case of 3D


Clients can choose to create a session for an image to reduce the time in consecutive requests.

This is recommended if users are interacting using DExtr3D or DeepGrow API with 3D volumes. Users pay this one time cost to upload the image to the server, and the following requests will be faster because the image does not need to be uploaded again. You can specify expiry in seconds when creating a session to decide the time that this session would live.

PUT Session

Create a new AIAA session and upload an image as part of the session.

curl -X PUT "$LOCAL_PORT/session/?expiry=30" \
     -H "accept: application/json" \
     -H "Content-Type: multipart/form-data" \
     -F "image=@spleen.nii.gz;type=application/x-gzip"

You can also provided a DICOM server address so that AIAA will fetch images from there.

Let’s assume you have a DICOM server DCM4CHEE running at ip, and the AE DCM4CHEE listens on port 11112. Then you put the ip, port, ae_title and id of patient, study and series in a json file (data.json) as follows:

  "dicom": {
    "server_address": "",
    "server_port": 11112,
    "ae_title": "DCM4CHEE",
    "query_level": "PATIENT",
    "patient_id": "ProstateX-0004",
    "study_uid": "",
    "series_uid": ""

Now you can ask AIAA to fetch the data from DICOM server and create a session using the following command:

curl -X PUT "$LOCAL_PORT/session/?expiry=30" \
     -H "accept: application/json" \
     -d "@data.json"

AIAA also supports getting data using HTTP requests. Assume you have a image server running and you can download the data using a url. You can prepare a data.json file that contains this information. For example:

  "http": {
    "url": "",
    "params": {
        "format": "zip"
    "method": "GET"

Then you ask AIAA to fetch the data based on this config, that is using HTTP Get method on this url. AIAA will create the session after the data is fetched.

curl -X PUT "$LOCAL_PORT/session/?expiry=30" \
     -H "accept: application/json" \
     -d "@data.json"


AIAA utilizes pynetdicom to do c_get to fetch the data from DICOM server. You can refer to their documentation for more information.

AIAA uses requests library to handle the HTTP fetch. Please refer to request documentation for optional arguments.

GET Session

Retrieve saved session/image document available from the server.

curl -X GET "$LOCAL_PORT/session/[session_id here]?image=false" \
     -H  "accept: application/octet-stream"

DELETE Session

Close an existing session.

curl -X DELETE "$LOCAL_PORT/session/[session_id here]"