AddImage

This call allows the application to add an image in ApertureData Platform. The bare minimum requirement for this call is the image blob. While the application can choose to associate no properties or no collections with this image, it will make it harder to find the image later in such situations. In all scenarios, this call will also lead to an addition of an entity with class “Image” into the metadata database. If an operation is specified, the operation is performed before storing the image. If a collection is defined, it will link the image with that collection. If information is provided to link this image with some previously searched or added entity through a user/application specified id, then such a link is also added in the metadata database.

Parameters

  • [optional] _ref: for reference.
  • [optional] format: Specify the format used to store the image [jpg, png, tdb]. By default, the image will be kept in its original format.

Blocks

  • [optional] operations
  • [optional] properties
  • [optional] constraints
  • [optional] link

Examples

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

"AddImage": {

    "format": "png",
    "operations": [
        {
           "type": "threshold",
           "value": 155
        }
    ],

   "properties": {
       "type": "scan",
       "part": "brain"
   }
}

# Insert an image linked to a patient found using FindEntity

"FindEntity": {
    "_ref": 34,
    "class": "patient",
    "constraints" : {
        "bcr_patient_barc": [ "==", "TCGA-02-0070" ]
    }
}
"AddImage": {
    "format": "jpg",
    "operations": [
      {
       "type": "threshold",
       "value": 155
      }
    ],
   "link": {
       "class": "scan_for",
       "ref": 34,
       "direction": "in"
   }
}