Skip to main content

Python wrapper for RadiomicsJ (Java-based radiomics feature extraction)

Project description

RadiomicsJ (Python Wrapper)

PyPI version License

RadiomicsJ is a Python wrapper for the Java-based radiomics feature extraction library RadiomicsJ. It provides highly accurate, IBSI-compliant feature calculations directly from Python, utilizing JPype to run on the JVM.

Prerequisites

  • Java 8 or higher must be installed and available in your system path.
  • Note: If you are using Google Colab, the JDK is pre-installed, so no additional setup is required.

Installation

pip install radiomicsj

Quick Start

You can compute features by passing file paths or NumPy arrays directly.

1. Using File Paths

from radiomicsj import calculate_features

'''
path to folders

# pattern1 : series folder
image_folder/images
mask_folder/masks

# pattern2 : NIfTI or Tiff, also specify parent folder.
image_folder/image.nii.gz
mask_folder/mask.nii.gz
image_folder/image.tif
mask_folder/mask.tif
'''

df = calculate_features(payh_to_image_folder, path_to_mask_folder)
print(df.head())

2. Using NumPy Arrays (In-Memory Processing)

import numpy as np
from radiomicsj import calculate_features

# z,y,z order
image_np = np.random.rand(5, 10, 10)
mask_np = np.ones((5, 10, 10)) # radiomicsj default label is 1.

# Specify voxel spacing (Width, Height, Depth)
df = calculate_features(image_np, mask_np, spacing=(1.0, 1.0, 1.0))

Using a Configuration file

from radiomicsj.core import RadiomicsJExtractor

# Initialize with a properties file
extractor = RadiomicsJExtractor("path/to/params.properties")

results = []
for path_to_image, path_to_mask in my_image_list:
    df = extractor.execute(path_to_image, path_to_mask)
    results.append(df)

# To update properties dynamically:
# extractor.load_settings("path/to/another_params.properties")

Citation

If you use RadiomicsJ in your research, please cite:

Kobayashi T. RadiomicsJ: a library to compute radiomic features. Radiol Phys Technol. 2022 Sep;15(3):255-263. doi: 10.1007/s12194-022-00664-4. Epub 2022 Jul 6. PMID: 35792994.

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

radiomicsj-2.1.17.tar.gz (74.4 MB view details)

Uploaded Source

Built Distribution

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

radiomicsj-2.1.17-py3-none-any.whl (74.4 MB view details)

Uploaded Python 3

File details

Details for the file radiomicsj-2.1.17.tar.gz.

File metadata

  • Download URL: radiomicsj-2.1.17.tar.gz
  • Upload date:
  • Size: 74.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for radiomicsj-2.1.17.tar.gz
Algorithm Hash digest
SHA256 3e00ba73509948565808220fb8851132d2606d058013db2c510eb9989aa649e7
MD5 6e6c85750dfe45f3177b589be7ccb9c8
BLAKE2b-256 9132efd2880896d736a0753a278d23f86724442d44b043a30659bba649f6e8ea

See more details on using hashes here.

File details

Details for the file radiomicsj-2.1.17-py3-none-any.whl.

File metadata

  • Download URL: radiomicsj-2.1.17-py3-none-any.whl
  • Upload date:
  • Size: 74.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for radiomicsj-2.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 132c78aed9277c4e664905114b743522e2358bc75b292e9116679606c6946a2e
MD5 7b6639bfaaf2251b4a2f01226f7ed2b2
BLAKE2b-256 395fb7e0b3b7bf9b38610d57441a762e75b4a0ba76d0bf0ec8557b3d77ad780d

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