pysera


Namepysera JSON
Version 2.0.2 PyPI version JSON
download
home_pagehttps://github.com/MohammadRSalmanpour/PySERA
SummaryA Python library for radiomics feature extraction with multiprocessing support
upload_time2025-10-20 07:46:49
maintainerNone
docs_urlNone
authorMohammad R. Salmanpour, Amir Hossein Pouria
requires_python>=3.8
licenseNone
keywords medical-imaging standardized-radiomics-feature-extraction quantitative-analysis ibsi-standardization healthcare
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PySERA: Python-Based Standardized Extraction for Radiomics Analysis – Python Radiomics Script and Library

[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Development Status](https://img.shields.io/badge/status-stable-green.svg)](https://pypi.org/project/pysera/)

**PySERA** (Python-based Standardized Extraction for Radiomics Analysis) is a comprehensive Python library for radiomics feature extraction from medical imaging data. It provides a **simple, single-function API** with built-in multiprocessing support, comprehensive report capabilities, and optimized performance through OOP architecture, RAM optimization, and CPU-efficient parallel processing.

## 🔍 Table of Contents
- [🧩IBSI (Image Biomarker Standardisation Initiative) Standardization-1.0](#IBSI-Standardization)
- [🛠️Key Features](#key-features)
- [📥Installation](#installation)
  - [🌐GitHub Installation](#github-installation)
  - [💻Python Script - Command Line Interface (CLI)](#python-script---command-line-interface-cli)
  - [📦Library Installation via pip](#library-installation-via-pip)
- [📚Library Usage](#library-usage)
  - [📂Single File Processing](#single-file-processing)
  - [🧠In-Memory Array Processing](#in-memory-array-processing)
  - [⚡Parallel Batch Processing](#parallel-batch-processing)
  - [🔧Advanced Configuration](#advanced-configuration)
- [📂Data Structure Requirements](#data-structure-requirements)
- [📋PySERA Parameters Reference](#pysera-parameters-reference)
- [📚API Reference](#api-reference)
- [📊Output Structure](#output-structure)
- [🔢Feature Extraction Modes](#feature-extraction-modes)
- [📁Supported File Formats](#supported-file-formats)
- [🎯Library Examples](#library-examples)
- [⚡Performance Tips](#performance-tips)
- [❓Troubleshooting](#troubleshooting)
- [🕒Version History](#Version-History)
- [📬Contact](#contact)
- [👥Authors](#authors)
- [🙏Acknowledgment](#acknowledgment)
- [📜License](#license)

## ✨IBSI Standardization
Both the script and library have been rigorously standardized based on **IBSI** (Image Biomarker Standardisation Initiative) Standardization 1.0. PySERA returns IBSI-compliant feature values that match the reference standard, ensuring reproducibility and comparability across studies.
See the detailed evaluation and test cases here: [IBSI_Evaluation Folder](https://github.com/MohammadRSalmanpour/PySERATest/tree/main/IBSI_Evaluation)

## 🛠️Key Features

PySERA provides a **single-function API** that handles all radiomics processing:

```python
import pysera

result = pysera.process_batch(
    image_input="image.nii.gz",
    mask_input="mask.nii.gz",
    output_path="./results"
)
```

That's it! 🎉 All the complexity of multiprocessing, error & warning reports, file format handling, and feature extraction is handled automatically.

- **Single Function API**: One function does everything - `pysera.process_batch()`
- **Multi-format Support**: NIfTI, DICOM, NRRD, RTSTRUCT, NumPy arrays, and more
- **Automatic Multiprocessing**: Built-in parallel processing for maximum performance
- **Comprehensive Report**: Excel export functionality for detailed analysis
- **Extensive Features**: 557 IBSI-compliant radiomics features across multiple categories (morphological, statistical, texture, etc.) and dimensions (1st, 2D, 2.5D, 3D)
- **Medical Image Optimized**: Designed for CT, MRI, PET, SPECT, X-Ray, Ultrasound, and other medical imaging modalities.

## 📥Installation

PySERA can be installed as a Python library for integration into your projects or as a standalone script for command-line usage. It supports Windows, macOS, and Linux. Below are the installation options.

### 🌐GitHub Installation 

For users who want to develop with the source code or run PySERA as a standalone command-line tool (CLI) without installing it as a Python package, you can clone the repository from GitHub.
This gives you access to the standalone script radiomics_standalone.py and all example files. After installing the dependencies, you can run the script directly (see the [💻Python Script - Command Line Interface (CLI)](#python-script---command-line-interface-cli) section).

```bash
# Clone the repository
git clone https://github.com/MohammadRSalmanpour/PySERA.git
cd pysera
```
### macOS/Linux Installation
#### Quick Setup (Recommended):

```bash
# Quick setup (creates a virtual environment and installs everything)
./dev_setup.sh
```
#### Manual Setup:

```bash
python3 -m venv venv
source venv/bin/activate
pip install -e .

```
### Windows Setup
#### Quick Setup (Recommended):

```bash
# Quick setup
./dev_setup.sh
```

#### Manual Setup

```bash

python -m venv venv
.\venv\Scripts\activate
cd PySERA
pip install -r requirements.txt

```

### 💻Python Script - Command Line Interface (CLI)

If you just want to run the CLI without installing the library into Python,the standalone script 'radiomics_standalone.py' provides a command-line interface for radiomics processing :

```bash
# Process single files
python radiomics_standalone.py \
    --image_input image.nii.gz \
    --mask_input mask.nii.gz \
    --output ./results

# Batch processing (folders)
python radiomics_standalone.py \
    --image_input ./images \
    --mask_input ./masks \
    --output ./results \
    --num_workers 4
```

### 📦Library Installation via pip

Install the PySERA library directly from PyPI:

```bash
pip install pysera
```

## 📚Library Usage

Once installed, you can use PySERA directly in your Python code.

### 📂Single File Processing

```python
import pysera

# Process single image-mask pair
result = pysera.process_batch(
    image_input="scan.nii.gz",
    mask_input="mask.nii.gz",
    output_path="./results"
)

print(f"Success: {result['success']}")
print(f"Features extracted: {result['features_extracted']}")
print(f"Processing time: {result['processing_time']:.2f} seconds")
```

### 🧠In-Memory Array Processing

```python
import numpy as np
import nibabel as nib
import pysera

# Load image and mask as NumPy arrays (for example, using nibabel)
image_array = nib.load("patient002_image.nii.gz").get_fdata()
mask_array = nib.load("patient002_mask.nii.gz").get_fdata()

# Process the image and mask directly from memory
result = pysera.process_batch(
    image_input=image_array,
    mask_input=mask_array,
    output_path="./results"
)

# Display results
print(f"Success: {result['success']}")
print(f"Features extracted: {result['features_extracted']}")
print(f"Processing time: {result['processing_time']:.2f} seconds")
```

### ⚡Parallel Batch Processing

```python
import pysera

# Process multiple files with 4 CPU cores
result = pysera.process_batch(
    image_input="./patient_scans",
    mask_input="./patient_masks", 
    output_path="./results",
    num_workers="4",              # Use 4 CPU cores
    categories="glcm, glrlm",     # Extract specific feature categories
    dimensions="1st, 2_5d, 3d",   # Extract features in specified dimensions
    apply_preprocessing=True,   # Apply ROI preprocessing
)

print(f"Processed {result['processed_files']} files")
print(f"Total processing time: {result['processing_time']:.2f} seconds")
```

## 🔧Advanced Configuration

```python
import pysera

# Comprehensive processing with custom parameters
result = pysera.process_batch(
    image_input="image.nii.gz",
    mask_input="mask.nii.gz",
    output_path="./results",
    
    # Performance settings
    num_workers="2",           # Use 2 CPU cores
    enable_parallelism=False ,     # Disable multiprocessing
    
    # Image feature extraction settings
    categories="glcm, glrlm, glszm",  # Extract specific texture feature categories
    dimensions="1st, 2_5d, 3d",       # Extract features in 1st order, 2.5D and 3D dimensions
    # Alternative examples for categories and dimensions:
    # categories="all",                 # Extract all 557 features (default)
    # categories="stat, morph, glcm",   # Statistical, morphological and GLCM features
    # dimensions="2D",                  # Extract only 2D features
    # dimensions="all",                 # Extract features in all dimensions (default)
    
    bin_size=25,               # Texture analysis bin size
    roi_num=2,                # Number of ROIs to process
    roi_selection_mode="per_region",  # ROI selection strategy
    min_roi_volume=5,          # Minimum ROI volume threshold
    
    # Processing options
    apply_preprocessing=True,   # Apply ROI preprocessing
    feature_value_mode="APPROXIMATE_VALUE",  #	Strategy for handling NaN values.

    # IBSI parameters (advanced, overrides defaults)
    IBSI_based_parameters={
        "radiomics_DataType": "CT",
        "radiomics_DiscType": "FBN",
        "radiomics_isScale": 1
    },
    
    # Logging options
    report="info"             # Report detail level: "all" (full processing details), 
                              # "info" (essential information), "warning" (warnings only), 
                              # "error" (errors only), "none" (no reporting). Default: "all"
)
```


## 📂Data Structure Requirements

For batch processing or multi-DICOM inputs, the folder structure for images and masks must follow these rules:
   - The **final folders** containing images and masks (e.g., ``images/`` and ``masks/``) must **not contain additional subfolders**. Only the image and mask files should be present in these folders.
   - There must be **only one folder level** between the parent folder and the image/mask files (e.g., ``parent/images/image001.nii.gz`` or ``parent/masks/mask001.nii.gz``).
   - **Warning**: Any additional internal subfolders within the final images or masks folders will cause PySERA to **malfunction** and fail to process the data correctly.

## Patient-Subfolder Organization (NIfTI/DICOM)

**Works with both:**

1. **DICOM Series** (multiple `.dcm` files per patient)  
2. **NIfTI Files** (single `.nii.gz` per patient)


### 🏷️Example Structures

**Note:**  PySERA supports all major formats, including DICOM, multi-slice DICOM, NIfTI, NRRD, RT Struct, and NumPy arrays.

#### 1️⃣**Flat NIfTI/NRRD Structure** 

**✅Correct:**
    
      parent/
      ├── images/ # All scan files directly here
      │   ├── patient001.nii.gz
      │   ├── patient002.nii.gz
      │   └── patient003.nii.gz
      └── masks/  # All mask files directly here
          ├── patient001.nii.gz
          ├── patient002.nii.gz
          └── patient003.nii.gz

#### 2️⃣**Patient-Subfolder NIfTI Structure**

**✅Correct:**

    parent/
    ├── CT_Images/ # Each patient has own folder
    │ ├── patient_01/
    │ │ └── scan.nii.gz # Single NIfTI file
    │ └── patient_02/
    │ └── scan.nii.gz
    └── CT_Masks/ # Mirrored structure
    ├── patient_01/
    │ └── segmentation.nii.gz
    └── patient_02/
    └── segmentation.nii.gz
    
**Notes:**  

- PySERA automatically processes DICOM series organized in patient subfolders.  
- **Patient subfolders are required** (one folder per patient).  
- **All DICOM slices for one series must be in the same patient folder.**  
- **Mask files must mirror the image folder structure.**  
  If there is a folder for `patient_01` under `CT_Images/`, there must be a corresponding `patient_01` folder under `CT_Masks/` containing the RTSTRUCT or mask.
    
    
### 3️⃣DICOM Series Structure

**✅Correct:**
    

    parent/
    ├── CT_Images/  # --image-input
    │ ├── patient_01/ # DICOM series folder
    │ │ ├── slice1.dcm  # Any number of slices
    │ │ ├── slice2.dcm
    │ │ └── slice3.dcm
    │ └── patient_02/
    │ ├── slice1.dcm
    │ └── slice2.dcm
    └── CT_Masks/   # --mask-input
    ├── patient_01/
    │ └── mask.dcm 
    └── patient_02/
    └── mask.dcm

   
**❌Incorrect Structure (Will Fail):**

      parent/
      ├── images/
      │   ├── subfolder1/
      │   │   ├── patient001.nii.gz
      │   └── subfolder2/
      │       ├── patient002.nii.gz
      └── masks/
          ├── subfolderA/
          │   ├── patient001.nii.gz
          └── patient002.nii.gz

### 📋PySERA Parameters Reference


| Parameter            | Type        | Default         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|----------------------|-------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **image_input**       | str / .npy  | Required        | Path to the image file, directory, or NumPy file containing the image data.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **mask_input**        | str / .npy  | Required        | Path to the mask file, directory, or NumPy file defining the regions of interest.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **output_path**      | str         |  `"./output_result"` | Directory where the processing results will be saved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| **num_workers**      | str         | `"auto"`            | Number of CPU cores to use for processing. If auto, uses all available cores.                                                                                                                                                                                                                                                                                                                                                                                                                        
|  **apply_preprocessing** | bool        | False           | If True, rounds mask array values to nearest integers. If False, uses raw mask values without rounding. |                                                                                                                                                                                                                                                                                                 
| **enable_parallelism**  | bool        | True            | If True, enables parallel processing for the analysis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **min_roi_volume**      | int         | 10              | Minimum volume threshold for regions of interest (ROI).                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| **bin_size**            | int         | 25              | Bin size used for texture analysis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **roi_selection_mode**  | str         | `"per_Img"`          | **ROI selection strategy:**<br>- **"per_Img"** (default): Selects the top `roi_num` ROIs per image based on size, regardless of label category.<br>  • Suitable for single or dominant lesions per scan.<br>  • Preserves original spatial relationships.<br>- **"per_region"**: Selects up to `roi_num` ROIs separately for each label category, ensuring balanced representation across regions.<br>  • Useful in multi-lesion, multi-label, or longitudinal studies.<br>  • Requires consistent ROI labeling across datasets.<br> |
| **roi_num**             | int         | 10              | Number of ROIs to process.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **feature_value_mode**  | str         | `"REAL_VALUE"`     | Strategy for handling NaN values. Options:`"APPROXIMATE_VALUE"` or `"REAL_VALUE"`. **"APPROXIMATE_VALUE"**: Replaces NaN features with substitutes (e.g., very small constants like `1e-30` or synthetic masks) to maintain pipeline continuity.<br>- **"REAL_VALUE"** (default): Keeps NaN values whenever feature extraction fails (e.g., small ROI, numerical instability), preserving the raw outcome without substitution.<br>                                                                                                     |
| **categories**          | str         | `"all"`            | Feature categories to extract. Choices: "diag" (diagnostics), "morph" (morphological/shape), "ip" (intensity peak), "stat" (first-order statistical), "ih" (intensity histogram), "ivh" (intensity-volume histogram), "glcm" (Gray-Level Co-occurrence Matrix), "glrlm" (Gray-Level Run Length Matrix), "glszm" (Gray-Level Size Zone Matrix), "gldzm" (Gray-Level Distance Zone Matrix), "ngtdm" (Neighboring Gray-Tone Difference Matrix), "ngldm" (Neighboring Gray-Level Dependence Matrix), "mi" (moment-invariant). Example: "glcm, glrlm". Default "all" extracts all 557 features. |
| **dimensions**          | str         | `"all"`           | Spatial dimensions for feature extraction. Choices: "1st" (first-order intensity-based features), "2D" (features extracted per 2D slice), "2_5D" (features aggregated across slices with limited inter-slice context), "3D" (fully volumetric features across entire ROI). Example: "1st, 2_5d, 3d". Combine with categories for specific feature sets. |
| **callback_fn**          | function    | None            | Callback function for external notifications. Receives parameters: flag (`"START"`\|`"END"`), image_id (str), roi_name (str). Useful for integration with notification platforms. |
| **extraction_mode**      | str         | `"handcrafted_feature"` | Feature extraction mode. Options: `"handcrafted_feature"` (traditional radiomics), `"deep_feature"` (deep learning features).  |
| **deep_learning_model**  | str         | `"resnet50"`    | Deep learning model for feature extraction when extraction_mode="deep_feature". Options:`"resnet50"`, `"vgg16"`, `"densenet121". |
| **temporary_files_path** | str         |`"./temporary_files_path"`  | Directory for caching intermediate NumPy masks during DICOM-RT (RTSTRUCT) processing. Prevents memory spikes by writing per-ROI masks to disk and streaming them on demand. Automatically created if missing; contents are automatically cleared after processing. Not used for other image formats. |
| **report**              | str         | `"all"`           | Report detail level: "all" (full processing details), "info" (essential information), "warning" (warnings only), "error" (errors only), "none" (no reporting). Default: "all". |
| **IBSI_based_parameters** | dict / JSON | See defaults    | Advanced configuration parameters. See the table below for detailed descriptions. |


#### 🔧Advanced configuration parameters (IBSI_based_parameters)


| Parameter                   | Type   | Default                | Description                                                                 |
|-----------------------------|--------|------------------------|-----------------------------------------------------------------------------|
| **radiomics_DataType**      | str    |  `"OTHER"`                 | Image modality type (CT / PET / MRI / OTHER).                               |
| **radiomics_DiscType**      | str    | `"FBS"`                 | Specifies the discretization type used for gray-level calculation — either "FBN" (fixed bin numbers) or "FBS" (fixed bin size or fixed bin width). |
| **radiomics_isScale**       | int    | 0                      | Determines whether image resampling is performed. Set to 1 to enable resampling or 0 to retain the original voxel dimensions.              |
| **radiomics_VoxInterp**     | str    | `"Nearest"`              | Defines the interpolation type used for image resampling. Accepted values include `"Nearest"`, `"linear"`, `"bilinear"`, `"trilinear"`, `"tricubic-spline"`, `"None"`.                |
| **radiomics_ROIInterp**     | str    | `"Nearest"`              | Specifies the interpolation type for ROI resampling (`"Nearest"`, `"linear"`, `"bilinear"`, `"trilinear"`, `"tricubic-spline"`, `"None"`.)                                       |
| **radiomics_isotVoxSize**   | int    | 2                      | Sets the new isotropic voxel size for 3D resampling, applied equally to the X, Y, and Z dimensions.                               |
| **radiomics_isotVoxSize2D** | int    | 2                      | Defines the voxel size for resampling in 2D mode, keeping the Z dimension unchanged while rescaling X and Y.                                |
| **radiomics_isIsot2D**      | int    | 0                      | Indicates whether to resample to isotropic 2D voxels (1) or isotropic 3D voxels (0). Applicable mainly for first-order features, as higher-order 2D features always use the original slice thickness.                           |
| **radiomics_isGLround**     | int    | 0                      | Determines whether to round voxel intensities to the nearest integer (commonly 1 for CT, 0 for PET and SPECT).                       |
| **radiomics_isReSegRng**    | int    | 0                      | Enables range-based re-segmentation. The valid intensity range is specified in radiomics_ReSegIntrvl01 and radiomics_ReSegIntrvl02. Note: not recommended for arbitrary-unit modalities such as MRI or SPECT.                            |
| **radiomics_isOutliers**    | int    | 0                      | Controls outlier removal, where 1 removes intensities beyond ±3σ.                         |
| **radiomics_isQuntzStat**   | int    | 1                      | Determines whether quantized images are used to compute first-order statistics. Set to 0 to use raw intensities (preferred for PET).                 |
| **radiomics_ReSegIntrvl01** | int    | -1000                  | Specifies the lower bound for range re-segmentation; intensities below this value are replaced with NaN.                          |
| **radiomics_ReSegIntrvl02** | int    | 400                    | Specifies the upper bound for range re-segmentation; intensities above this value are replaced with NaN.                          |
| **radiomics_ROI_PV**        | float  | 0.5                    | Defines the partial volume threshold for ROI binarization after resampling. Voxels with values below this threshold are excluded.                       |
| **radiomics_qntz**          | str    |`"Uniform"`              | Sets the quantization strategy for fixed bin number discretization. Options are "Uniform" or "Lloyd" (for Max-Lloyd quantization).                              |
| **radiomics_IVH_Type**      | int    | 3                      | {0: Definite (PET, CT), 1: Arbitrary (MRI, SPECT), 2: 1000 bins, 3: same discretization as histogram (CT)}.                         |
| **radiomics_IVH_DiscCont**  | int    | 1                      | Defines IVH continuity: {0: Discrete (CT), 1: Continuous (CT, PET; for FBS)}.                                  |
| **radiomics_IVH_binSize**   | float    | 2.0                    | Sets the bin size for the IVH in applicable configurations (FBN with setting 1, or when IVH_DiscCont is enabled).                                                   |
| **radiomics_isROIsCombined**| int    | 0                      |Indicates whether multiple ROIs (e.g., multiple tumors) should be combined into a single region for analysis.                         |



## 📚API Reference

### `pysera.process_batch()`

The main and only function you need for radiomics processing.


## 📊Output Structure

The ``pysera.process_batch()`` function produces two types of output: a **Python dictionary** with processing results and an **Excel file** containing detailed analysis data. Ensure your data follows `Data Structure Requirements` to avoid errors affecting output.

**Python Dictionary Output**

The function returns a dictionary with the following keys:

```python
{
    'success': bool,              # True if processing completed
    'output_path': str,           # Path to results directory
    'processed_files': int,       # Number of files processed
    'features_extracted': Dataframe,    # extracted features
    'processing_time': float,     # Processing time in seconds
    'logs': list,                # Log messages (if logging enabled)
    'error': str                 # Error message (if failed)
}
```
**Excel File Output**

**PySERA** generates an Excel file with three sheets:

📑1. **Radiomics_Features**: Lists all extracted radiomics features with IBSI-compliant naming conventions, exactly matching the standardized feature names from the Image Biomarker Standardisation Initiative. Contains computed feature values for each processed image-mask pair across all selected categories and dimensions.

⚙️2. **Parameters**: Details the parameters used for the run (e.g., ``bin_size``, ``min_roi_volume``, ``roi_selection_mode``).

⚠️3. **Report**: Logs issues for each patient sample, including ROI labels, warnings (e.g., small ROI volume), and errors (e.g., “No matching mask found for patient001.nii.gz”).


## 📁Supported File Formats

### Image Files
- **NIfTI**: `.nii`, `.nii.gz`
- **DICOM**: `.dcm`, `.dicom`, directories with DICOM files
- **NRRD**: `.nrrd`, `.nhdr`
- **NumPy**: `.npy` arrays
- **Multi-DICOM**: Directory structure with patient subdirectories
- **RTSTRUCT**: DICOM-RT Structure Set files for contour-based images.
- **Other**: Any format readable by SimpleITK (e.g., CT, MRI, PET medical images).

### Mask Files
- Same formats as image files: NIfTI, DICOM, NRRD, NumPy, RTSTRUCT.
   - **Type**: Binary or labeled segmentation masks.

   - **Requirements**:
     - Must have the **same dimensions and geometry** as the corresponding image.
     - When loading folders containing images and masks, mask file names must **exactly match** the corresponding image file names.

## 🎯Library Examples

See the [`library_examples`](https://github.com/MohammadRSalmanpour/PySERATest/tree/main/library_examples) directory for comprehensive usage examples:

```bash
# Run library_examples
cd library_examples
python basic_usage.py
```

Example use cases:
- Basic single-file processing
- Batch processing with multiprocessing
- High-performance processing
- Custom parameter configuration
- Single-core processing
- Comprehensive analysis with full reporting
- Selective radiomics by category and dimension
- IBSI-compliant research reproducible radiomics for scientific studies
- Deep learning feature extraction using pre-trained models (ResNet50, VGG16, DenseNet121)
- Real-time monitoring progress tracking with callback function integration
- Multi-modal analysis across CT, MRI, PET, SPECT, X-Ray, and Ultrasound

## ⚡Performance Tips

1. **Optimize CPU Utilization**: Set `num_workers="auto"` to leverage all available CPU cores for maximum parallel processing throughput
2. **Targeted Feature Extraction**: Use `categories` and `dimensions` parameters to extract only relevant features, significantly reducing computational overhead
3. **ROI Volume Filtering**: Configure appropriate `min_roi_volume` thresholds to exclude small regions and enhance processing stability
4. **Robust Feature Computation**: Use `feature_value_mode="APPROXIMATE_VALUE"` to enable synthetic voxel generation for ROIs with insufficient data (<10 voxels) OR for some features requiring specific mathematical operations (even in larger ROIs), preventing computational errors. Use `feature_value_mode="REAL_VALUE"` to preserve raw outcomes with NaN values for unreliable features in both small ROIs and mathematically constrained scenarios.
5. **Advanced Feature Representation**: Leverage `extraction_mode="deep_feature"` with pre-trained models ("resnet50", "vgg16", "densenet121") for complementary deep learning features
6. **Data Quality Enhancement**: Enable `apply_preprocessing=True` for improved mask integrity through integer value normalization
7. **Real-time Monitoring**: Implement `callback_fn` for external progress tracking and notification system integration
8. **Batch Processing Efficiency**: Process multiple files in single operations to minimize I/O overhead and maximize computational throughput
9. **Memory Optimization**: PySERA's OOP architecture automatically manages RAM utilization during large-scale batch operations
10. **Logging Optimization**: Use `report="info"` or `report="warning"` to reduce logging overhead in production environments while maintaining essential monitoring

## 🤖 Deep Learning Feature Extraction

PySERA supports advanced **deep learning-based** feature extraction alongside traditional radiomics, providing multiple pre-trained models for comprehensive feature representation. When using **extraction_mode="deep_feature"**, the categories parameter is automatically handled by the **deep learning model**. Deep features are extracted in 3D dimension by default for comprehensive volumetric analysis. All deep learning features are extracted specifically from the ROI regions defined by the mask and model outputs provide complementary feature representations to traditional radiomics.

**Available Deep Learning Models**:

- **`resnet50`** - 2047 features: Residual Network with 50 layers, balanced performance and accuracy
- **`vgg16`** - 511 features: Visual Geometry Group with 16 layers, strong hierarchical feature representation  
- **`densenet121`** - 1023 features: Dense Convolutional Network with 121 layers, efficient feature reuse

### Get Help

- **Installation Issues**: See [INSTALL.md](INSTALL.md)
- **Examples**: Run `python examples/basic_usage.py`

## 🕒Version History

For detailed release notes, explanations of updates, and technical changes, please see the  
👉 [Development Report](https://github.com/MohammadRSalmanpour/PySERATest/blob/main/development_report.md)

    v2
    ├── v2.0
    ├── ├── v2.0.2 - 2025-10-20
    │   │   - Bug fix (configuration)
    ├── ├── v2.0.1 - 2025-10-20
    │   │   - remove additional packages
    │   ├── v2.0.0 - 2025-10-19
    │   │   - ✨Major Feature Expansion, 557 IBSI-compliant radiomics features
    │   │   - 🎯New `categories` parameter for feature category selection
    │   │   - 📐New `dimensions` parameter for 1st, 2D, 2.5D, 3D feature extraction
    │   │   - 🤖`extraction_mode="deep_feature"` with ResNet50, VGG16, DenseNet121
    │   │   - 🔔`callback_fn` for external notification platform integration
    │   │   - ⚡Enhanced OOP architecture with improved RAM and CPU efficiency
    │   │   - 📊Multi-level report system ("all", "info", "warning", "error", "none")
    │   │   - 🐛Bug Fixes, Enhanced stability and error handling
    │   │
    v1
    ├── v1.0
    │   ├── v1.0.2 - 2025-08-20
    │   │   - 🛠️change PySera name to pysera
    │   │
    │   ├── v1.0.1 - 2025-08-20
    │   │   - 🐛fixing bug in numpy array file processing in in-memory mode
    │   │
    │   └── v1.0.0 - 2025-08-19
    │       - 🛠️Structural modifications
    │       - ⚡Improved image loader 
    │       - ✨Added two strategies for feature value mode (real vs. approximate)
    │       - 🔢New parameter for number of ROIs to select
    │       - ✨Synthetic generation for ROI lesions smaller than 10 voxels
    │       - ✨New strategy for ROI selection (image-based vs. region-based)
    │       - 💾Disk-based processing to prevent RAM overflow
    │       - 🐛Fixed NaN value bug in some features
    │       - ✨Added support for processing NumPy array files in addition to file paths
    │       - ✅IBSI compliance validation
    │       - 📊New output structure including parameter set, error log, and warning report
    │       - 📦Updated package dependencies
    v0
    ├── v0.0
    │   └── v0.0.0 - 2025-08-13
    │       - 🔧IBSI Standardization 
    │       - 🐛Some Bug fix
    │
    └── initial version - 2022-02-12
       - 🎉Initial implementation  
       - 🛠️Core radiomics pipeline  
       - 📄Support for some types of files

## 📬Contact
SERA is available **free of charge**.
For access, questions, or feedback:

**Dr. Mohammad R. Salmanpour (Team Lead)**  
📧[msalman@bccrc.ca](mailto:msalman@bccrc.ca) | [m.salmanpoor66@gmail.com](mailto:m.salmanpoor66@gmail.com), [m.salmanpour@ubc.ca](mailto:m.salmanpour@ubc.ca)

---

## 🛠️Maintenance
For technical support and maintenance inquiries, please contact:

**Dr. Mohammad R. Salmanpour (Team Lead)**  
 msalman@bccrc.ca – m.salmanpoor66@gmail.com – m.salmanpour@ubc.ca

**Amir Hossein Pouria**  
amirporia99.1378@gmail.com  

## 👥Authors
- **Dr. Mohammad R. Salmanpour (Team Lead, Fund Provider, Evaluator, Medical Imaging Expert, Backend Development, Code Refactoring, Debugging, Library Management, IBSI Standardization, and Activation of the PySERA Library, and GUI Development in 3D Slicer)** – [msalman@bccrc.ca](mailto:msalman@bccrc.ca), [m.salmanpoor66@gmail.com](mailto:m.salmanpoor66@gmail.com), [m.salmanpour@ubc.ca](mailto:m.salmanpour@ubc.ca)
- **Amir Hossein Pouria (Assistant Team Lead; Backend Development, Code Refactoring, Debugging, and Library Management)** – [amirporia99.1378@gmail.com](mailto:amirporia99.1378@gmail.com)
- **Sirwan Barichin (IBSI Standardization, Debugging, and Activation of the PySERA Library, and GUI Development in 3D Slicer)** – [sirwanbarichin@gmail.com](mailto:sirwanbarichin@gmail.com)
- **Yasaman Salehi (Backend Development, Code Refactoring, and Debugging)** – [y.salehi7698@gmail.com](mailto:y.salehi7698@gmail.com)
- **Sonya Falahati (Tesing and Data prepration)** – [falahati.sonya@gmail.com](mailto:falahati.sonya@gmail.com)
- **Dr. Mehrdad Oveisi (Evaluator, Software Engineer, and Advisor)** – [moveisi@cs.ubc.ca](mailto:moveisi@cs.ubc.ca)
- **Dr. Arman Rahmim (Fund Provider, Medical Imaging Expert, Evaluator, and Advisor)** – [arman.rahmim@ubc.ca](mailto:arman.rahmim@ubc.ca), [arahmim@bccrc.ca ](mailto:arahmim@bccrc.ca)

## 📚Citation

```bibtex
@software{pysera2025,
  title={pysera: A Simple Python Library for Radiomics Feature Extraction},
  author={pysera Team},
  year={2025},
  url={https://github.com/MohammadRSalmanpour/PySERA}
}
```
## 📜License

This open-source software is released under the **MIT License**, which grants permission to use, modify, and distribute it for any purpose, including research or commercial use, without requiring modified versions to be shared as open source. See the [LICENSE](LICENSE) file for details.

## Support

- **Issues**: [GitHub Issues](https://github.com/MohammadRSalmanpour/PySERA/issues)
- **Documentation**: This README and the included guides
- **Examples**: See `examples/basic_usage.py`

## Acknowledgment

This study was supported by:  

- [🔬 **Qu**antitative **R**adiomolecular **I**maging and **T**herapy (Qurit) Lab, University of British Columbia, Vancouver, BC, Canada](https://www.qurit.ca)  
- [🏥 BC Cancer Research Institute, Department of Basic and Translational Research, Vancouver, BC, Canada](https://www.bccrc.ca/)  
- [💻 **Vir**tual **Collaboration (VirCollab) Group, Vancouver, BC, Canada](https://www.vircollab.com)  
- [🏭 **Tec**hnological **Vi**rtual **Co**llaboration **Corp**oration (TECVICO Corp.), Vancouver, BC, Canada](https://www.tecvico.com)  
We gratefully acknowledge funding from the💰 Natural Sciences and Engineering Research Council of Canada (**NSERC**) Idea to Innovation [**I2I**] Grant **GR034192**.
---

*PySERA - Simple, powerful radiomics in one function call. 🚀*

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/MohammadRSalmanpour/PySERA",
    "name": "pysera",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "\"Mohammad R. Salmanpour\" <M.salmanpoor66@gmail.com>, Amir Hossein Pouria <amirporia99.1378@gmail.com>",
    "keywords": "medical-imaging, Standardized-Radiomics-Feature-Extraction, Quantitative-Analysis, IBSI-Standardization, healthcare",
    "author": "Mohammad R. Salmanpour, Amir Hossein Pouria",
    "author_email": "\"Mohammad R. Salmanpour\" <M.salmanpoor66@gmail.com>, Amir Hossein Pouria <amirporia99.1378@gmail.com>, Mehrdad Oveisi <moveisi@cs.ubc.ca>, Arman Rahmim <arman.rahmim@ubc.ca>",
    "download_url": "https://files.pythonhosted.org/packages/46/34/77d7150741c0976a21f60175a08f2e7002be52bebc7c362ea425740628d1/pysera-2.0.2.tar.gz",
    "platform": null,
    "description": "# PySERA: Python-Based Standardized Extraction for Radiomics Analysis \u2013 Python Radiomics Script and Library\r\n\r\n[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)\r\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\r\n[![Development Status](https://img.shields.io/badge/status-stable-green.svg)](https://pypi.org/project/pysera/)\r\n\r\n**PySERA** (Python-based Standardized Extraction for Radiomics Analysis) is a comprehensive Python library for radiomics feature extraction from medical imaging data. It provides a **simple, single-function API** with built-in multiprocessing support, comprehensive report capabilities, and optimized performance through OOP architecture, RAM optimization, and CPU-efficient parallel processing.\r\n\r\n## \ud83d\udd0d Table of Contents\r\n- [\ud83e\udde9IBSI (Image Biomarker Standardisation Initiative) Standardization-1.0](#IBSI-Standardization)\r\n- [\ud83d\udee0\ufe0fKey Features](#key-features)\r\n- [\ud83d\udce5Installation](#installation)\r\n  - [\ud83c\udf10GitHub Installation](#github-installation)\r\n  - [\ud83d\udcbbPython Script - Command Line Interface (CLI)](#python-script---command-line-interface-cli)\r\n  - [\ud83d\udce6Library Installation via pip](#library-installation-via-pip)\r\n- [\ud83d\udcdaLibrary Usage](#library-usage)\r\n  - [\ud83d\udcc2Single File Processing](#single-file-processing)\r\n  - [\ud83e\udde0In-Memory Array Processing](#in-memory-array-processing)\r\n  - [\u26a1Parallel Batch Processing](#parallel-batch-processing)\r\n  - [\ud83d\udd27Advanced Configuration](#advanced-configuration)\r\n- [\ud83d\udcc2Data Structure Requirements](#data-structure-requirements)\r\n- [\ud83d\udccbPySERA Parameters Reference](#pysera-parameters-reference)\r\n- [\ud83d\udcdaAPI Reference](#api-reference)\r\n- [\ud83d\udccaOutput Structure](#output-structure)\r\n- [\ud83d\udd22Feature Extraction Modes](#feature-extraction-modes)\r\n- [\ud83d\udcc1Supported File Formats](#supported-file-formats)\r\n- [\ud83c\udfafLibrary Examples](#library-examples)\r\n- [\u26a1Performance Tips](#performance-tips)\r\n- [\u2753Troubleshooting](#troubleshooting)\r\n- [\ud83d\udd52Version History](#Version-History)\r\n- [\ud83d\udcecContact](#contact)\r\n- [\ud83d\udc65Authors](#authors)\r\n- [\ud83d\ude4fAcknowledgment](#acknowledgment)\r\n- [\ud83d\udcdcLicense](#license)\r\n\r\n## \u2728IBSI Standardization\r\nBoth the script and library have been rigorously standardized based on **IBSI** (Image Biomarker Standardisation Initiative) Standardization 1.0. PySERA returns IBSI-compliant feature values that match the reference standard, ensuring reproducibility and comparability across studies.\r\nSee the detailed evaluation and test cases here: [IBSI_Evaluation Folder](https://github.com/MohammadRSalmanpour/PySERATest/tree/main/IBSI_Evaluation)\r\n\r\n## \ud83d\udee0\ufe0fKey Features\r\n\r\nPySERA provides a **single-function API** that handles all radiomics processing:\r\n\r\n```python\r\nimport pysera\r\n\r\nresult = pysera.process_batch(\r\n    image_input=\"image.nii.gz\",\r\n    mask_input=\"mask.nii.gz\",\r\n    output_path=\"./results\"\r\n)\r\n```\r\n\r\nThat's it! \ud83c\udf89 All the complexity of multiprocessing, error & warning reports, file format handling, and feature extraction is handled automatically.\r\n\r\n- **Single Function API**: One function does everything - `pysera.process_batch()`\r\n- **Multi-format Support**: NIfTI, DICOM, NRRD, RTSTRUCT, NumPy arrays, and more\r\n- **Automatic Multiprocessing**: Built-in parallel processing for maximum performance\r\n- **Comprehensive Report**: Excel export functionality for detailed analysis\r\n- **Extensive Features**: 557 IBSI-compliant radiomics features across multiple categories (morphological, statistical, texture, etc.) and dimensions (1st, 2D, 2.5D, 3D)\r\n- **Medical Image Optimized**: Designed for CT, MRI, PET, SPECT, X-Ray, Ultrasound, and other medical imaging modalities.\r\n\r\n## \ud83d\udce5Installation\r\n\r\nPySERA can be installed as a Python library for integration into your projects or as a standalone script for command-line usage. It supports Windows, macOS, and Linux. Below are the installation options.\r\n\r\n### \ud83c\udf10GitHub Installation \r\n\r\nFor users who want to develop with the source code or run PySERA as a standalone command-line tool (CLI) without installing it as a Python package, you can clone the repository from GitHub.\r\nThis gives you access to the standalone script radiomics_standalone.py and all example files. After installing the dependencies, you can run the script directly (see the [\ud83d\udcbbPython Script - Command Line Interface (CLI)](#python-script---command-line-interface-cli) section).\r\n\r\n```bash\r\n# Clone the repository\r\ngit clone https://github.com/MohammadRSalmanpour/PySERA.git\r\ncd pysera\r\n```\r\n### macOS/Linux Installation\r\n#### Quick Setup (Recommended):\r\n\r\n```bash\r\n# Quick setup (creates a virtual environment and installs everything)\r\n./dev_setup.sh\r\n```\r\n#### Manual Setup:\r\n\r\n```bash\r\npython3 -m venv venv\r\nsource venv/bin/activate\r\npip install -e .\r\n\r\n```\r\n### Windows Setup\r\n#### Quick Setup (Recommended):\r\n\r\n```bash\r\n# Quick setup\r\n./dev_setup.sh\r\n```\r\n\r\n#### Manual Setup\r\n\r\n```bash\r\n\r\npython -m venv venv\r\n.\\venv\\Scripts\\activate\r\ncd PySERA\r\npip install -r requirements.txt\r\n\r\n```\r\n\r\n### \ud83d\udcbbPython Script - Command Line Interface (CLI)\r\n\r\nIf you just want to run the CLI without installing the library into Python,the standalone script 'radiomics_standalone.py' provides a command-line interface for radiomics processing :\r\n\r\n```bash\r\n# Process single files\r\npython radiomics_standalone.py \\\r\n    --image_input image.nii.gz \\\r\n    --mask_input mask.nii.gz \\\r\n    --output ./results\r\n\r\n# Batch processing (folders)\r\npython radiomics_standalone.py \\\r\n    --image_input ./images \\\r\n    --mask_input ./masks \\\r\n    --output ./results \\\r\n    --num_workers 4\r\n```\r\n\r\n### \ud83d\udce6Library Installation via pip\r\n\r\nInstall the PySERA library directly from PyPI:\r\n\r\n```bash\r\npip install pysera\r\n```\r\n\r\n## \ud83d\udcdaLibrary Usage\r\n\r\nOnce installed, you can use PySERA directly in your Python code.\r\n\r\n### \ud83d\udcc2Single File Processing\r\n\r\n```python\r\nimport pysera\r\n\r\n# Process single image-mask pair\r\nresult = pysera.process_batch(\r\n    image_input=\"scan.nii.gz\",\r\n    mask_input=\"mask.nii.gz\",\r\n    output_path=\"./results\"\r\n)\r\n\r\nprint(f\"Success: {result['success']}\")\r\nprint(f\"Features extracted: {result['features_extracted']}\")\r\nprint(f\"Processing time: {result['processing_time']:.2f} seconds\")\r\n```\r\n\r\n### \ud83e\udde0In-Memory Array Processing\r\n\r\n```python\r\nimport numpy as np\r\nimport nibabel as nib\r\nimport pysera\r\n\r\n# Load image and mask as NumPy arrays (for example, using nibabel)\r\nimage_array = nib.load(\"patient002_image.nii.gz\").get_fdata()\r\nmask_array = nib.load(\"patient002_mask.nii.gz\").get_fdata()\r\n\r\n# Process the image and mask directly from memory\r\nresult = pysera.process_batch(\r\n    image_input=image_array,\r\n    mask_input=mask_array,\r\n    output_path=\"./results\"\r\n)\r\n\r\n# Display results\r\nprint(f\"Success: {result['success']}\")\r\nprint(f\"Features extracted: {result['features_extracted']}\")\r\nprint(f\"Processing time: {result['processing_time']:.2f} seconds\")\r\n```\r\n\r\n### \u26a1Parallel Batch Processing\r\n\r\n```python\r\nimport pysera\r\n\r\n# Process multiple files with 4 CPU cores\r\nresult = pysera.process_batch(\r\n    image_input=\"./patient_scans\",\r\n    mask_input=\"./patient_masks\", \r\n    output_path=\"./results\",\r\n    num_workers=\"4\",              # Use 4 CPU cores\r\n    categories=\"glcm, glrlm\",     # Extract specific feature categories\r\n    dimensions=\"1st, 2_5d, 3d\",   # Extract features in specified dimensions\r\n    apply_preprocessing=True,   # Apply ROI preprocessing\r\n)\r\n\r\nprint(f\"Processed {result['processed_files']} files\")\r\nprint(f\"Total processing time: {result['processing_time']:.2f} seconds\")\r\n```\r\n\r\n## \ud83d\udd27Advanced Configuration\r\n\r\n```python\r\nimport pysera\r\n\r\n# Comprehensive processing with custom parameters\r\nresult = pysera.process_batch(\r\n    image_input=\"image.nii.gz\",\r\n    mask_input=\"mask.nii.gz\",\r\n    output_path=\"./results\",\r\n    \r\n    # Performance settings\r\n    num_workers=\"2\",           # Use 2 CPU cores\r\n    enable_parallelism=False ,     # Disable multiprocessing\r\n    \r\n    # Image feature extraction settings\r\n    categories=\"glcm, glrlm, glszm\",  # Extract specific texture feature categories\r\n    dimensions=\"1st, 2_5d, 3d\",       # Extract features in 1st order, 2.5D and 3D dimensions\r\n    # Alternative examples for categories and dimensions:\r\n    # categories=\"all\",                 # Extract all 557 features (default)\r\n    # categories=\"stat, morph, glcm\",   # Statistical, morphological and GLCM features\r\n    # dimensions=\"2D\",                  # Extract only 2D features\r\n    # dimensions=\"all\",                 # Extract features in all dimensions (default)\r\n    \r\n    bin_size=25,               # Texture analysis bin size\r\n    roi_num=2,                # Number of ROIs to process\r\n    roi_selection_mode=\"per_region\",  # ROI selection strategy\r\n    min_roi_volume=5,          # Minimum ROI volume threshold\r\n    \r\n    # Processing options\r\n    apply_preprocessing=True,   # Apply ROI preprocessing\r\n    feature_value_mode=\"APPROXIMATE_VALUE\",  #\tStrategy for handling NaN values.\r\n\r\n    # IBSI parameters (advanced, overrides defaults)\r\n    IBSI_based_parameters={\r\n        \"radiomics_DataType\": \"CT\",\r\n        \"radiomics_DiscType\": \"FBN\",\r\n        \"radiomics_isScale\": 1\r\n    },\r\n    \r\n    # Logging options\r\n    report=\"info\"             # Report detail level: \"all\" (full processing details), \r\n                              # \"info\" (essential information), \"warning\" (warnings only), \r\n                              # \"error\" (errors only), \"none\" (no reporting). Default: \"all\"\r\n)\r\n```\r\n\r\n\r\n## \ud83d\udcc2Data Structure Requirements\r\n\r\nFor batch processing or multi-DICOM inputs, the folder structure for images and masks must follow these rules:\r\n   - The **final folders** containing images and masks (e.g., ``images/`` and ``masks/``) must **not contain additional subfolders**. Only the image and mask files should be present in these folders.\r\n   - There must be **only one folder level** between the parent folder and the image/mask files (e.g., ``parent/images/image001.nii.gz`` or ``parent/masks/mask001.nii.gz``).\r\n   - **Warning**: Any additional internal subfolders within the final images or masks folders will cause PySERA to **malfunction** and fail to process the data correctly.\r\n\r\n## Patient-Subfolder Organization (NIfTI/DICOM)\r\n\r\n**Works with both:**\r\n\r\n1. **DICOM Series** (multiple `.dcm` files per patient)  \r\n2. **NIfTI Files** (single `.nii.gz` per patient)\r\n\r\n\r\n### \ud83c\udff7\ufe0fExample Structures\r\n\r\n**Note:**  PySERA supports all major formats, including DICOM, multi-slice DICOM, NIfTI, NRRD, RT Struct, and NumPy arrays.\r\n\r\n#### 1\ufe0f\u20e3**Flat NIfTI/NRRD Structure** \r\n\r\n**\u2705Correct:**\r\n    \r\n      parent/\r\n      \u251c\u2500\u2500 images/ # All scan files directly here\r\n      \u2502   \u251c\u2500\u2500 patient001.nii.gz\r\n      \u2502   \u251c\u2500\u2500 patient002.nii.gz\r\n      \u2502   \u2514\u2500\u2500 patient003.nii.gz\r\n      \u2514\u2500\u2500 masks/  # All mask files directly here\r\n          \u251c\u2500\u2500 patient001.nii.gz\r\n          \u251c\u2500\u2500 patient002.nii.gz\r\n          \u2514\u2500\u2500 patient003.nii.gz\r\n\r\n#### 2\ufe0f\u20e3**Patient-Subfolder NIfTI Structure**\r\n\r\n**\u2705Correct:**\r\n\r\n    parent/\r\n    \u251c\u2500\u2500 CT_Images/ # Each patient has own folder\r\n    \u2502 \u251c\u2500\u2500 patient_01/\r\n    \u2502 \u2502 \u2514\u2500\u2500 scan.nii.gz # Single NIfTI file\r\n    \u2502 \u2514\u2500\u2500 patient_02/\r\n    \u2502 \u2514\u2500\u2500 scan.nii.gz\r\n    \u2514\u2500\u2500 CT_Masks/ # Mirrored structure\r\n    \u251c\u2500\u2500 patient_01/\r\n    \u2502 \u2514\u2500\u2500 segmentation.nii.gz\r\n    \u2514\u2500\u2500 patient_02/\r\n    \u2514\u2500\u2500 segmentation.nii.gz\r\n    \r\n**Notes:**  \r\n\r\n- PySERA automatically processes DICOM series organized in patient subfolders.  \r\n- **Patient subfolders are required** (one folder per patient).  \r\n- **All DICOM slices for one series must be in the same patient folder.**  \r\n- **Mask files must mirror the image folder structure.**  \r\n  If there is a folder for `patient_01` under `CT_Images/`, there must be a corresponding `patient_01` folder under `CT_Masks/` containing the RTSTRUCT or mask.\r\n    \r\n    \r\n### 3\ufe0f\u20e3DICOM Series Structure\r\n\r\n**\u2705Correct:**\r\n    \r\n\r\n    parent/\r\n    \u251c\u2500\u2500 CT_Images/  # --image-input\r\n    \u2502 \u251c\u2500\u2500 patient_01/ # DICOM series folder\r\n    \u2502 \u2502 \u251c\u2500\u2500 slice1.dcm  # Any number of slices\r\n    \u2502 \u2502 \u251c\u2500\u2500 slice2.dcm\r\n    \u2502 \u2502 \u2514\u2500\u2500 slice3.dcm\r\n    \u2502 \u2514\u2500\u2500 patient_02/\r\n    \u2502 \u251c\u2500\u2500 slice1.dcm\r\n    \u2502 \u2514\u2500\u2500 slice2.dcm\r\n    \u2514\u2500\u2500 CT_Masks/   # --mask-input\r\n    \u251c\u2500\u2500 patient_01/\r\n    \u2502 \u2514\u2500\u2500 mask.dcm \r\n    \u2514\u2500\u2500 patient_02/\r\n    \u2514\u2500\u2500 mask.dcm\r\n\r\n   \r\n**\u274cIncorrect Structure (Will Fail):**\r\n\r\n      parent/\r\n      \u251c\u2500\u2500 images/\r\n      \u2502   \u251c\u2500\u2500 subfolder1/\r\n      \u2502   \u2502   \u251c\u2500\u2500 patient001.nii.gz\r\n      \u2502   \u2514\u2500\u2500 subfolder2/\r\n      \u2502       \u251c\u2500\u2500 patient002.nii.gz\r\n      \u2514\u2500\u2500 masks/\r\n          \u251c\u2500\u2500 subfolderA/\r\n          \u2502   \u251c\u2500\u2500 patient001.nii.gz\r\n          \u2514\u2500\u2500 patient002.nii.gz\r\n\r\n### \ud83d\udccbPySERA Parameters Reference\r\n\r\n\r\n| Parameter            | Type        | Default         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\r\n|----------------------|-------------|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| **image_input**       | str / .npy  | Required        | Path to the image file, directory, or NumPy file containing the image data.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |\r\n| **mask_input**        | str / .npy  | Required        | Path to the mask file, directory, or NumPy file defining the regions of interest.                                                                                                                                                                                                                                                                                                                                                                                                                                                    |\r\n| **output_path**      | str         |  `\"./output_result\"` | Directory where the processing results will be saved.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |\r\n| **num_workers**      | str         | `\"auto\"`            | Number of CPU cores to use for processing. If auto, uses all available cores.                                                                                                                                                                                                                                                                                                                                                                                                                        \r\n|  **apply_preprocessing** | bool        | False           | If True, rounds mask array values to nearest integers. If False, uses raw mask values without rounding. |                                                                                                                                                                                                                                                                                                 \r\n| **enable_parallelism**  | bool        | True            | If True, enables parallel processing for the analysis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\r\n| **min_roi_volume**      | int         | 10              | Minimum volume threshold for regions of interest (ROI).                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\r\n| **bin_size**            | int         | 25              | Bin size used for texture analysis.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |\r\n| **roi_selection_mode**  | str         | `\"per_Img\"`          | **ROI selection strategy:**<br>- **\"per_Img\"** (default): Selects the top `roi_num` ROIs per image based on size, regardless of label category.<br>  \u2022 Suitable for single or dominant lesions per scan.<br>  \u2022 Preserves original spatial relationships.<br>- **\"per_region\"**: Selects up to `roi_num` ROIs separately for each label category, ensuring balanced representation across regions.<br>  \u2022 Useful in multi-lesion, multi-label, or longitudinal studies.<br>  \u2022 Requires consistent ROI labeling across datasets.<br> |\r\n| **roi_num**             | int         | 10              | Number of ROIs to process.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\r\n| **feature_value_mode**  | str         | `\"REAL_VALUE\"`     | Strategy for handling NaN values. Options:`\"APPROXIMATE_VALUE\"` or `\"REAL_VALUE\"`. **\"APPROXIMATE_VALUE\"**: Replaces NaN features with substitutes (e.g., very small constants like `1e-30` or synthetic masks) to maintain pipeline continuity.<br>- **\"REAL_VALUE\"** (default): Keeps NaN values whenever feature extraction fails (e.g., small ROI, numerical instability), preserving the raw outcome without substitution.<br>                                                                                                     |\r\n| **categories**          | str         | `\"all\"`            | Feature categories to extract. Choices: \"diag\" (diagnostics), \"morph\" (morphological/shape), \"ip\" (intensity peak), \"stat\" (first-order statistical), \"ih\" (intensity histogram), \"ivh\" (intensity-volume histogram), \"glcm\" (Gray-Level Co-occurrence Matrix), \"glrlm\" (Gray-Level Run Length Matrix), \"glszm\" (Gray-Level Size Zone Matrix), \"gldzm\" (Gray-Level Distance Zone Matrix), \"ngtdm\" (Neighboring Gray-Tone Difference Matrix), \"ngldm\" (Neighboring Gray-Level Dependence Matrix), \"mi\" (moment-invariant). Example: \"glcm, glrlm\". Default \"all\" extracts all 557 features. |\r\n| **dimensions**          | str         | `\"all\"`           | Spatial dimensions for feature extraction. Choices: \"1st\" (first-order intensity-based features), \"2D\" (features extracted per 2D slice), \"2_5D\" (features aggregated across slices with limited inter-slice context), \"3D\" (fully volumetric features across entire ROI). Example: \"1st, 2_5d, 3d\". Combine with categories for specific feature sets. |\r\n| **callback_fn**          | function    | None            | Callback function for external notifications. Receives parameters: flag (`\"START\"`\\|`\"END\"`), image_id (str), roi_name (str). Useful for integration with notification platforms. |\r\n| **extraction_mode**      | str         | `\"handcrafted_feature\"` | Feature extraction mode. Options: `\"handcrafted_feature\"` (traditional radiomics), `\"deep_feature\"` (deep learning features).  |\r\n| **deep_learning_model**  | str         | `\"resnet50\"`    | Deep learning model for feature extraction when extraction_mode=\"deep_feature\". Options:`\"resnet50\"`, `\"vgg16\"`, `\"densenet121\". |\r\n| **temporary_files_path** | str         |`\"./temporary_files_path\"`  | Directory for caching intermediate NumPy masks during DICOM-RT (RTSTRUCT) processing. Prevents memory spikes by writing per-ROI masks to disk and streaming them on demand. Automatically created if missing; contents are automatically cleared after processing. Not used for other image formats. |\r\n| **report**              | str         | `\"all\"`           | Report detail level: \"all\" (full processing details), \"info\" (essential information), \"warning\" (warnings only), \"error\" (errors only), \"none\" (no reporting). Default: \"all\". |\r\n| **IBSI_based_parameters** | dict / JSON | See defaults    | Advanced configuration parameters. See the table below for detailed descriptions. |\r\n\r\n\r\n#### \ud83d\udd27Advanced configuration parameters (IBSI_based_parameters)\r\n\r\n\r\n| Parameter                   | Type   | Default                | Description                                                                 |\r\n|-----------------------------|--------|------------------------|-----------------------------------------------------------------------------|\r\n| **radiomics_DataType**      | str    |  `\"OTHER\"`                 | Image modality type (CT / PET / MRI / OTHER).                               |\r\n| **radiomics_DiscType**      | str    | `\"FBS\"`                 | Specifies the discretization type used for gray-level calculation \u2014 either \"FBN\" (fixed bin numbers) or \"FBS\" (fixed bin size or fixed bin width). |\r\n| **radiomics_isScale**       | int    | 0                      | Determines whether image resampling is performed. Set to 1 to enable resampling or 0 to retain the original voxel dimensions.              |\r\n| **radiomics_VoxInterp**     | str    | `\"Nearest\"`              | Defines the interpolation type used for image resampling. Accepted values include `\"Nearest\"`, `\"linear\"`, `\"bilinear\"`, `\"trilinear\"`, `\"tricubic-spline\"`, `\"None\"`.                |\r\n| **radiomics_ROIInterp**     | str    | `\"Nearest\"`              | Specifies the interpolation type for ROI resampling (`\"Nearest\"`, `\"linear\"`, `\"bilinear\"`, `\"trilinear\"`, `\"tricubic-spline\"`, `\"None\"`.)                                       |\r\n| **radiomics_isotVoxSize**   | int    | 2                      | Sets the new isotropic voxel size for 3D resampling, applied equally to the X, Y, and Z dimensions.                               |\r\n| **radiomics_isotVoxSize2D** | int    | 2                      | Defines the voxel size for resampling in 2D mode, keeping the Z dimension unchanged while rescaling X and Y.                                |\r\n| **radiomics_isIsot2D**      | int    | 0                      | Indicates whether to resample to isotropic 2D voxels (1) or isotropic 3D voxels (0). Applicable mainly for first-order features, as higher-order 2D features always use the original slice thickness.                           |\r\n| **radiomics_isGLround**     | int    | 0                      | Determines whether to round voxel intensities to the nearest integer (commonly 1 for CT, 0 for PET and SPECT).                       |\r\n| **radiomics_isReSegRng**    | int    | 0                      | Enables range-based re-segmentation. The valid intensity range is specified in radiomics_ReSegIntrvl01 and radiomics_ReSegIntrvl02. Note: not recommended for arbitrary-unit modalities such as MRI or SPECT.                            |\r\n| **radiomics_isOutliers**    | int    | 0                      | Controls outlier removal, where 1 removes intensities beyond \u00b13\u03c3.                         |\r\n| **radiomics_isQuntzStat**   | int    | 1                      | Determines whether quantized images are used to compute first-order statistics. Set to 0 to use raw intensities (preferred for PET).                 |\r\n| **radiomics_ReSegIntrvl01** | int    | -1000                  | Specifies the lower bound for range re-segmentation; intensities below this value are replaced with NaN.                          |\r\n| **radiomics_ReSegIntrvl02** | int    | 400                    | Specifies the upper bound for range re-segmentation; intensities above this value are replaced with NaN.                          |\r\n| **radiomics_ROI_PV**        | float  | 0.5                    | Defines the partial volume threshold for ROI binarization after resampling. Voxels with values below this threshold are excluded.                       |\r\n| **radiomics_qntz**          | str    |`\"Uniform\"`              | Sets the quantization strategy for fixed bin number discretization. Options are \"Uniform\" or \"Lloyd\" (for Max-Lloyd quantization).                              |\r\n| **radiomics_IVH_Type**      | int    | 3                      | {0: Definite (PET, CT), 1: Arbitrary (MRI, SPECT), 2: 1000 bins, 3: same discretization as histogram (CT)}.                         |\r\n| **radiomics_IVH_DiscCont**  | int    | 1                      | Defines IVH continuity: {0: Discrete (CT), 1: Continuous (CT, PET; for FBS)}.                                  |\r\n| **radiomics_IVH_binSize**   | float    | 2.0                    | Sets the bin size for the IVH in applicable configurations (FBN with setting 1, or when IVH_DiscCont is enabled).                                                   |\r\n| **radiomics_isROIsCombined**| int    | 0                      |Indicates whether multiple ROIs (e.g., multiple tumors) should be combined into a single region for analysis.                         |\r\n\r\n\r\n\r\n## \ud83d\udcdaAPI Reference\r\n\r\n### `pysera.process_batch()`\r\n\r\nThe main and only function you need for radiomics processing.\r\n\r\n\r\n## \ud83d\udccaOutput Structure\r\n\r\nThe ``pysera.process_batch()`` function produces two types of output: a **Python dictionary** with processing results and an **Excel file** containing detailed analysis data. Ensure your data follows `Data Structure Requirements` to avoid errors affecting output.\r\n\r\n**Python Dictionary Output**\r\n\r\nThe function returns a dictionary with the following keys:\r\n\r\n```python\r\n{\r\n    'success': bool,              # True if processing completed\r\n    'output_path': str,           # Path to results directory\r\n    'processed_files': int,       # Number of files processed\r\n    'features_extracted': Dataframe,    # extracted features\r\n    'processing_time': float,     # Processing time in seconds\r\n    'logs': list,                # Log messages (if logging enabled)\r\n    'error': str                 # Error message (if failed)\r\n}\r\n```\r\n**Excel File Output**\r\n\r\n**PySERA** generates an Excel file with three sheets:\r\n\r\n\ud83d\udcd11. **Radiomics_Features**: Lists all extracted radiomics features with IBSI-compliant naming conventions, exactly matching the standardized feature names from the Image Biomarker Standardisation Initiative. Contains computed feature values for each processed image-mask pair across all selected categories and dimensions.\r\n\r\n\u2699\ufe0f2. **Parameters**: Details the parameters used for the run (e.g., ``bin_size``, ``min_roi_volume``, ``roi_selection_mode``).\r\n\r\n\u26a0\ufe0f3. **Report**: Logs issues for each patient sample, including ROI labels, warnings (e.g., small ROI volume), and errors (e.g., \u201cNo matching mask found for patient001.nii.gz\u201d).\r\n\r\n\r\n## \ud83d\udcc1Supported File Formats\r\n\r\n### Image Files\r\n- **NIfTI**: `.nii`, `.nii.gz`\r\n- **DICOM**: `.dcm`, `.dicom`, directories with DICOM files\r\n- **NRRD**: `.nrrd`, `.nhdr`\r\n- **NumPy**: `.npy` arrays\r\n- **Multi-DICOM**: Directory structure with patient subdirectories\r\n- **RTSTRUCT**: DICOM-RT Structure Set files for contour-based images.\r\n- **Other**: Any format readable by SimpleITK (e.g., CT, MRI, PET medical images).\r\n\r\n### Mask Files\r\n- Same formats as image files: NIfTI, DICOM, NRRD, NumPy, RTSTRUCT.\r\n   - **Type**: Binary or labeled segmentation masks.\r\n\r\n   - **Requirements**:\r\n     - Must have the **same dimensions and geometry** as the corresponding image.\r\n     - When loading folders containing images and masks, mask file names must **exactly match** the corresponding image file names.\r\n\r\n## \ud83c\udfafLibrary Examples\r\n\r\nSee the [`library_examples`](https://github.com/MohammadRSalmanpour/PySERATest/tree/main/library_examples) directory for comprehensive usage examples:\r\n\r\n```bash\r\n# Run library_examples\r\ncd library_examples\r\npython basic_usage.py\r\n```\r\n\r\nExample use cases:\r\n- Basic single-file processing\r\n- Batch processing with multiprocessing\r\n- High-performance processing\r\n- Custom parameter configuration\r\n- Single-core processing\r\n- Comprehensive analysis with full reporting\r\n- Selective radiomics by category and dimension\r\n- IBSI-compliant research reproducible radiomics for scientific studies\r\n- Deep learning feature extraction using pre-trained models (ResNet50, VGG16, DenseNet121)\r\n- Real-time monitoring progress tracking with callback function integration\r\n- Multi-modal analysis across CT, MRI, PET, SPECT, X-Ray, and Ultrasound\r\n\r\n## \u26a1Performance Tips\r\n\r\n1. **Optimize CPU Utilization**: Set `num_workers=\"auto\"` to leverage all available CPU cores for maximum parallel processing throughput\r\n2. **Targeted Feature Extraction**: Use `categories` and `dimensions` parameters to extract only relevant features, significantly reducing computational overhead\r\n3. **ROI Volume Filtering**: Configure appropriate `min_roi_volume` thresholds to exclude small regions and enhance processing stability\r\n4. **Robust Feature Computation**: Use `feature_value_mode=\"APPROXIMATE_VALUE\"` to enable synthetic voxel generation for ROIs with insufficient data (<10 voxels) OR for some features requiring specific mathematical operations (even in larger ROIs), preventing computational errors. Use `feature_value_mode=\"REAL_VALUE\"` to preserve raw outcomes with NaN values for unreliable features in both small ROIs and mathematically constrained scenarios.\r\n5. **Advanced Feature Representation**: Leverage `extraction_mode=\"deep_feature\"` with pre-trained models (\"resnet50\", \"vgg16\", \"densenet121\") for complementary deep learning features\r\n6. **Data Quality Enhancement**: Enable `apply_preprocessing=True` for improved mask integrity through integer value normalization\r\n7. **Real-time Monitoring**: Implement `callback_fn` for external progress tracking and notification system integration\r\n8. **Batch Processing Efficiency**: Process multiple files in single operations to minimize I/O overhead and maximize computational throughput\r\n9. **Memory Optimization**: PySERA's OOP architecture automatically manages RAM utilization during large-scale batch operations\r\n10. **Logging Optimization**: Use `report=\"info\"` or `report=\"warning\"` to reduce logging overhead in production environments while maintaining essential monitoring\r\n\r\n## \ud83e\udd16 Deep Learning Feature Extraction\r\n\r\nPySERA supports advanced **deep learning-based** feature extraction alongside traditional radiomics, providing multiple pre-trained models for comprehensive feature representation. When using **extraction_mode=\"deep_feature\"**, the categories parameter is automatically handled by the **deep learning model**. Deep features are extracted in 3D dimension by default for comprehensive volumetric analysis. All deep learning features are extracted specifically from the ROI regions defined by the mask and model outputs provide complementary feature representations to traditional radiomics.\r\n\r\n**Available Deep Learning Models**:\r\n\r\n- **`resnet50`** - 2047 features: Residual Network with 50 layers, balanced performance and accuracy\r\n- **`vgg16`** - 511 features: Visual Geometry Group with 16 layers, strong hierarchical feature representation  \r\n- **`densenet121`** - 1023 features: Dense Convolutional Network with 121 layers, efficient feature reuse\r\n\r\n### Get Help\r\n\r\n- **Installation Issues**: See [INSTALL.md](INSTALL.md)\r\n- **Examples**: Run `python examples/basic_usage.py`\r\n\r\n## \ud83d\udd52Version History\r\n\r\nFor detailed release notes, explanations of updates, and technical changes, please see the  \r\n\ud83d\udc49 [Development Report](https://github.com/MohammadRSalmanpour/PySERATest/blob/main/development_report.md)\r\n\r\n    v2\r\n    \u251c\u2500\u2500 v2.0\r\n    \u251c\u2500\u2500 \u251c\u2500\u2500 v2.0.2 - 2025-10-20\r\n    \u2502   \u2502   - Bug fix (configuration)\r\n    \u251c\u2500\u2500 \u251c\u2500\u2500 v2.0.1 - 2025-10-20\r\n    \u2502   \u2502   - remove additional packages\r\n    \u2502   \u251c\u2500\u2500 v2.0.0 - 2025-10-19\r\n    \u2502   \u2502   - \u2728Major Feature Expansion, 557 IBSI-compliant radiomics features\r\n    \u2502   \u2502   - \ud83c\udfafNew `categories` parameter for feature category selection\r\n    \u2502   \u2502   - \ud83d\udcd0New `dimensions` parameter for 1st, 2D, 2.5D, 3D feature extraction\r\n    \u2502   \u2502   - \ud83e\udd16`extraction_mode=\"deep_feature\"` with ResNet50, VGG16, DenseNet121\r\n    \u2502   \u2502   - \ud83d\udd14`callback_fn` for external notification platform integration\r\n    \u2502   \u2502   - \u26a1Enhanced OOP architecture with improved RAM and CPU efficiency\r\n    \u2502   \u2502   - \ud83d\udccaMulti-level report system (\"all\", \"info\", \"warning\", \"error\", \"none\")\r\n    \u2502   \u2502   - \ud83d\udc1bBug Fixes, Enhanced stability and error handling\r\n    \u2502   \u2502\r\n    v1\r\n    \u251c\u2500\u2500 v1.0\r\n    \u2502   \u251c\u2500\u2500 v1.0.2 - 2025-08-20\r\n    \u2502   \u2502   - \ud83d\udee0\ufe0fchange PySera name to pysera\r\n    \u2502   \u2502\r\n    \u2502   \u251c\u2500\u2500 v1.0.1 - 2025-08-20\r\n    \u2502   \u2502   - \ud83d\udc1bfixing bug in numpy array file processing in in-memory mode\r\n    \u2502   \u2502\r\n    \u2502   \u2514\u2500\u2500 v1.0.0 - 2025-08-19\r\n    \u2502       - \ud83d\udee0\ufe0fStructural modifications\r\n    \u2502       - \u26a1Improved image loader \r\n    \u2502       - \u2728Added two strategies for feature value mode (real vs. approximate)\r\n    \u2502       - \ud83d\udd22New parameter for number of ROIs to select\r\n    \u2502       - \u2728Synthetic generation for ROI lesions smaller than 10 voxels\r\n    \u2502       - \u2728New strategy for ROI selection (image-based vs. region-based)\r\n    \u2502       - \ud83d\udcbeDisk-based processing to prevent RAM overflow\r\n    \u2502       - \ud83d\udc1bFixed NaN value bug in some features\r\n    \u2502       - \u2728Added support for processing NumPy array files in addition to file paths\r\n    \u2502       - \u2705IBSI compliance validation\r\n    \u2502       - \ud83d\udccaNew output structure including parameter set, error log, and warning report\r\n    \u2502       - \ud83d\udce6Updated package dependencies\r\n    v0\r\n    \u251c\u2500\u2500 v0.0\r\n    \u2502   \u2514\u2500\u2500 v0.0.0 - 2025-08-13\r\n    \u2502       - \ud83d\udd27IBSI Standardization \r\n    \u2502       - \ud83d\udc1bSome Bug fix\r\n    \u2502\r\n    \u2514\u2500\u2500 initial version - 2022-02-12\r\n       - \ud83c\udf89Initial implementation  \r\n       - \ud83d\udee0\ufe0fCore radiomics pipeline  \r\n       - \ud83d\udcc4Support for some types of files\r\n\r\n## \ud83d\udcecContact\r\nSERA is available **free of charge**.\r\nFor access, questions, or feedback:\r\n\r\n**Dr. Mohammad R. Salmanpour (Team Lead)**  \r\n\ud83d\udce7[msalman@bccrc.ca](mailto:msalman@bccrc.ca) | [m.salmanpoor66@gmail.com](mailto:m.salmanpoor66@gmail.com), [m.salmanpour@ubc.ca](mailto:m.salmanpour@ubc.ca)\r\n\r\n---\r\n\r\n## \ud83d\udee0\ufe0fMaintenance\r\nFor technical support and maintenance inquiries, please contact:\r\n\r\n**Dr. Mohammad R. Salmanpour (Team Lead)**  \r\n msalman@bccrc.ca \u2013 m.salmanpoor66@gmail.com \u2013 m.salmanpour@ubc.ca\r\n\r\n**Amir Hossein Pouria**  \r\namirporia99.1378@gmail.com  \r\n\r\n## \ud83d\udc65Authors\r\n- **Dr. Mohammad R. Salmanpour (Team Lead, Fund Provider, Evaluator, Medical Imaging Expert, Backend Development, Code Refactoring, Debugging, Library Management, IBSI Standardization, and Activation of the PySERA Library, and GUI Development in 3D Slicer)** \u2013 [msalman@bccrc.ca](mailto:msalman@bccrc.ca), [m.salmanpoor66@gmail.com](mailto:m.salmanpoor66@gmail.com), [m.salmanpour@ubc.ca](mailto:m.salmanpour@ubc.ca)\r\n- **Amir Hossein Pouria (Assistant Team Lead; Backend Development, Code Refactoring, Debugging, and Library Management)** \u2013 [amirporia99.1378@gmail.com](mailto:amirporia99.1378@gmail.com)\r\n- **Sirwan Barichin (IBSI Standardization, Debugging, and Activation of the PySERA Library, and GUI Development in 3D Slicer)** \u2013 [sirwanbarichin@gmail.com](mailto:sirwanbarichin@gmail.com)\r\n- **Yasaman Salehi (Backend Development, Code Refactoring, and Debugging)** \u2013 [y.salehi7698@gmail.com](mailto:y.salehi7698@gmail.com)\r\n- **Sonya Falahati (Tesing and Data prepration)** \u2013 [falahati.sonya@gmail.com](mailto:falahati.sonya@gmail.com)\r\n- **Dr. Mehrdad Oveisi (Evaluator, Software Engineer, and Advisor)** \u2013 [moveisi@cs.ubc.ca](mailto:moveisi@cs.ubc.ca)\r\n- **Dr. Arman Rahmim (Fund Provider, Medical Imaging Expert, Evaluator, and Advisor)** \u2013 [arman.rahmim@ubc.ca](mailto:arman.rahmim@ubc.ca), [arahmim@bccrc.ca ](mailto:arahmim@bccrc.ca)\r\n\r\n## \ud83d\udcdaCitation\r\n\r\n```bibtex\r\n@software{pysera2025,\r\n  title={pysera: A Simple Python Library for Radiomics Feature Extraction},\r\n  author={pysera Team},\r\n  year={2025},\r\n  url={https://github.com/MohammadRSalmanpour/PySERA}\r\n}\r\n```\r\n## \ud83d\udcdcLicense\r\n\r\nThis open-source software is released under the **MIT License**, which grants permission to use, modify, and distribute it for any purpose, including research or commercial use, without requiring modified versions to be shared as open source. See the [LICENSE](LICENSE) file for details.\r\n\r\n## Support\r\n\r\n- **Issues**: [GitHub Issues](https://github.com/MohammadRSalmanpour/PySERA/issues)\r\n- **Documentation**: This README and the included guides\r\n- **Examples**: See `examples/basic_usage.py`\r\n\r\n## Acknowledgment\r\n\r\nThis study was supported by:  \r\n\r\n- [\ud83d\udd2c **Qu**antitative **R**adiomolecular **I**maging and **T**herapy (Qurit) Lab, University of British Columbia, Vancouver, BC, Canada](https://www.qurit.ca)  \r\n- [\ud83c\udfe5 BC Cancer Research Institute, Department of Basic and Translational Research, Vancouver, BC, Canada](https://www.bccrc.ca/)  \r\n- [\ud83d\udcbb **Vir**tual **Collaboration (VirCollab) Group, Vancouver, BC, Canada](https://www.vircollab.com)  \r\n- [\ud83c\udfed **Tec**hnological **Vi**rtual **Co**llaboration **Corp**oration (TECVICO Corp.), Vancouver, BC, Canada](https://www.tecvico.com)  \r\nWe gratefully acknowledge funding from the\ud83d\udcb0 Natural Sciences and Engineering Research Council of Canada (**NSERC**) Idea to Innovation [**I2I**] Grant **GR034192**.\r\n---\r\n\r\n*PySERA - Simple, powerful radiomics in one function call. \ud83d\ude80*\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python library for radiomics feature extraction with multiprocessing support",
    "version": "2.0.2",
    "project_urls": {
        "Bug Reports": "https://github.com/MohammadRSalmanpour/PySERA/issues",
        "Documentation": "https://pysera.readthedocs.io/",
        "Homepage": "https://github.com/MohammadRSalmanpour/PySERA",
        "Repository": "https://github.com/MohammadRSalmanpour/PySERA.git"
    },
    "split_keywords": [
        "medical-imaging",
        " standardized-radiomics-feature-extraction",
        " quantitative-analysis",
        " ibsi-standardization",
        " healthcare"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fbbc157444ed621ae470ca1e0a0d4e2a253b0a03edba381309ea09bb37528096",
                "md5": "5edb4605bd6a5805549c7be0e4993f66",
                "sha256": "d47fea3bae38d5950b949321d4679da9569bc162407f8f802f9bbe5457d3ed89"
            },
            "downloads": -1,
            "filename": "pysera-2.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5edb4605bd6a5805549c7be0e4993f66",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 167303,
            "upload_time": "2025-10-20T07:46:48",
            "upload_time_iso_8601": "2025-10-20T07:46:48.056715Z",
            "url": "https://files.pythonhosted.org/packages/fb/bc/157444ed621ae470ca1e0a0d4e2a253b0a03edba381309ea09bb37528096/pysera-2.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "463477d7150741c0976a21f60175a08f2e7002be52bebc7c362ea425740628d1",
                "md5": "e1a0e011dca908b266024f8e7838537f",
                "sha256": "25d5b8f25f18cabe4c8c4bf31d2127703f4938eefd599b7b17b70725ec806021"
            },
            "downloads": -1,
            "filename": "pysera-2.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e1a0e011dca908b266024f8e7838537f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 166854,
            "upload_time": "2025-10-20T07:46:49",
            "upload_time_iso_8601": "2025-10-20T07:46:49.411417Z",
            "url": "https://files.pythonhosted.org/packages/46/34/77d7150741c0976a21f60175a08f2e7002be52bebc7c362ea425740628d1/pysera-2.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-20 07:46:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "MohammadRSalmanpour",
    "github_project": "PySERA",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pysera"
}
        
Elapsed time: 3.16394s