Skip to main content

Package to use nnUNet on 3D Slicer

Project description

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 (Invivo or Exvivo) --mode Invivo
--structure Structure to segment (Parenchyma, Airways, Vascular, ParenchymaAirways, All, Lobes) --structure Parenchyma
--input Path to the input image (.nii, .nii.gz, .mha, .nrrd) --input ~/data/scan_patient.nrrd
--output Output directory for the prediction (default: prediction) --output ~/predictions
--models_dir Path to store or search for models --models_dir ~/models
--name Final name of the prediction file (without extension) --name segmentation_parenchyma

Full Example

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nnunet_package-0.2.5.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nnunet_package-0.2.5-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file nnunet_package-0.2.5.tar.gz.

File metadata

  • Download URL: nnunet_package-0.2.5.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for nnunet_package-0.2.5.tar.gz
Algorithm Hash digest
SHA256 c0523b5ad7efcfd8c21bfa5091f3b90bbdcebc422659ab70863d3de93465d5b5
MD5 6527c39a0df89823202c22ca00f31d57
BLAKE2b-256 f25ae72a4ea9ab42d2a4c79f75ab8ee7fefd51478aa6d0a413ac64c0f2198ce0

See more details on using hashes here.

File details

Details for the file nnunet_package-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: nnunet_package-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.21

File hashes

Hashes for nnunet_package-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 64b2c758b01d6f5bcbc9db680785acd7c3a1fe9fa3ba1dcaee5b4689950cca37
MD5 280a206aaa059e6e4382e63d7fcf15b2
BLAKE2b-256 c6463b77d982c23ef3b3cb07567975d63b557bbb0710b436c55d6817eaa25c8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page