Skip to content

Kr4is/octApp

Repository files navigation

OCT Vision Logo

OCT Vision

Ophthalmology Assistance for Contact Lens Fitting and Corneal Analysis

License: GPL v3 Python OpenCV

Engineering Project - Bachelor's Degree in Computer Engineering
Universidade da Coruña


🎯 Overview

OCT Vision is a specialized tool designed to automate and enhance the measurement of the relationship between the cornea and contact lenses using Anterior Segment Optical Coherence Tomography (AS-OCT) images.

It provides clinicians with precise data to facilitate the calculation and adaptation of lenses, particularly for patients with irregular corneas (e.g., keratoconus, corneal transplants).

✨ Key Features

  • Automated Segmentation: Precisely detects corneal and contact lens surfaces using optimized image processing pipelines.
  • Metric Suite:
    • Vertical Clearances: Direct measurement of the sagittal gap.
    • Euclidean Clearance: Minimum distance between surfaces for safety analysis.
    • Zonal Metrics: Analysis of central vs. peripheral thickness.
  • Interactive Visualization: Real-time cross-sectional measurements with an interactive thickness profile.
  • Demo Mode: Built-in library of diverse clinical cases for training and validation.

🛠️ Technical Stack

  • Backend: Flask (Python) with a focus on custom computer vision algorithms.
  • Computer Vision: OpenCV, NumPy, and SciPy for edge detection, morphological processing, and polynomial interpolation.
  • Frontend: Vanilla JavaScript (Modern ES6+), Tailwind CSS for a premium medical interface.
  • Testing: Robust test suite using Pytest for core geometry and processing services.

⚙️ Installation & Usage

1. Prerequisites

  • Python 3.11+
  • uv (Recommended for dependency management)

2. Setup

uv sync

3. Run Application

uv run python run.py

Then visit http://localhost:5000 in your browser.

🐳 Deployment with Docker

You can easily deploy OCT Vision using Docker and Docker Compose. This ensures all system dependencies (OpenCV, etc.) are correctly configured.

Using Docker Compose (Recommended)

  1. Build and Start:
    docker compose up --build -d
  2. Access: The application will be available at http://localhost:5000.

Using Dockerfile Directly

  1. Build:
    docker build -t oct-vision .
  2. Run:
    docker run -p 5000:5000 oct-vision

4. Run Tests

PYTHONPATH=. uv run python3 -m pytest

📊 Methodology

The application follows a multi-stage processing pipeline:

  1. Preprocessing: Image enhancement (CLAHE) and noise reduction.
  2. Segmentation: Canny edge detection and morphological grouping.
  3. Analysis: Least-squares polynomial fitting to derive smooth corneal/lens models.
  4. Computation: Geometric algorithms to find vertical and minimum Euclidean distances.

📄 License

This project is licensed under the GNU General Public License v3.0.

Developed with precision for the ophthalmology community.

About

TFG Bruno Cabado Lousa oct

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors