Skip to main content

PeTu

Python Versions Stable Version Documentation Status tests codecov License

PeTu is a fully automated pipeline for segmenting pediatric brain tumors. It uses a 3D nnU-Net model trained on co-registered multi-parametric MRI scans, including T1c, T1n, T2w, and T2f sequences. Subsequently, the model provides segmented tumor regions, including:

  1. T2-hyperintense region (T2H) – typically encompassing solid tumor mass and associated edema.
  2. Enhancing tumor (ET) – regions with contrast uptake, indicative of active or aggressive tumor areas.
  3. Cystic component (CC) – fluid-filled regions often seen in certain pediatric tumor types.

Features

Data Requirements

PeTu is trained on pediatric brain MRI data from the Children's Hospital Zurich (Kispi), including cases with optic glioma affecting the optic nerve.

The model expects multi-parametric MRI scans (T1c, T1n, T2w, T2f) that are co-registered to T1c and then brought into SRI-24 brain atlas space.

[!IMPORTANT]
Since PeTu handles optic gliomas affecting the optic nerve, input data should be brain scans without defacing or skull-stripping to preserve critical anatomical structures. However, it may be worth experimenting with skull-stripped (BET) or defaced brain scans depending on your specific use case.

We recommend using the preprocessing package, part of the BrainLesion Suite, to design custom preprocessing pipelines tailored to your specific needs.

Installation

With a Python 3.10+ environment, you can install petu directly from PyPI:

pip install petu

Use Cases and Tutorials

A minimal example to create a segmentation could look like this:

from petu import Inferer

inferer = Inferer()

# Save NIfTI files
inferer.infer(
    t1c="path/to/t1c.nii.gz",
    fla="path/to/fla.nii.gz",
    t1="path/to/t1.nii.gz",
    t2="path/to/t2.nii.gz",
    ET_segmentation_file="example/ET.nii.gz",
    CC_segmentation_file="example/CC.nii.gz",
    T2H_segmentation_file="example/T2H.nii.gz",
)

# Or directly use pre-loaded NumPy data. (Both outputs work as well)
et, cc, t2h = inferer.infer(
    t1c=t1c_np,
    fla=fla_np,
    t1=t1_np,
    t2=t2_np,
)

[!NOTE]
If you're interested in the PeTu package, the Pediatric Segmentation may also be of interest.

Citation

Please support our development by citing the following manuscripts:

Enhancing efficiency in paediatric brain tumour segmentation using a pathologically diverse single-center clinical dataset

@misc{piffer2025enhancingefficiencypaediatricbrain,
      title={Enhancing efficiency in paediatric brain tumour segmentation using a pathologically diverse single-center clinical dataset}, 
      author={A. Piffer and J. A. Buchner and A. G. Gennari and P. Grehten and S. Sirin and E. Ross and I. Ezhov and M. Rosier and J. C. Peeken and M. Piraud and B. Menze and A. Guerreiro Stücklin and A. Jakab and F. Kofler},
      year={2025},
      eprint={2507.22152},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2507.22152}, 
}

Contributing

We welcome all kinds of contributions from the community!

Reporting Bugs, Feature Requests and Questions

Please open a new issue here.

Code contributions

Nice to have you on board! Please have a look at our CONTRIBUTING.md file.

Metadata

Release files for petu 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for petu 0.0.7
File Size Uploaded
petu-0.0.7.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for petu 0.0.7
File Interpreter ABI Platform
petu-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 26.6 kB

Release files / petu-0.0.7.tar.gz

Download URL petu-0.0.7.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0182f4206e331752f03e2bb4a4c8bd444048ff8e9786bc1aaba2d5154ec69dae
BLAKE2b-256 checksum
How to use checksums
93115044306bc58fe2348b01c45609852ac837c3bef8a280527806a3099866c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / petu-0.0.7-py3-none-any.whl

Download URL petu-0.0.7-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
892849aee58d06c7f7c593e93b8704ad3d7cd8dbce460fee3aed0e08feff4703
BLAKE2b-256 checksum
How to use checksums
eab86bc2dd302fb7fe3e46bc279b5b81b8465b5fdc683c3f63569f12900f6799
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page