# bubblyyi/coronary-artery-tracking-via-3d-cnn-classification architecture

> Architecture diagram of the GitHub repository bubblyyi/coronary-artery-tracking-via-3d-cnn-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification
- Repository: https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification

## Overview

##### Main Components
- Data Processing & Preparation:
- This is covered by the “data_process_tools” directory. It contains scripts to generate image patch data (for both centerlines and seed/ostia points) and tools to create spacing information.
- Model Definitions:
- The “models” directory holds the definitions for three networks (centerline_net, ostiapoints_net, seedspoints_net). Represent this as a “Models” component.
- Training Pipelines:
- There are three distinct training modules:
- “centerline_train_tools” (contains training runner and log files for centerline network).
- “seedspoints_train_tools” (handles training for seed points, with its own logs).
- “ostiapoints_train_tools” (handles training for ostia/entrance points).
- Checkpoints & Logs:
- The “checkpoint” directory is used to store model checkpoints for classification, ostia, and seeds networks. Also, various training log files exist in their respective subdirectories.
- This as a “Checkpoints & Logs” component that is referenced by the training components.
- Inference & Vessel Tree Construction:
- The “infer_tools_tree” directory contains tools to build the vessel tree using the trained models. It includes modules for building the vessel tree structure, metrics (like Dijkstra), settings, etc.
- This functionality as the “Inference & Tree Construction” module.
- External Dependencies & Execution:
- Use of PyTorch as the deep learning framework and additional packages listed in “requirement.txt”. While not a system module, include an “External Libraries” or “Dependencies” note.

##### Relationships and Data Flow
- Start at Data Processing:
- Training Phase:
- Each training module (centerline, seedspoints, ostiapoints) uses its dedicated training tools and saves model weights (checkpoints) in the “Checkpoint” component.
- Inference Phase:
- From “Checkpoints & Logs”, the trained models are loaded into the “Inference & Tree Construction” component.
- Iterative Feedback:

##### Architectural Patterns & Design Principles
- Modular Design:
- The project is built with separation of concerns in mind. Each submodule (data processing, training, inference) is self-contained.
- Data Pipeline Flow:
- A sequential flow from data collection/preparation to model training and then to inference, reflecting the typical machine learning pipeline.
- High Reusability:

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Processing Component
    DP["Data Processing Tools"]:::processing

    %% Model Definitions Component
    M["Models"]:::model

    %% Training Modules Subcomponents
    CT["Centerline Training"]:::training
    ST["Seed Points Training"]:::training
    OT["Ostia Points Training"]:::training

    %% Checkpoints & Logs Component
    CC["Checkpoints & Logs"]:::storage

    %% Inference & Tree Construction Component
    I["Inference & Tree Construction"]:::inference

    %% External Dependencies Component
    ED["External Dependencies"]:::external

    %% Data Flow from Data Processing to Training Modules
    DP -->|"provides-data"| CT
    DP -->|"provides-data"| ST
    DP -->|"provides-data"| OT

    %% Training Modules update Models and save checkpoints
    CT -->|"updates-model"| M
    ST -->|"updates-model"| M
    OT -->|"updates-model"| M

    CT -->|"saves-checkpoints"| CC
    ST -->|"saves-checkpoints"| CC
    OT -->|"saves-checkpoints"| CC

    %% Checkpoints are loaded into Inference for vessel tree construction
    CC -->|"loads-models"| I

    %% External Dependencies support Models
    ED -->|"supports"| M

    %% Iterative Feedback from Inference back to Data Processing (optional)
    I -->|"feedback-loop"| DP

    %% Click Events for Component Mapping
    click DP "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/data_process_tools"
    click M "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/models"
    click CT "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/centerline_train_tools"
    click ST "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/seedspoints_train_tools"
    click OT "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/ostiapoints_train_tools"
    click CC "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/checkpoint"
    click I "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/tree/master/infer_tools_tree"
    click ED "https://github.com/bubblyyi/coronary-artery-tracking-via-3d-cnn-classification/blob/master/requirement.txt"

    %% Style Definitions
    classDef processing fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef model fill:#A9DFBF,stroke:#27AE60,stroke-width:2px;
    classDef training fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef storage fill:#F5CBA7,stroke:#E67E22,stroke-width:2px;
    classDef inference fill:#D7BDE2,stroke:#8E44AD,stroke-width:2px;
    classDef external fill:#D6EAF8,stroke:#3498DB,stroke-width:2px;
```
