Skip to content

lescientifik/pysuv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pySUV

A Python library for calculating Standardized Uptake Value (SUV) from PET DICOM images.

Table of Contents

Why pySUV?

SUV calculation is essential for PET image analysis, whether for traditional clinical reading (PERCIST criteria, Deauville score) or machine learning pipelines (radiomic features, preprocessing). Yet no simple, validated Python library exists.

Alternative Strength Limitation
3D Slicer Complete, multi-vendor Heavy dependency (~500 MB), GUI-oriented, hard to script
Z-Rad Excellent, validated (arXiv:2410.13348) Broad scope (full radiomics + GUI), many dependencies
ACRCode Vendor-neutral, lightweight Incomplete implementation (edge cases)
GitHub snippets Simple Unvalidated, BQML-only

pySUV provides a focused, validated solution: one function call, multi-vendor support, < 1% error vs QIBA reference. Beyond accurate calculations, it validates DICOM metadata against clinical guidelines—catching data entry errors and protocol deviations before they affect your results.

Features

  • Validated: Cross-validated against QIBA DRO (< 1% error)
  • Multi-vendor: Siemens, GE, Philips (BQML and CNTS units)
  • Four normalizations: SUVbw, SUVlbm, SUVbsa, SUVibw
  • Simple API: Compute SUV arrays or get conversion factors
  • Clinical validation: Optional module for protocol compliance checks

Installation

pip install pysuv
# or
uv add pysuv

Quick Start

import pysuv

# Calculate SUV from a PET DICOM file
suv = pysuv.compute_suv("pet.dcm")
print(f"SUVmax: {suv.max():.2f}")

# Use different normalizations
suv_lbm = pysuv.compute_suv("pet.dcm", normalization="lbm")
suv_bsa = pysuv.compute_suv("pet.dcm", normalization="bsa")

Documentation

API Reference

compute_suv(source, normalization='bw')

Compute SUV array from a PET DICOM image.

  • source: Path to DICOM file or pydicom Dataset
  • normalization: 'bw' (default), 'lbm', 'bsa', or 'ibw'

Returns a numpy array of SUV values (same shape as input image).

get_suv_factor(source, normalization='bw')

Get the SUV conversion factor without computing the full array. Useful for applying to ROIs or storing for reproducibility.

import pydicom
import pysuv

factor = pysuv.get_suv_factor("pet.dcm")

# Apply to pixel data (works for all vendors)
ds = pydicom.dcmread("pet.dcm")
scaled = ds.pixel_array * factor.rescale_slope + factor.rescale_intercept
suv = scaled * factor.suv_factor

get_suv_parameters(source)

Inspect the parameters used for SUV calculation.

info = pysuv.get_suv_parameters("pet.dcm")
print(info)
# SUV Parameters:
#   Manufacturer: SIEMENS
#   Injected dose: 370.0 MBq
#   Patient weight: 70.0 kg
#   Half-life: 109.77 min
#   Elapsed time: 60.0 min

Normalizations

Type Description Required fields
bw Body weight (default) weight
lbm Lean body mass weight, height, sex
bsa Body surface area weight, height
ibw Ideal body weight weight, height, sex

Validation

pySUV is validated against:

  • QIBA DRO: Digital Reference Object with known SUV values
  • Reference implementations: Z-Rad, ACRCode, 3D Slicer

References

Disclaimer

For research use only. This software is not intended for clinical decision-making or diagnostic purposes. It has not been cleared or approved by any regulatory agency.

The authors provide this software "as is" without warranty of any kind. In no event shall the authors be liable for any claim, damages, or other liability arising from the use of this software.

Users are responsible for validating results against their institution's reference standards before use in any research or clinical context.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages