SemanticMD Cloud

The SemanticMD Cloud Developer Hub

Welcome to the SemanticMD Cloud developer hub. You'll find comprehensive guides and documentation to help you start working with SemanticMD Cloud as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Documentation
Suggest Edits

Annotate Report

 

Query Auth

 Authentication is required for this endpoint.
posthttps://api-testing.semantic.md/v1/annotate/report
curl -X POST -H 'X-ApiKey: YOUR_API_KEY' -F "report_url=YOUR_REPORT" https://api-testing.semantic.md/v1/annotate/report
A binary file was returned

You couldn't be authenticated

[
    [
        "0",
        "733930",
        "Twisting , approximately one months prior , continued lateral pain .",
        "Twisting",
        "0",
        "8",
        "INDICATION",
        "diseasedisorder",
        "1"
    ],
    [
        "1",
        "733930",
        "Twisting , approximately one months prior , continued lateral pain .",
        "lateral pain",
        "54",
        "66",
        "INDICATION",
        "signsymptom",
        "1"
    ],
    [
        "2",
        "733930",
        "A tiny , approximately 3 x 2 mm minimally displaced avulsion fractures present at the tip of the lateral CR OF THE LEFT ANKLE COMPLETE 3VIEWS malleolus .",
        "avulsion fractures present",
        "52",
        "78",
        "FINDINGS",
        "diseasedisorder",
        "1"
    ],
    [
        "3",
        "733930",
        "There is no obvious additional or superimposed acute fracture or dislocation .",
        "fracture",
        "53",
        "61",
        "FINDINGS",
        "diseasedisorder",
        "-1"
    ],
    [
        "4",
        "733930",
        "There is no obvious additional or superimposed acute fracture or dislocation .",
        "dislocation",
        "65",
        "76",
        "FINDINGS",
        "diseasedisorder",
        "-1"
    ],
    [
        "5",
        "733930",
        "Tiny minimally displaced avulsion fracture at tip of lateral malleolus , as above .",
        "fracture",
        "34",
        "42",
        "IMPRESSION",
        "diseasedisorder",
        "1"
    ],
    [
        "6",
        "733930",
        "No acute fracture , dislocation , or other acute processes are seen , otherwise .",
        "fracture",
        "9",
        "17",
        "IMPRESSION",
        "diseasedisorder",
        "-1"
    ],
    [
        "7",
        "733930",
        "No acute fracture , dislocation , or other acute processes are seen , otherwise .",
        "dislocation",
        "20",
        "31",
        "IMPRESSION",
        "diseasedisorder",
        "-1"
    ]
]

Body Params

report_url
string

Reports can be any format including PDF, DICOM, and PNG

 

JSON output descriptors:

a) Annotation #
b) Report #
c) Sentence text
d) Detected entity (i.e. disease or symptom name from sentence)
e) Entity location start in report (i.e. character #) - 'span_begin'
f) Entity location end in report - 'span_end'
g) Report subsection that contained the entity
h) Entity type
i) Polarity (1 means entity is present and -1 means entity is absent)

Suggest Edits

Image Classification

 

Classify Images or S3 Folders

You have the option of providing your own images or folders in your corresponding customer bucket on S3. Here are some things to consider:

Image URLs
Image Data
S3 Folders

Fast and easy to use

Takes time to upload

Fastest option since our algorithms are hosted on AWS

Data can be stored anywhere

Good for running tests locally

Good for large amounts of data

In short, URLs are easy to get started with while providing flexibility on data storage, while S3 folders are better long-term performance and maintenance wise.

Bonus: If email notifications are set up on your dashboard, you will receive an email with a CSV report on the classification results.

Classify Image URLs

curl -H 'X-ApiKey: YOUR_API_KEY' -X POST -d "image_urls[]=https://s3.amazonaws.com/semanticmd-public/dcm_test/IM-0001-0001.dcm" -d "image_urls[]=https://s3.amazonaws.com/semanticmd-public/dcm_test/IM-0001-0002.dcm" https://api-testing.semantic.md/v1/image/classify/YOUR_CLASSIFIER_ID

What’s actually happening:

  • SemanticMD pulls the data from your URLs.
  • Data is passed to the deep learning model with the given ID.
  • Returns a job ID that can be polled until results are available.

You can find your secret API key on your dashboard.

 

Query Auth

 Authentication is required for this endpoint.
posthttps://api-testing.semantic.md/v1/image/train
curl -X POST -H 'X-ApiKey: YOUR_API_KEY' -F "s3_bucket=YOUR_S3_BUCKET" -F "s3_path=YOUR_S3_PATH" https://api-testing.semantic.md/v1/image/train
curl -X POST -H 'X-ApiKey: YOUR_API_KEY' -d "image_urls[]=https://www.com/images/class_a/0.jpg" -d "image_urls[]=https://www.com/images/class_a/1.jpg" -d "image_urls[]=https://www.com/images/class_b/0.jpg" -d "image_urls[]=https://www.com/images/class_b/1.jpg" https://api-testing.semantic.md/v1/image/train
A binary file was returned

You couldn't be authenticated

{
    "job_id": "8a2c53fc-d2d0-4896-a2fc-26744b6c8a77"
}

Body Params

s3_bucket
string

Amazon S3 bucket storing the images

s3_path
string

Amazon S3 folder path within the s3_bucket

image_urls
array of strings

Image classes are derived from the folder name containing the image files on the remote server

 
Suggest Edits

