Uploading the Dicoms
Use the following sample script to upload Dicoms to the service.
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
file_paths = ['dicom-file1.dcm', 'dicom-file2.dcm']
m = MultipartEncoder({
file_path: (file_path, open(file_path, 'rb'), 'application/dicom')
for file_path in file_paths
})
content_type = 'multipart/related; type=application/dicom; boundary={}'\
.format(m.boundary_value)
# Make the HTTP POST request to the service
r = requests.post(
url=URL, data=m,
headers={'Content-Type': content_type,
'Authorization': 'Token {}'.format(TOKEN)})
Uploading Dicoms to the Service
POST
http://BASE URL + studies
Use the URL to make a POST call with the multipart encoded payload.
Path Parameters
Name
Type
Description
file_paths*
String
Represents the file location.
URL*
String
The URL pointing to the service.
Headers
Name
Type
Description
Authorization*
String
Bearer token.
Content-Type*
String
Request Body
Name
Type
Description
data*
String
{
"message": "Success",
"series_instance_uids": ["SERIES_INSTANCE_UID_1", "SERIES_INSTANCE_UID_2",],
"detailed_info":[
{
"SeriesInstanceUID": "SERIES_INSTANCE_UID 1",
"NumberOfSeriesRelatedInstances": "INTEGER"
},
{
"SeriesInstanceUID": "SERIES_INSTANCE_UID 2",
"NumberOfSeriesRelatedInstances": "INTEGER"
}
]
}
Response Attribute
Attribute
Value type
Description
Sample Value
message
String
It validates the post call action based on the response status code.
"message": "Success"
series_instance_uids
Integer
It is a unique identifier given for a series of Dicom images.
"series_instance_uids": [
"1.2.826.0.1.3680043.8.498.83895378777916398722746509596078492186"
detailed_info
String
It is an object which contains a set of Dicom images.
-
NumberOfSeriesRelatedInstances
Integer
It is the number of series instance UID's that belong to a set of series.
"NumberOfSeriesRelatedInstances": 50
authenticated
Boolean
It validates the token validity.
"authenticated": false
Last updated
Was this helpful?