Overview

This API provides medical image analysis services:

Base URL

https://midl.comsats.edu.pk

Complete Endpoint URLs

GEThttps://midl.comsats.edu.pk/
GEThttps://midl.comsats.edu.pk/health
GEThttps://midl.comsats.edu.pk/docs
GEThttps://midl.comsats.edu.pk/api-docs
GEThttps://midl.comsats.edu.pk/redoc
GEThttps://midl.comsats.edu.pk/openapi.json
POSThttps://midl.comsats.edu.pk/TSS/predict
POSThttps://midl.comsats.edu.pk/Tashkhees/predict

Authentication

All prediction endpoints require an API key.

Send the key in one of the following headers:

X-API-Key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY

Public Endpoints

GET/

Home page

GET/health

Health check

GET/api-docs

Swagger UI

GET/redoc

ReDoc

GET/openapi.json

OpenAPI JSON

Protected Endpoints

POST /TSS/predict

Predict TB class and lesion locations from DICOM/PNG/JPG/JPEG with Active/Latent TB classification

Request

Headers:
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data

Body:
file: [DICOM/PNG/JPG/JPEG]

Response

{
  "accuracy": 89.46,
  "classification": "TB Positive (Active TB)",
  "original": "D",
  "BBox": [
    {
      "class": "ActiveTuberculosis",
      "bbox": [117.98, 64.36, 242.33, 204.69],
      "confidence": 0.9999969
    },
    {
      "class": "ObsoletePulmonaryTuberculosis", 
      "bbox": [295.60, 57.30, 431.02, 198.80],
      "confidence": 0.1042485
    }
  ]
}
POST /Tashkhees/predict

Predict breast cancer class and density; returns bbox for suspicious cases

Request

Headers:
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data

Body:
file: [DICOM/PNG/JPG/JPEG]

Response

{
  "accuracy": 92,
  "classification": "Suspicious",
  "density": "Dense",
  "segmentation_coordinates": "[[x, y, width, height]]"
}

TSS Response Details

The TSS endpoint now provides enhanced tuberculosis classification and detection:

Classification Types

Detection Results

When TB is detected, the BBox field contains an array of detection objects:

Examples

cURL

curl -X POST "https://midl.comsats.edu.pk/TSS/predict" \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "file=@medical_image.dcm"

Python

import requests

url = "https://midl.comsats.edu.pk/TSS/predict"
headers = {"X-API-Key": "YOUR_API_KEY"}
with open("medical_image.dcm", "rb") as f:
    files = {"file": f}
    r = requests.post(url, headers=headers, files=files)
print(r.status_code, r.text)