Training Status

 

Query Auth

 Authentication is required for this endpoint.
gethttps://api-testing.semantic.md/v1/job/job_id
curl -H 'X-ApiKey: YOUR_API_KEY' https://api-testing.semantic.md/v1/job/YOUR_JOB_ID
A binary file was returned

You couldn't be authenticated

{
    "classifier_id": "20160730-033158-29e8",
    "status": "success"
}

Path Params

job_id
string
required

Job ID

 
Suggest Edits

Classification

 

Query Auth

 Authentication is required for this endpoint.
posthttps://api-testing.semantic.md/v1/image/classify/classifier_id
curl -X POST -H 'X-ApiKey: YOUR_API_KEY' -F "s3_bucket=YOUR_S3_BUCKET" -F "s3_path=YOUR_S3_PATH" https://api-testing.semantic.md/v1/image/classify
curl -X POST -H 'X-ApiKey: YOUR_API_KEY' -d "image_urls[]=https://www.com/images/0.jpg" -d "image_urls[]=https://www.com/images/1.jpg" -d "image_urls[]=https://www.com/images/2.jpg" -d "image_urls[]=https://www.com/images/3.jpg" https://api-testing.semantic.md/v1/image/classify
A binary file was returned

You couldn't be authenticated

{
    "job_id": "dc14e8ce-b57f-4428-bbe9-c2689cea4a3c"
}

Path Params

classifier_id
string
required

Body Params

s3_bucket
string

Amazon S3 bucket storing the images

s3_path
string

Amazon S3 folder path within the s3_bucket

image_urls
array of strings
dicom_only
string

true or false (false is the default)

 

Example classifying a multiple fundus images with proliferative diabetic retinopathy:

Note: the v1 classifier requires that the files must have different file names.
The next generation v2 classifier does not have this limitation.

curl -X POST -H 'X-ApiKey: YOUR_API_KEY' \
		-F 'image_urls[]=https://files.readme.io/92522a2-prolifrl.jpg' \
    -F 'image_urls[]=https://files.readme.io/92522a2-prolifrl.jpg' \
    'https://api-testing.semantic.md/v1/image/classify/20170405-212303-c8ab'

Example classifying a single fundus image with proliferative diabetic retinopathy:

curl -X POST -H 'X-ApiKey: YOUR_API_KEY' \
    -F 'image_urls[]=https://files.readme.io/92522a2-prolifrl.jpg' \
    'https://api-testing.semantic.md/v1/image/classify/20161111-203459-0fee'

ZIP files containing DICOM images can be classified as follows:

curl -X POST -H 'X-ApiKey: YOUR_API_KEY' \
		-F 'image_zip_url=https://www.com/my_dicom_images.zip' \
    -F 'dicom_only=true' \
    'https://api-testing.semantic.md/v1/image/classify/MY_CLASSIFIER_ID'
Suggest Edits

Classification Status

 

Query Auth

 Authentication is required for this endpoint.
gethttps://api-testing.semantic.md/v1/job/job_id
curl -H 'X-ApiKey: YOUR_API_KEY' https://api-testing.semantic.md/v1/job/YOUR_JOB_ID
A binary file was returned

You couldn't be authenticated

{
    "probabilities": {
        "https://s3.amazonaws.com/semanticmd-public/dcm_test/IM-0001-0001.dcm": {
            "abnormal": 0.0,
            "normal": 100.0
        },
        "https://s3.amazonaws.com/semanticmd-public/dcm_test/IM-0001-0002.dcm": {
            "abnormal": 0.01,
            "normal": 99.99
        }
    },
    "status": "success"
}

Path Params

job_id
string
required

Job ID

 
 

Query Auth

 Authentication is required for this endpoint.
posthttps://api-testing.semantic.md/v1/image/object/train
curl -X POST -H 'X-ApiKey: YOUR_API_KEY' -d @annotation_data.json https://api-testing.semantic.md/v1/image/object/train
A binary file was returned

You couldn't be authenticated

{
    "job_id": "8a2c53fc-d2d0-4896-a2fc-26744b6c8a77"
}

Body Params

annotation_data
object
 
 
{'annotations': 
 [{'name': 'brainbleed',
   'url': 'http://images.radiopaedia.org/images/3922/727ed334e18fa56fa3a0838698eec3_big_gallery.jpg',
   'x1': 0.2,
   'x2': 0.45,
   'y1': 0.3,
   'y2': 0.35},
  {'name': 'brainbleed',
   'url': 'http://images.radiopaedia.org/images/3922/727ed334e18fa56fa3a0838698eec3_big_gallery.jpg',
   'x1': 0.55,
   'x2': 0.6,
   'y1': 0.55,
   'y2': 0.6},
  {'name': 'brainbleed',
   'url': 'http://images.radiopaedia.org/images/3922/727ed334e18fa56fa3a0838698eec3_big_gallery.jpg',
   'x1': 0.25,
   'x2': 0.34,
   'y1': 0.53,
   'y2': 0.79}]}
Suggest Edits

Training Status

 

Query Auth

 Authentication is required for this endpoint.
gethttps://api-testing.semantic.md/v1/job/job_id
curl -H 'X-ApiKey: YOUR_API_KEY' https://api-testing.semantic.md/v1/job/YOUR_JOB_ID
A binary file was returned

You couldn't be authenticated

{
    "classifier_id": "20160730-033158-29e8",
    "status": "success"
}

Path Params

job_id
string
required

Job ID