# spectralcode/octproz architecture

> Architecture diagram of the GitHub repository spectralcode/octproz, 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/spectralcode/octproz
- Repository: https://github.com/spectralcode/octproz

## Overview

##### Main Components

a. Core Application Layer:
- Main OCT Processing Pipeline (CUDA-based)
- Visualization Engine (OpenGL-based)
- Plugin System Manager
- User Interface Components

b. Plugin Architecture:
- Acquisition Systems Interface
- Extensions Interface
- Plugin Manager

c. Processing Components:
- GPU Processing Units
- Data Buffer Management
- Real-time Processing Pipeline

**┌─────────────────────────────────────────────────────────┐**
- User Interface Layer                  │
- ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌────────────┐  │
- Control   │ │2D/3D     │ │Plot      │ │Message     │  │
- Panel     │ │Viewers   │ │Windows   │ │Console     │  │
- ┘ └──────────┘ └──────────┘ └────────────┘  │
- ┤
- Plugin System Layer                     │
- ┌────────────────────┐    ┌─────────────────────────┐ │
- Acquisition Systems │    │      Extensions          │ │
- Virtual OCT    │    │  - Analysis Tools        │ │
- Custom Systems │    │  - Monitoring Tools      │ │
- ┘    └─────────────────────────┘ │
- ┤
- Processing Pipeline Layer                  │
- ┌─────────┐→┌─────────┐→┌──────────┐→┌────────────┐  │
- Raw Data │ │CUDA     │ │Processing│ │Visualization│  │
- Input    │ │Kernels  │ │Pipeline  │ │Engine      │  │
- ┘ └─────────┘ └──────────┘ └────────────┘  │
- ┘

##### Important Elements to Highlight

a. Data Flow:
- Raw data input from acquisition systems
- Processing pipeline stages
- Output to visualization components
- Plugin data access points

b. Integration Points:
- Plugin system interfaces
- GPU integration points
- UI component connections

##### Technical Details

- CUDA/GPU processing blocks
- OpenGL visualization pipeline
- Plugin system architecture
- Real-time processing capabilities
- Data buffer management

##### Specific Implementation Notes

- Relationship between the DevKit and plugin system
- Separation between acquisition and processing
- Real-time visualization pipeline
- Performance-critical paths

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI["User Interface Layer"]
        CP["Control Panel"]:::ui
        VW["2D/3D Viewers"]:::ui
        PW["Plot Windows"]:::ui
        MC["Message Console"]:::ui
    end

    subgraph PS["Plugin System Layer"]
        PM["Plugin Manager"]:::plugin
        subgraph AS["Acquisition Systems"]
            VS["Virtual OCT System"]:::plugin
            CS["Custom Systems"]:::plugin
        end
        subgraph EX["Extensions"]
            AT["Analysis Tools"]:::plugin
            MT["Monitoring Tools"]:::plugin
        end
    end

    subgraph PP["Processing Pipeline Layer"]
        RD["Raw Data Input"]:::processing
        CK["CUDA Kernels"]:::processing
        PL["Processing Pipeline"]:::processing
        VE["Visualization Engine"]:::processing
        BM["Buffer Management"]:::processing
    end

    subgraph Core["Core Application"]
        MA["Main Application"]:::core
    end

    %% Connections
    MA --> PM
    MA --> PP
    MA --> UI

    PM --> AS
    PM --> EX

    RD --> CK
    CK --> PL
    PL --> VE
    BM --> PL

    VE --> VW
    PL --> PW
    PS --> RD

    %% Click Events
    click CP "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/controlpanel.cpp"
    click MC "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/messageconsole.cpp"
    click PW "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/plotwindow1d.cpp"
    click VW "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/glwindow2d.cpp"
    click VE "https://github.com/spectralcode/octproz/tree/master/octproz_project/octproz/shaders/"
    click CK "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/cuda_code.cu"
    click PL "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/processing.cpp"
    click BM "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz_devkit/src/acquisitionbuffer.cpp"
    click VS "https://github.com/spectralcode/octproz/tree/master/octproz_project/octproz_plugins/octproz_virtual_oct_system/"
    click PM "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/extensionmanager.cpp"
    click MA "https://github.com/spectralcode/octproz/blob/master/octproz_project/octproz/src/main.cpp"

    %% Styles
    classDef ui fill:#9370DB,stroke:#333,stroke-width:2px
    classDef plugin fill:#90EE90,stroke:#333,stroke-width:2px
    classDef processing fill:#FFA500,stroke:#333,stroke-width:2px
    classDef core fill:#4169E1,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["UI Components"]:::ui
        L2["Plugin Components"]:::plugin
        L3["Processing Components"]:::processing
        L4["Core Components"]:::core
    end
```
