FindImage

Find images that satisfy the specified constraints.

This command enables visual operations, using the operations parameter.

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] as_format: Specify the format of the returned bounding boxes [“jpg”, “png”]. By default, the images will keep their original format.
  • [optional] blobs: indicates whether the blobs will be returned as part of the response (Default: true).
  • [optional] constraints
  • [optional] is_connected_to
  • [optional] group_by_source
  • [optional] results
  • [optional] operations
  • [optional] batch

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 their original format. The only exception is when the image is stored in the “tdb” format, in which case the image will be returned as “jpg” by default.

Operations defined in operations parameter 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 blobs parameter to “false”.

If only one ref parameter is used in the is_connected_to array, the resulting objects obtained after traversing the given connection can be associated with their source objects by specifying the parameter group_by_source as true. The parameter is ignored if is_connected_to is absent. It is set to false by default.

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,
        "with_class": "Patient",
        "unique": true,
        "constraints" : {
            "patient_id": [ "==", "TCGA-02-0070" ]
        }
    }
},{
    "FindImage": {
        "format": "png",
        "operations": [
            {
                "type": "resize",
                "width":  1024,
                "height": 1024
            }
        ],
        "is_connected_to": {
           "ref": 1,
        }
    }
}]