Skip to content

Repository files navigation

Integrating Pattern Clustering for Enhanced Tibial PCL Avulsion Fracture Analysis

This repository contains the code, datasets, and supplementary materials for the study "Advancements in 3D Fracture Mapping: Integrating Pattern Clustering for Enhanced Tibial PCL Avulsion Fracture Analysis" by Ali Saeedi Rad et al. The study introduces a novel, open-source approach to analyzing tibial posterior cruciate ligament (PCL) avulsion fractures by combining 3D fracture mapping with advanced pattern clustering techniques.


Table of Contents


Overview

This study leverages:

  1. 3D Fracture Mapping: Extracting fracture lines and mapping them onto a standard tibial model.
  2. Pattern Clustering: Utilizing Fréchet distance and Procrustes analysis combined with hierarchical clustering to identify distinct fracture patterns.

The dataset comprises 58 tibial PCL avulsion fracture cases, processed to extract and cluster fracture curves into distinct morphological groups.

Key outcomes include:

  • Four primary fracture pattern groups visualized using Kernel Density Estimation (KDE).
  • An open-source framework implemented in Python to promote reproducibility.

Project Structure

.
├── Dataset/                # Contains fracture data in .txt and .stl formats
│   ├── Curves/             # Extracted fracture curves
│   ├── Sample/             # Sample STL model
│   └── STL/                # Tibial and fracture segmentations
├── figures/                # Scripts for generating visualizations paper
├── output/                 # Clustered outputs and similarity matrices
├── pc/                     # Python scripts for clustering and similarity computation
├── output_vtks/            # VTK outputs for 3D visualizations
├── uv.lock             # Poetry dependency lockfile
├── pyproject.toml          # Poetry project configuration
└── main.py               # Main script to execute the workflow

Key Features

  1. Similarity Computation:

    • Fréchet Distance
    • Procrustes Analysis
    • Combined similarity metrics
  2. Clustering:

    • Hierarchical clustering algorithm for grouping fracture patterns.
  3. Visualization:

    • Kernel Density Estimation (KDE) for fracture density maps.
    • Cluster visualization using ParaView and Python.
  4. Open Source:

    • Reproducible framework built with Python and SciPy.

Dependencies

  • python = "^3.10"
  • tqdm = "^4.67.1"
  • numpy = "^2.2.1"
  • scipy = "^1.14.1"
  • similaritymeasures = "^1.2.0"
  • scikit-image = "^0.25.0"
  • numpy-stl = "^3.2.0"
  • matplotlib = "^3.10.0"
  • seaborn = "^0.13.2"
  • vtk = "^9.4.1"

Installation

  1. Clone this repository:
   git clone https://github.com/AliSaeeidiRad/Fracture-Insights
   cd Fracture-Insights
  1. Install Python 3.10.6 using one of the following methods:

    Option A: Using asdf

    Ensure asdf is installed, then use the .tool-versions file in the repository:

   asdf install
   python -m venv .env
   source .env/bin/activate  # On Windows: .env\Scripts\activate

Option B: Using conda

Ensure conda is installed, then:

   conda create -n fracture-insights python=3.10
   conda activate fracture-insights

Option C: Using uv

Ensure uv is installed, then:

   uv venv
  1. Install package and dependencies:
   pip install -e .

Usage

  1. Run the Main Script: Execute the data processing and clustering pipeline:

    python main.py --dir-curves Dataset/Curves --t 4 --alpha 1.0 --beta 1.0 --output output --sample-stl Dataset/Sample/Sample.stl

    Additional flags:

    • --only-export: Enable this if you just need VTK exports with results of the previous analysis.
    • --only-plots: Enable this if you just need plots from previous analysis.
  2. Explore the Outputs:

    • Clustering results: output/
    • VTK files for 3D visualization: output_vtks/

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.


Citation


For further inquiries, feel free to contact or open an issue.

About

Fracture Morphology and Pattern Recognition in Tibial PCL Avulsion Injuries Using Machine Learning-Enhanced 3D Mapping

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages