Pipeline for thigh ultrasound segmentation using nnU-Net and feature extraction
Project description
ThighUSSegmentation
Python library for automatic thigh ultrasound segmentation and analysis using nnU-Net.
Features
- Automatic image conversion to
.mha - Preprocessing (active region detection)
- nnU-Net inference
- Muscle thickness computation
- Radiomics feature extraction
- Export of anatomical landmarks (
.mrk.json) - Automatic model download from Zenodo
Installation
pip install thigh-us-segmentation
Install PyRadiomics for texture extraction
If you want to use the texture extraction feature, you need to install the PyRadiomics package separately, as it is not included in the main package:
pip install pyradiomics=="3.0.1"
Usage
from ThighUSSegmentation import run_full_pipeline
result = run_full_pipeline(
input_image_path="image.dcm",
output_root="outputs",
case_id = "case001"
)
print(result["df_results"])
# OR
result = run_full_pipeline(
input_image_path="image.mha",
output_root="outputs",
models_root="D:/mis_modelos", #You can also specify your own model path.
)
Output
outputs/
└── case001/
├── image_converted.mha
├── image_preprocessed.mha
├── case001_labelmap.mha
├── markups/
└── inference_log.txt
Returned Results
The pipeline returns a dictionary:
{ "case_id": str, "segmentation_path": str, "mrk_paths": dict, "df_distances": pd.DataFrame, "df_textures": pd.DataFrame, "df_results": pd.DataFrame }
Model
The pretrained nnU-Net model is automatically downloaded from Zenodo on first use.
Expected strucutre:
Dataset001_ThighUS/
└── nnUNetTrainer__nnUNetPlans__2d/
├── dataset.json
├── plans.json
├── fold_0/
├── fold_1/
├── fold_2/
├── fold_3/
└── fold_4/
Requirements
· Python ≥ 3.9 · SimpleITK · PyRadiomics · OpenCV · NumPy / SciPy / Pandas
Citation
If you use this work, please cite:
Isensee et al., nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nature Methods (2021)
Mara Concepción Alavarez. (2026). Thigh Ultrasound Segmentation Model (nnU-Net). Zenodo. https://doi.org/10.5281/zenodo.19914473
License
This project uses the following licenses: · Code: MIT License (or the one you choose) · Model weights (Zenodo): CC-BY 4.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thigh_us_segmentation-0.1.3.tar.gz.
File metadata
- Download URL: thigh_us_segmentation-0.1.3.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
183c9fd5e4054967cb911b1c49f489f8048b06ae01bc98415827ddbf12b2219a
|
|
| MD5 |
ac2cf48ac7ac63c248ac144207bcf024
|
|
| BLAKE2b-256 |
70d0df82bfb6a3e64c8a27517f17df9aa8b7c0f7c3f19f6fca018516d6a4676e
|
File details
Details for the file thigh_us_segmentation-0.1.3-py3-none-any.whl.
File metadata
- Download URL: thigh_us_segmentation-0.1.3-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
514143309489aea198cda060a7456c466a103a55b495a7681a88533462ef35ae
|
|
| MD5 |
1ddb074489c18dfbacbb3950c54447d2
|
|
| BLAKE2b-256 |
542c0cf29c667bc04d56363e60cdc04ff9cd811b3c36158a7288e05452a501c5
|