How arinzingade/tlc-with-image-processing works
Project Overview
• This repository is aimed at automating the analysis of Thin Layer Chromatography (TLC) plates by calculating RF (Retention Factor) values. The tool drastically speeds up TLC analysis (from minutes to milliseconds) and likely uses image processing to derive these values.
• It is essentially a web-enabled utility for chemists, combining a simple web interface (using templates like index.html) with backend image-processing and RF calculation modules.
Identifying the Main Components
• Web Frontend:
• Located in the “templates” folder (index.html) and “uploads” folder (for user provided images).
• Responsible for providing an interface for users to upload TLC plate images and display results.
• Web Backend/Server:
• The main execution starting points are files like “app.py” and optionally “main.py.”
• This layer handles HTTP requests, routes connections between the user’s interactions and the processing modules.
• Image Processing Module:
• The “Detection” folder contains DocScan.py and utils (likely image processing helper functions). This module processes the TLC plate images to extract necessary data.
• RF Calculation Module:
• “RFCalc.py”, and even a C++ version in “references/RFCalc.cpp”, implies a dedicated component to calculate the RF values from processed image data.
• Reference/Support Files:
• “references” directory (including Jupyter notebooks) shows examples or baseline implementations. These can be seen as documentation or experimental work that informed the design.
• Configuration and Dependency Management:
• “requirements.txt” and conda environment instructions indicate dependency management and setup guidelines.
Interactions Between Components
• The user interacts with the frontend (via a web browser) and uploads an image.
• The backend (app.py) receives this image and possibly stores it in the “uploads” directory.
• The backend then calls the image processing modules (Detection/DocScan.py and related functions) to analyze the image and extract regions or features.
• The processed data is passed to the RF calculation logic in RFCalc.py, which computes the RF values.
• The final results are saved (possibly in “outputs”) and returned/displayed via the frontend.
• The design also suggests potential support for debugging or verification using reference files.
Architectural Patterns and Design Principles
• The structure suggests a monolithic web application design, separating concerns into frontend, processing, and computation modules.
• The clear separation of concerns (web server, image processing, RF calculations) is key.
• Using MVC-like separation or layered architecture, where:
• The view is represented by the templates,
• The controller is in the Flask routes (app.py),
• And the model comprises the processing/calculation modules.
• Dependency and environment isolation are managed via conda and pip.