How preethamam/afmm-skeletonization works
Main Architectural Components
• Two Main Method Modules: • Method 1 (AFMM skeletonization based on a modified AFMM) • Method 2 (AFMM combined with tolerance-based feature transforms)
• Within Each Method: There are parallel implementations in:
• C (native, high-performance with CMake builds)
• Cython (bridging C performance with Python’s usability)
• Pybind (Python wrappers to access near-C performance)
• Native Python (more flexible but slower)
• Input/Output Handling: Use of input image files (from the images folder) and generation of output skeleton images.
• Build & Configuration Layer: CMake files, Visual Studio Code settings (.vscode directories), and setup scripts for Python (setup.py, requirements.txt).
Relationships and Interactions Between Components
• The user (or a driver script) provides an input image.
• The image is passed into one of the AFMM processing pipelines:
• For Method 1 and Method 2, the pipelines share a similar structure but differ in algorithmic details.
• Within each method, the available implementations (C, Cython, Pybind, Python) ultimately call the same core algorithm routines but are exposed with different interfaces.
• The underlying C modules are compiled via CMake and built within a structured build directory.
• The Python-based implementations (including those that use wrappers such as Cython and Pybind) rely on the core C code for performance-critical operations while providing an easier-to-use interface.
• Execution times and performance outputs (skeleton images) are compared across implementations and shown in the README.
Architectural Patterns and Design Principles
• Layered Architecture: The project is organized into layers:
• Low-Level Processing Layer: Optimized algorithms implemented in C and exposed through Cython/Pybind.
• Interface/Wrapper Layer: Python-based scripts for easier interaction and rapid testing.
• Build and Configuration Layer: Consistent use of CMake and setup scripts to manage builds across different language environments.
• Modularity: Separation into distinct folders (method_1 and method_2) each with similarly structured submodules for each target language.
• Reusability and Portability: With clearly separated build systems and language-specific folders, the project targets cross-platform compatibility (macOS, Linux, Windows).
Relevant Technologies, Frameworks, or Libraries
• C/CMake: For compiling the core, high-performance AFMM implementations.
• Python: For rapid prototyping and scripting of the skeletonization process.
• Cython and Pybind: To create efficient Python extensions that wrap the C implementations.
• Visual Studio Code: The .vscode configuration indicates developer tooling setups.
• Possibly external image libraries (indicated by stb_image.h and stb_image_write.h) used for reading and writing images.
• Clear Labels: Name each main component – “Method 1”, “Method 2”, and within each, the “C Implementation”, “Cython Module”, “Pybind Module”, and “Python Implementation”.
• Annotations: Include notes that capture platform-specific build details (like differences in Visual Studio Code build configurations, use of CMake) and performance metrics where relevant.
• The core algorithm layer in the middle,