Skip to content

feat: add tumor size and severity analysis pipeline#35

Open
shambavi2007 wants to merge 1 commit into
Brijeshthummar02:masterfrom
shambavi2007:feature/tumor-size-severity-analysis
Open

feat: add tumor size and severity analysis pipeline#35
shambavi2007 wants to merge 1 commit into
Brijeshthummar02:masterfrom
shambavi2007:feature/tumor-size-severity-analysis

Conversation

@shambavi2007

@shambavi2007 shambavi2007 commented May 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #20

Overview

This PR introduces a comprehensive tumor size and severity analysis pipeline for segmented brain MRI scans.

The implementation adds advanced post-processing analysis on top of the existing segmentation workflow to provide richer and more clinically meaningful tumor insights.


Features Added

1. Tumor Size Analysis

Implemented:

  • tumor pixel count calculation
  • tumor occupancy percentage
  • relative brain occupancy analysis

2. Severity Classification

Severity Occupancy
Small <2%
Medium 2–8%
Large 8–15%
Critical >15%

3. Multiple Tumor Region Detection

Implemented:

  • disconnected tumor region detection
  • total tumor region count
  • largest tumor component analysis

Using OpenCV connected component analysis.


4. Shape Complexity Analysis

Added tumor shape analysis using:

  • contour detection
  • perimeter analysis
  • circularity scoring

This helps evaluate tumor irregularity and spread patterns.


5. Unified Tumor Analysis Pipeline

python tumor_analysis_pipeline.py

This combines:

  • tumor metrics
  • severity analysis
  • region detection
  • shape analysis

into a single integrated pipeline.


6. Report Generation

Automatically generates:

  • tumor_analysis_report.json

inside:

analysis/reports/

Files Added

analysis/
├── README.md
├── tumor_metrics.py
├── severity_analysis.py
├── region_detection.py
├── shape_analysis.py
├── tumor_analysis_pipeline.py
└── reports/
    └── tumor_analysis_report.json

Testing Performed

Validated:

  • tumor occupancy calculations
  • severity classification logic
  • connected component detection
  • contour-based shape analysis
  • JSON report generation
  • end-to-end integrated pipeline execution

Successfully tested using existing segmentation output images from the project dataset pipeline.


Purpose

This enhancement improves:

  • segmentation interpretability
  • MRI analysis richness
  • post-processing research capabilities
  • clinically meaningful visualization
  • future extensibility for progression tracking

@Brijeshthummar02

Copy link
Copy Markdown
Owner

@shambavi2007 i am in between my final uni. exams as code diff is quite large i need time to review. till the time open new issues and work around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tumor Size & Severity Analysis

2 participants