CDSS App is a Flutter-based medical image analysis application that connects to a locally hosted FastAPI backend.
The app:
- Sends multiple CT scan images to a FastAPI server
- Receives a structured medical report (text format)
- Converts the report into an image
- Displays and stores the result locally
- User selects multiple images
- App sends images to FastAPI backend (
/analyze) - Backend processes images using AI model
- Backend returns JSON response containing:
successrefined_report
- App converts the report text into a PNG image
- Result is displayed and saved in local database
Flutter App
↓
POST /analyze (multipart/form-data)
↓
FastAPI Server (Laptop)
↓
AI Model Processing
↓
JSON Response (refined_report)
↓
Flutter converts text → Image
↓
Display + Store in DB
- Python 3.8+
- FastAPI
- Uvicorn
- python-multipart
- Flutter SDK
- Laptop and phone connected to same WiFi network
pip install fastapi uvicorn python-multipartuvicorn app:app --host 0.0.0.0 --port 80000.0.0.0 is required to allow phone access.
Open Command Prompt:
ipconfigFind:
IPv4 Address : 10.115.206.17
Your API base URL becomes:
http://10.115.206.17:8000
POST http://<YOUR_IP>:8000/analyze
- Method: POST
- Content-Type: multipart/form-data
- Field name:
files - Multiple images allowed
The backend must return JSON in this format:
{
"success": true,
"refined_report": "Detailed CT analysis report text here..."
}If "success" is not true, the app throws an error.
The app sends images using:
final uri = Uri.parse("http://10.115.206.17:8000/analyze");
final request = http.MultipartRequest("POST", uri);
for (final img in widget.images) {
request.files.add(
await http.MultipartFile.fromPath("files", img.path),
);
}After receiving response:
- JSON is decoded
refined_reportis extracted- Text is converted into PNG image
- Image is stored in local database
- Output page is shown
The app dynamically converts the medical report into a PNG file using Flutter Canvas API.
This ensures:
- Structured medical report view
- Saveable image output
- Easy storage in DB
Open in browser:
http://<YOUR_IP>:8000/docs
Use Swagger UI to test /analyze endpoint.
- Laptop and phone must be on same WiFi
- Firewall must allow port 8000
- Backend must be running
- IPv4 address must match the one in
submit_page.dart
- Check same WiFi
- Verify IPv4 address
- Ensure
--host 0.0.0.0 - Check firewall settings
- Ensure backend returns proper JSON
- Ensure
successfield exists
cdss_app/
│
├── lib/
│ ├── submit_page.dart
│ ├── data/
│ └── ml/
│
├── backend/
│ └── app.py
│
└── README.md
- IP address may change when WiFi reconnects.
- For production deployment:
- Use cloud hosting
- Use HTTPS
- Do not hardcode IP address