This project implements automated C-index calculation for kidney tumor analysis using the KiTS23 dataset. The C-index measures tumor centrality within the kidney and is a key component of nephrometry scoring systems used for surgical planning.
Project working with USC Radiomics Laboratory on getting the C-Index of renal/kidney tumors that assesses danger levels of nephrectomies.
The C-index is calculated as the ratio of the distance between the center of mass of the tumor and the affected kidney region to the radius of the tumor:
C-Index = Distance / Tumor_Radius
Where:
- Distance: Euclidean distance between tumor center and affected kidney center
- Tumor Radius: Maximum distance between any two tumor voxels divided by 2
- Affected Kidney Region: Kidney parenchyma + cyst + tumor (union)
- Tumor Radius Method: Uses tumor extent for normalization
- Clinical Standard: Aligns with KiTS19 manual measurements
- Formula:
C-Index = Distance / Tumor_Radius
- Kidney Radius Method: Uses kidney volume for normalization
- Formula:
C-Index = Distance / Kidney_Radius - Use Case: Research comparisons only
| Metric | Value | Interpretation |
|---|---|---|
| R² | 0.492 | Strong correlation (49.2% variance explained) |
| Correlation (r) | 0.701 | Strong positive correlation |
| RMSE | 0.980 | Low prediction error |
| MAE | 0.704 | Low absolute error |
| P-value | < 0.001 | Highly statistically significant |
- ✅ Strong correlation with manual measurements
- ✅ Clinically reliable for surgical planning
- ✅ Automated replacement for manual C-index calculation
- ✅ Statistically validated against established standards
cindexGenerator_standard.py- Standard C-index calculator (tumor radius method)cindexGenerator.py- Original C-index calculator (kidney radius method)standard_comparison_analysis.py- Validation analysis scriptregression_analysis.py- Original comparison analysis
standard_results.csv- C-index results using standard methodresults.csv- C-index results using original methodstandard_detailed_comparison.csv- Detailed validation resultsstandard_c_index_comparison.png- Validation visualizations
regression_summary_report.md- Original analysis reportREADME.md- This file
pip install numpy pandas nibabel scipy scikit-image matplotlib seaborn scikit-learnpython cindexGenerator_standard.py KiTS23/dataset --out_csv results.csvpython standard_comparison_analysis.py- KiTS23 Dataset: NIfTI segmentation files
- Labels:
- 0 = Background
- 1 = Kidney parenchyma
- 2 = Tumor
- 3 = Cyst
CSV file with columns:
case_id- Patient case identifierc_index_standard- Standard C-index valuedistance_mm- Distance between centers (mm)tumor_radius_mm- Tumor radius (mm)com_*_mm- Center of mass coordinatesc_angle_deg- C-angle measurement- Additional metrics...
- Low C-index (< 1.0): Central tumors, more complex surgery
- High C-index (> 2.0): Peripheral tumors, potentially simpler surgery
- Intermediate (1.0-2.0): Variable complexity
- Nephrometry score validation
- Surgical outcome prediction
- Automated tumor characterization
- Load segmentation: NIfTI files with kidney/tumor labels
- Calculate centers: Center of mass for tumor and affected kidney
- Compute distance: Euclidean distance between centers
- Calculate tumor radius: Maximum pairwise distance / 2
- Compute C-index: Distance / Tumor_Radius
- Memory efficient: Convex hull sampling for large tumors
- Robust: Handles edge cases and missing data
- Fast: Optimized for large datasets
- 298 matched cases between KiTS23 and KiTS19
- Strong correlation (r = 0.701, p < 0.001)
- Low bias and acceptable limits of agreement
- Clinically equivalent to manual measurements
- Linear regression analysis
- Bland-Altman plots
- Distribution comparisons
- Component-wise validation
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
If you use this code in your research, please cite:
@misc{cindex_calculator_2024,
title={Automated C-Index Calculator for Kidney Tumor Analysis},
author={Your Name},
year={2024},
url={https://github.com/yourusername/c-index-kidney}
}This project is licensed under the MIT License - see the LICENSE file for details.
- KiTS23 Challenge organizers for the dataset
- KiTS19 Challenge for manual validation data
- Medical imaging community for methodology development
- USC Radiomics Laboratory for collaboration
Note: This implementation uses the standard tumor radius method, which has been validated against manual measurements and shows strong clinical correlation.