# ne1s0n/drone2report architecture

> Architecture diagram of the GitHub repository ne1s0n/drone2report, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ne1s0n/drone2report
- Repository: https://github.com/ne1s0n/drone2report

## Overview

##### Main System Components

a. Input Layer:
- Configuration (.ini files)
- Image Data (various formats: RGB, multispectral, thermal, DEM)
- Shapefiles (Geographic data)

b. Core Processing Pipeline:
- Data Loading Module
- Task Execution Engine
- Render System

c. Output Layer:
- Statistics
- Indexes
- Reports
- Saved Results

##### Component Relationships

**[Input] → [Processing Pipeline] → [Output]**
- ↓              ↓                  ↓
**Config     ┌─────────────┐     Generated**
**Files  →   │ Data Load   │     Reports**
- ↓       │
**Image   →  │   Tasks    │  →   Statistics**
**Data       │     ↓       │**
- Renders    │
**Shapefiles │            │     Analysis**
- →       └─────────────┘     Results

##### Specific Implementation Details

a. Configuration Module (d2r/config.py):
- Connection to all components
- Configuration parsing

b. Dataset Handler (d2r/dataset.py):
- Image loading
- Shapefile processing
- Data preparation

c. Task System (d2r/tasks/):
- ROIs processing
- Index calculations
- Matrix operations
- Thumbnail generation

d. Render System (d2r/renders/):
- Table collection
- Template rendering
- Result consolidation

##### Additional Elements

Features:

##### Technical Details

Specific technical aspects:
- Conda environment dependency
- Python execution flow
- File I/O operations
- Task parallelization (if implemented)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        Config[".ini Files"]
        Images["Image Data"]
        Shapes["Shapefiles"]
    end

    subgraph "Processing Pipeline"
        direction TB
        ConfigModule["Configuration Module"]
        DataHandler["Dataset Handler"]
        TaskEngine["Task Execution Engine"]

        subgraph "Task System"
            direction TB
            ROI["ROI Processing"]
            Index["Index Calculations"]
            Matrix["Matrix Operations"]
            Thumb["Thumbnail Generation"]
        end

        subgraph "Render System"
            direction TB
            MainRender["Main Renderer"]
            RenderTools["Render Tools"]
            Tables["Table Collection"]
            Template["Template Rendering"]
        end
    end

    subgraph Output
        Stats["Statistics"]
        Reports["Generated Reports"]
        Results["Analysis Results"]
    end

    %% Input connections
    Config --> ConfigModule
    Images --> DataHandler
    Shapes --> DataHandler

    %% Core processing connections
    ConfigModule --> DataHandler
    ConfigModule --> TaskEngine
    ConfigModule --> MainRender
    DataHandler --> TaskEngine
    TaskEngine --> ROI
    TaskEngine --> Index
    TaskEngine --> Matrix
    TaskEngine --> Thumb

    %% Task system to render system
    ROI --> MainRender
    Index --> MainRender
    Matrix --> MainRender
    Thumb --> MainRender

    %% Render system internal
    MainRender --> RenderTools
    MainRender --> Tables
    MainRender --> Template

    %% Output connections
    MainRender --> Stats
    MainRender --> Reports
    MainRender --> Results

    %% Styling
    classDef input fill:#a8d5ff
    classDef config fill:#95f7ae
    classDef task fill:#fff59d
    classDef render fill:#ffcc80
    classDef output fill:#ff8a80

    class Config,Images,Shapes input
    class ConfigModule,DataHandler,TaskEngine config
    class ROI,Index,Matrix,Thumb task
    class MainRender,RenderTools,Tables,Template render
    class Stats,Reports,Results output

    %% Click events
    click ConfigModule "https://github.com/ne1s0n/drone2report/blob/main/d2r/config.py"
    click DataHandler "https://github.com/ne1s0n/drone2report/blob/main/d2r/dataset.py"
    click TaskEngine "https://github.com/ne1s0n/drone2report/blob/main/d2r/task.py"
    click ROI "https://github.com/ne1s0n/drone2report/blob/main/d2r/tasks/ROIs.py"
    click Index "https://github.com/ne1s0n/drone2report/blob/main/d2r/tasks/indexes.py"
    click Matrix "https://github.com/ne1s0n/drone2report/blob/main/d2r/tasks/matrix_returning_indexes.py"
    click Thumb "https://github.com/ne1s0n/drone2report/blob/main/d2r/tasks/thumbnail.py"
    click MainRender "https://github.com/ne1s0n/drone2report/blob/main/d2r/render.py"
    click RenderTools "https://github.com/ne1s0n/drone2report/blob/main/d2r/render_tools.py"
    click Tables "https://github.com/ne1s0n/drone2report/blob/main/d2r/renders/collect_tables.py"
    click Template "https://github.com/ne1s0n/drone2report/blob/main/d2r/renders/render_template.py"
    click Config "https://github.com/ne1s0n/drone2report/tree/main/examples/ini/"
    click Images "https://github.com/ne1s0n/drone2report/tree/main/examples/data/"
    click Shapes "https://github.com/ne1s0n/drone2report/tree/main/examples/shapefile/"
```
