Overview
This API provides medical image analysis services:
- TSS: Tuberculosis detection and classification (Active TB vs Latent TB)
- Tashkhees: Breast cancer detection and density analysis
Base URL
https://midl.comsats.edu.pk
Complete Endpoint URLs
GET
https://midl.comsats.edu.pk/
GET
https://midl.comsats.edu.pk/health
GET
https://midl.comsats.edu.pk/docs
GET
https://midl.comsats.edu.pk/api-docs
GET
https://midl.comsats.edu.pk/redoc
GET
https://midl.comsats.edu.pk/openapi.json
POST
https://midl.comsats.edu.pk/TSS/predict
POST
https://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
- Healthy: No tuberculosis detected
- Sick: General pathology detected (non-TB)
- TB Positive (Active TB): Active tuberculosis infection detected
- TB Positive (Latent TB): Obsolete/latent tuberculosis detected
- TB Positive (Active TB, Latent TB): Both types detected
Detection Results
When TB is detected, the BBox
field contains an array of detection objects:
- class: "ActiveTuberculosis" or "ObsoletePulmonaryTuberculosis"
- bbox: [x_min, y_min, x_max, y_max] coordinates
- confidence: Detection confidence score (0.0 to 1.0)
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)