AddImage

Add a new image and properties associated with it.

An encoded image must be provided in the array of blobs.

Parameters

Details

properties are key-value pairs associated with the entity. Check properties for more details.

if_not_found can be used to turn this command into “conditional add”. Check if_not_found for more details.

connect can be used to create a connection between the added object and other object(s). Check connect for more details.

The format parameter can be used to re-encode the image into a format different from the original one passed in the array of blobs.

Operations can be specified through the operations parameter, all of which will be performed before persisting the image in ApertureDB.

Examples

Insert an image, save it as png, and apply a threshold operation before storing:

[ {
    "AddImage": {
        "properties": {
            "type": "scan",
            "part": "brain"
        }
        "format": "png",
        "operations": [
            {
                "type": "threshold",
                "value": 155
            }
        ]
    }
} ]

# A blob must be passed together with the JSON Query.

Insert an image as a JPG, rotate 45.6 degrees, and create a connection to a “Patient” referenced using FindEntity:

[ {
    "FindEntity": {
        "_ref": 1,
        "with_class": "patient",
        "constraints" : {
            "unique_id": [ "==", "TCGA-02-0070" ]
        }
    }
}, {
    "AddImage": {
        "format": "jpg",
        "operations": [
            {
                "type": "rotate",
                "angle": 45.6
            }
        ],
        "connect": {
            "ref": 1,
            "class": "ScanToPatient",
            "direction": "in"
       }
    }
} ]

# A blob must be passed together with the JSON Query.