Images - dsimaging/dsio-filters-api GitHub Wiki
This page is concerned with managing image resources for processing.
POST/images
This method creates a new image resource by uploading a 16-bit grayscale PNG image file and corresponding information about the image. The request must be formatted as a Multipart Form Data request with a body that includes both the image file and the JSON data describing the image. When filter operations are complete, the resource should be deleted with the Delete Image Resource
API call. If the Delete Image Resource
call is not used, the resource will be deleted automatically after the expires
timestamp.
BasicAuth
No parameters
Request body schema: multipart/form-data
The following parts must be included in the multipart/form-data request.
Field Name | Content Type | Description |
---|---|---|
imageInfo |
application/json | Contains an ImageInfo object that describes information about the image used to create an ImageResource. This information should be obtained directly from the corresponding ImageInfo object of the image acquired using the DSIO Modality API. Note that this object is a subset of the DSIO Modality API, thus allowing API consumers to use the same object for both. This json data must be formatted as a single line of text. |
imageMedia |
image/png | The media file to upload. This file must be a 16-bit PNG image in binary format. |
The following is an example of the body content for a multipart/form-data request:
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="imageInfo"
Content-Type: application/json
{"acquisitionInfo":{"binning":"Binned2X2"},"lutInfo":{"gamma":2.3,"slope":65535,"offset":0,"totalGrays":4096,"minimumGray":3085,"maximumGray":0}}
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="imageMedia"; filename="/C:/UnfilteredImage_1c577c7a-ab22-4cee-b03b-41ef69958dff.png"
Content-Type: image/png
(data)
----WebKitFormBoundary7MA4YWxkTrZu0gW
201 Image resource created
400 Bad input parameter
415 Unsupported media type
Response schema: application/json
Name | Description |
---|---|
ImageResource |
Represents an ImageResource uploaded for processing. |
{
"id": "160c98f9-d188-4118-94c4-697161fd5caf",
"mediaType": "image/png",
"url": "https://example.com/images/160c98f9-d188-4118-94c4-697161fd5caf/file.png",
"createdOn": "2021-05-03T14:56:00.000Z",
"expires": "2021-05-03T22:56:00.000Z",
"imageInfo": {
"acquisitionInfo": {
"binning": "Unbinned"
},
"lutInfo": {
"gamma": 2.3,
"slope": 65535,
"offset": 0,
"totalGrays": 4096,
"minimumGray": 3612,
"maximumGray": 418
}
},
"modalitySession": null
}
POST/images/modality
This method creates a new image resource by referencing an image captured in a current modality session. This resource will only be available for as long as the modality session is active. When filter operations are complete, the resource should be deleted with the Delete Image Resource
API call. If the Delete Image Resource
call is not used, the resource will be deleted automatically after the expires
timestamp.
BasicAuth
No parameters
Request body schema: application/json
Name | Type | Description |
---|---|---|
sessionId |
string | Id of the modality session |
imageId |
string | Id of the image acquired by the modality |
{
"sessionId": "451f7e06-5827-4c99-b6fb-b9c330ca922c",
"imageId": "39db323b-198d-4219-b79e-ca918cde5be5"
}
201 Image resource created
400 Bad input parameter
404 Modality session or image not found
Response schema: application/json
Name | Description |
---|---|
ImageResource |
Represents an ImageResource uploaded for processing. |
{
"id": "160c98f9-d188-4118-94c4-697161fd5caf",
"mediaType": "image/png",
"url": "https://example.com/images/160c98f9-d188-4118-94c4-697161fd5caf/file.png",
"createdOn": "2021-05-03T14:56:00.000Z",
"expires": "2021-05-03T22:56:00.000Z",
"imageInfo": {
"acquisitionInfo": {
"binning": "Unbinned"
},
"lutInfo": {
"gamma": 2.3,
"slope": 65535,
"offset": 0,
"totalGrays": 4096,
"minimumGray": 3612,
"maximumGray": 418
}
},
"modalitySession": {
"sessionId": "451f7e06-5827-4c99-b6fb-b9c330ca922c",
"imageId": "39db323b-198d-4219-b79e-ca918cde5be5"
}
}
GET/images/{id}
This method retrieves an image resource.
BasicAuth
Parameter | Type | Required? | Description |
---|---|---|---|
id |
string | Yes | Id of the image resource to retrieve |
200 Success
404 Image resource not found
Response schema: application/json
Name | Description |
---|---|
ImageResource |
Represents an ImageResource uploaded for processing. |
{
"id": "160c98f9-d188-4118-94c4-697161fd5caf",
"mediaType": "image/png",
"url": "https://example.com/images/160c98f9-d188-4118-94c4-697161fd5caf/file.png",
"createdOn": "2021-05-03T14:56:00.000Z",
"imageInfo": {
"acquisitionInfo": {
"binning": "Unbinned"
},
"lutInfo": {
"gamma": 2.3,
"slope": 65535,
"offset": 0,
"totalGrays": 4096,
"minimumGray": 3612,
"maximumGray": 418
}
},
"modalitySession": {
"sessionId": "451f7e06-5827-4c99-b6fb-b9c330ca922c",
"imageId": "39db323b-198d-4219-b79e-ca918cde5be5"
}
}
DELETE/images/{id}
This method deletes an image resource from the filters service. This image will no longer be available for processing.
BasicAuth
Parameter | Type | Required? | Description |
---|---|---|---|
id |
string | Yes | Id of the image resource to delete. Please note that if the resource was created from an active modality session, the image will not be deleted from the modality session. This will be done by the Modality API when the session is ended. |
204 Successfully deleted resource
404 Image resource not found
GET/images/{id}/media
This method returns the media associated with an image resource.
BasicAuth
Parameter | Type | Required? | Description |
---|---|---|---|
sessionId |
string | Yes | The session id |
imageId |
string | Yes | The image id |
200 Success
404 Session or image not found
Response schema: image/*
The body of a successful response will contain binary data in the format defined by the Content Type header (typically, image/png).
To reduce the repetition of long descriptions in the documentation, complex objects are collected in this section.
Name | Type | Description |
---|---|---|
id |
string | The resource id associated with the image |
mediaType |
string | The media type describing the format of the image data |
url |
string | The Url where the media resource can be downloaded |
createdOn |
string | Timestamp indicating when the resource was created |
expires |
string | Timestamp indicating when the resource will expire automatically and be deleted |
imageInfo |
object (ImageInfo) | Describes information about the image used to create an ImageResource . This information should be obtained directly from the corresponding ImageInfo object of the image acquired using the DSIO Modality API. Note that this object is a subset of the DSIO Modality API, thus allowing API consumers to use the same object for both. |
modalitySession |
object (ModalitySession) | Optional object that when present indicates that the resource belongs to a session created with the Modality API. |
Back to Create Image Resource or Create Modality Resource or Get Image Resource
Name | Type | Description |
---|---|---|
acquisitionInfo |
object | Describes information regarding the acquisition from the DSIO Modality API. |
>binning
|
string | The binning mode used to acquire the image. Enum:
|
lutInfo |
object | The Url where the media resource can be downloaded |
>gamma
|
number (double) | Gamma value used in map |
>slope
|
number (double) | Slope value used in map |
>offset
|
number (double) | Offset value used in map |
>totalGrays
|
number (integer) | Total number of gray values in original (unmapped) image |
>minimumGray
|
number (integer) | Minimum gray value in original (unmapped) image |
>maximumGray
|
number (integer) | Maximum gray value in original (unmapped) image |
Back to Create Image Resource or Create Modality Resource or Get Image Resource
Name | Type | Description |
---|---|---|
sessionId |
string | Id of modality session |
imageId |
string | Id of the image acquired by modality |
Back to Create Image Resource or Create Modality Resource or Get Image Resource