FindImage

Find images that satisfy the specified constraints.

This command enables visual operations, using the operations block.

Images are returned as blobs in the array of blobs.

Parameters

  • [optional] _ref: Reference to be used within the transaction.
  • [optional] unique: Indicates whether a single object is expected to satisfy the constraints.
  • [optional] format: Specify the format of the returned image.

Blocks

Details

The format parameter can be used to re-encode the image in a format different from the one stored in ApertureDB. The encoding will be performed on-the-fly and will not affect the original image stored in ApertureDB. By default, the images will be returned in its original format.

Operations defined in the operations block will be performed on-the-fly and will not affect the original image stored in ApertureDB.

By default, the blob corresponding to the encoded image will be returned in the array of blobs:. It is possible to specify the blob not to be returned by setting the “blob” flag to “false” in the results block.

Examples

Find images which has the “year_captured” property less than 1970, and resize them to 224x224, and retrieve the “year_captured” property for each image:

[ {
    "FindImage": {
        "constraints" : {
            "year_captured": [ "<=", 1970 ]
        },
        "operations": [
            {
                "type": "resize",
                "width":  224,
                "height": 224
            }
        "result": {
            "list": ["year_caputured"]
        }
    }
}]

Find all the images connected to an Entity of class “Patient” with a specific “patient_id” property, resize the images to 1024x1024, and encode the images using “png” format:

[ {
    "FindEntity": {
        "_ref": 1,
        "class": "Patient",
        "unique": true,
        "constraints" : {
            "patient_id": [ "==", "TCGA-02-0070" ]
        }
    }
},{
    "FindImage": {
        "link": {
           "ref": 1,
        },
        "format": "png",
        "operations": [
            {
                "type": "resize",
                "width":  1024,
                "height": 1024
            }
        ]
    }
}]