Skip to main content

LungSegmentation nnUNetv2 Prediction Script

Python License

A Python script to easily run nnUNetv2 lung segmentation predictions on medical images. Automatic model download, file preparation for prediction, and result renaming included.


Features

  • Automatic download and extraction of models from a URL.
  • Preparation of dataset.json for nnUNet prediction.
  • Conversion of input images to .nrrd if necessary.
  • Prediction execution with detailed logs.
  • Automatic cleanup of temporary files.
  • Automatic renaming of the final prediction file.

Requirements

Before running the script, make sure you have installed and configured the following:

git clone https://github.com/FlorianDAVAUX/nnUNet_package.git
cd nnUNet_package
pip install -e .

Usage


Option Description Example


--mode Prediction mode --mode Invivo (Invivo or Exvivo)

--structure Structure to segment --structure Parenchyma (Parenchyma,
Airways, Vascular,
ParenchymaAirways,
All, Lobes)

--input Path to the input image --input ~/data/scan_patient.nrrd (.nii, .nii.gz, .mha,
.nrrd)

--output Output directory for the --output ~/predictions prediction (default:
prediction)

--models_dir Path to store or search --models_dir ~/models for models

--name Final name of the --name segmentation_parenchyma prediction file (without extension)


Full Example

nnunet_predict     --mode Invivo     --structure Parenchyma     --input ~/data/scan_patient.nrrd     --output ~/predictions     --models_dir ~/models     --name segmentation_parenchyma

Metadata

Release files for nnUNet-package 0.2.4

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

Source distribution (sdist)

Source distribution for nnUNet-package 0.2.4
File Size Uploaded Provenance Actions
nnunet_package-0.2.4.tar.gz 6.2 kB Without provenance Details for nnunet_package-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nnUNet-package 0.2.4
File Interpreter ABI Platform Actions
nnunet_package-0.2.4-py3-none-any.whl Python 3 none any Details for nnunet_package-0.2.4-py3-none-any.whl

Total release size: 13.0 kB

Release files / nnunet_package-0.2.4.tar.gz

Download URL nnunet_package-0.2.4.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
690dfa744a52cf175fbe75241432801c71523a6f0b3d0242b6344ff7cfeddf15
BLAKE2b-256 checksum
How to use checksums
9c8efa2a941db6c59b41c30823aaf4ae4c5fe6784ee99c240d9e18bc68b49fc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Release files / nnunet_package-0.2.4-py3-none-any.whl

Download URL nnunet_package-0.2.4-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86c8fee20ba528d0309b2091e5111f59e62baf8547aed0960c7f1f465093c477
BLAKE2b-256 checksum
How to use checksums
ba344f2345a4b53d0c7f93c5c24d39cce6861b1c0479c40fdb6e2fdd1a2b604d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.21

Security for nnUNet-package 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files No provenance

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