Skip to main content

radiomicsjl

Python interface to Radiomics.jl: fast, IBSI-compliant radiomic feature extraction, on CPU or NVIDIA GPU.

pip install radiomicsjl

No Julia installation is needed. The first call downloads Julia and Radiomics.jl into the current Python environment (a few minutes, once); after that, start-up takes a few seconds.

Usage

import radiomicsjl as rjl

# From files (NIfTI, NRRD, DICOM file or folder): spacing is read from the header
feats = rjl.extract_radiomic_features("ct.nii.gz", "mask.nii.gz", n_bins=32)

# From numpy arrays: spacing is required, one value per array axis
feats = rjl.extract_radiomic_features(image, mask, spacing=[0.98, 0.98, 3.0], bin_width=25)

print(feats["firstorder_mean"], feats["glcm_Contrast"])

The arguments are the same as Radiomics.extract_radiomic_features in Julia:

argument default
features all e.g. ["first_order", "glcm", "glrlm", "glszm", "gldm", "ngtdm", "shape3d"] ("shape2d" for 2D images)
labels 1 an int, or a list of ints → {label: features}
n_bins / bin_width 32 bins discretisation
weighting_norm None e.g. "euclidean"
keep_largest_only True keep only the largest connected component
slices_2d None list of (axis, index), 0-based as in numpy: (2, 10) is image[:, :, 10] → {(axis, index): features}
features_std False per-direction standard deviation for GLCM/GLRLM
get_raw_matrices False also return the texture matrices (numpy arrays)
use_gpu False CUDA acceleration (see below)
suv_ibsi_normalization False SUVbw normalisation for PET DICOM
verbose False
filter_type None image filter before extraction: "haar", "log", "gabor" → {"<filter>_<map>": features}
filter_params None filter parameters as a dict, e.g. {"level": 2}, {"sigma": [1.0, 3.0]}

SimpleITK, numpy and spacing

The easiest way with SimpleITK is to pass the images themselves: array and spacing are taken from them, in (x, y, z) order like the file readers.

import SimpleITK as sitk
img, msk = sitk.ReadImage("ct.nii.gz"), sitk.ReadImage("mask.nii.gz")
feats = rjl.extract_radiomic_features(img, msk, n_bins=32)

With numpy arrays, spacing must follow the array axes. Beware that sitk.GetArrayFromImage returns (z, y, x) while GetSpacing() is (x, y, z): passing them together gives wrong shape and texture features. Pass the image instead, or reverse the spacing (GetSpacing()[::-1]). Arrays from nibabel are already (x, y, z), in the same order as header.get_zooms().

With an image filter (Haar wavelet, Laplacian of Gaussian or Gabor):

features = rjl.extract_radiomic_features('DATA_PATH/ct.nii.gz', 'DATA_PATH/mask.nii.gz',
                                         filter_type="haar", filter_params={"level": 1})
features["haar_wavelet-LLH"]["glcm_Contrast"]

GPU

python -m radiomicsjl install-gpu   # adds CUDA.jl to the Julia environment (once)

then use_gpu=True. Requires an NVIDIA GPU with a recent driver.

Other commands

python -m radiomicsjl setup     # install Julia + Radiomics.jl now instead of at first use
python -m radiomicsjl version

Julia uses all CPU cores by default; set PYTHON_JULIACALL_THREADS=4 (before importing) to limit it. The Julia environment lives inside the Python environment, so each virtualenv/conda env has its own.

License

MIT

Metadata

Release files for radiomicsjl 2.1.1

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

Source distribution (sdist)

Source distribution for radiomicsjl 2.1.1
File Size Uploaded Provenance Actions
radiomicsjl-2.1.1.tar.gz 15.9 kB With provenance Details for radiomicsjl-2.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 26.8 kB

Release files / radiomicsjl-2.1.1.tar.gz

Download URL radiomicsjl-2.1.1.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dc801f026e462be8767f893dd88873cde199b92010b89d6ca626faa98dacac6d
BLAKE2b-256 checksum
How to use checksums
2ee693b2e638f67b53175228d44580fe18c9ba54ab12db0d629d508f2fadd150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / radiomicsjl-2.1.1-py3-none-any.whl

Download URL radiomicsjl-2.1.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98b6111002e95be47b9071154b3b62ebbff6007983ca8cc52dc138ddc1d7187b
BLAKE2b-256 checksum
How to use checksums
c935ee8ebd238b650db367b939969ad501d10faf9d65f23309fbbe65eaac8c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for radiomicsjl 2.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for radiomicsjl-2.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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

2.1.1 This release

2 release files Full 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