Skip to main content

Single-image Characterization Of PErformance in X-Ray systems

Project description


PyPILicense: GPL v3 Python 3.9+ Documentation Status

📚 Full documentation: scope-xr.readthedocs.io

Table of Contents


Introduction

SCOPE-XR (Single-image Characterization Of PErformance in X-Ray systems) is a specialized Python framework for the automated characterization of X-ray systems. By analyzing a single acquisition of a circular aperture or disk test object, the software reconstructs 2D source distributions and detector responses.

Key capabilities:

  • Focal Spot: Automated reconstruction of 2D focal spot distribution and dimensions based on the methodology by Di Domenico et al., which is available in the form of an ImageJ plugin.
  • PSF: Automated reconstruction of 2D PSF distribution of the detector, based on the methodology by Forster et al., with optional sub-pixel oversampling controlled by a single gaussian_sigma parameter (0/None = direct binning, >0 = fine-grid blur).

Quick Start

Get started in 3 steps:

# 1. Install from PyPI
pip install scopexr

# 2. Run GUI
scopexr-gui

# 3. Or use CLI
scopexr-fs --f "path/to/image.tif"

📘 New to SCOPE-XR? Check out the Quickstart Guide with step-by-step instructions.

Installation

SCOPE-XR is installed as a standard Python package directly from PyPi. It is recommended to use a virtual environment (venv or conda) to keep your system clean.

Prerequisites

  • Python 3.9 or higher
  • Git

Create and activate a virtual environment (Optional but Recommended):

Windows:

python -m venv venv
.\venv\Scripts\activate

Linux/macOS:

python3 -m venv venv
source venv/bin/activate

1. Quick Install (For regular users)

If you just want to use the software without modifying the code, install directly from PyPI:

pip install scopexr

⚠️ Important: Configuration files (.yaml) are required for execution. Please download them from the examples folder and place them in your working directory.

2. Manual Install (From source)

Recommended if you wish to modify the code or contribute:

  1. Clone the repository:

    git clone https://github.com/jacopoaltieri/scope-xr
    cd scope-xr
    
  2. Install the package:

    Install in editable mode (recommended for development) to ensure all dependencies are handled automatically:

    pip install -e .
    

    If you want also to be able to run the tests or build the docs, run:

    pip install -e .[all]
    

Usage

SCOPE-XR provides two main interfaces designed for different user workflows.

The program supports configurable execution via YAML configuration files. You can find an example of these files in the examples folder, along with some simulated images to test the package.

Supported Image Formats

The supported input image formats are:

  • .png
  • .tif / .tiff
  • .raw (must be accompanied by a corresponding .xml metadata file)
  • .dcm (DICOM)

GUI Execution

The recommended way for routine analysis. It features live image previews and interactive parameter tuning. To run the GUI, simply type:

scopexr-gui

GUI Features:

  • Easy Mode Selection: Separate tabs for "Focal Spot (FS)" and "PSF" analysis.
  • Automatic Configuration: The GUI automatically loads all default parameters from fs_args.yaml or psf_args.yaml on startup.
  • Image Preview: Load .png, .tif/.tiff, or .dcm images to see a preview directly in the app.
  • Full Parameter Control: All CLI flags are editable via interactive widgets.
  • Edit Config Files: A button allows you to directly open and edit the default .yaml config file for the active tab.
  • Live Output: All console output from the analysis script is printed directly to a text box within the GUI.

CLI Execution

Ideal for batch processing and integration into automated research pipelines. To run the program with the default settings (as defined in fs_args.yaml or psf_args.yaml), use the following commands:

  • Focal Spot:

    scopexr-fs --f "path/to/img.png"
    
  • PSF:

    scopexr-psf --f "path/to/img.png"
    

Use the --help flag with any command to see all available parameters.

Overriding Configuration Parameters

You can override any configuration value directly from the command line by adding the corresponding flag. For example:

scopexr-fs --f "path/to/img.png" --p 0.2

In this case, the pixel size will be set to 0.2 mm instead of the default value specified in the YAML file.

The full list of CLI flags is available in the documentation

Processing Pipeline

SCOPE-XR Processing Pipeline

Documentation

Comprehensive documentation is available at scope-xr.readthedocs.io:

Contributing

We welcome contributions! Whether you're fixing bugs, adding features, improving documentation, or reporting issues, your help is appreciated.

Quick Start:

# Fork and clone
git clone https://github.com/YOUR_USERNAME/scope-xr.git
cd scope-xr

# Install dev dependencies
pip install -e .[dev,test]

# Create feature branch
git checkout -b feature/my-feature

# Make changes, run tests
ruff check
pytest

# Push and create PR
git push origin feature/my-feature

📋 Full guidelines: See CONTRIBUTING.md for detailed instructions on:

  • Development setup
  • Code style guide (using ruff)
  • Testing requirements
  • Pull request process
  • Reporting bugs and requesting features

Citation

If you use SCOPE-XR in your research, please cite:

@software{scopexr2026,
  author = {Altieri, Jacopo},
  title = {SCOPE-XR: Single-image Characterization Of PErformance in X-Ray systems},
  year = {2026},
  version = {1.3.0},
  url = {https://github.com/jacopoaltieri/scope-xr}
}

Methodology citations:

Published paper:

The SCOPE-XR methodology and software are described in our paper; please cite it as: Altieri J, Cardarelli P, Di Domenico G, Taibi A. A python framework for single-image characterization of X-ray focal spot distribution and detector point spread function. Med Phys. 2026;53:e70513. https://doi.org/10.1002/mp.70513

@article{https://doi.org/10.1002/mp.70513,
author = {Altieri, Jacopo and Cardarelli, Paolo and Di Domenico, Giovanni and Taibi, Angelo},
title = {A python framework for single-image characterization of X-ray focal spot distribution and detector point spread function},
journal = {Medical Physics},
volume = {53},
number = {6},
pages = {e70513},
keywords = {focal spot, image reconstruction, open-source, point spread function, python software, quality assurance, X-ray imaging},
doi = {https://doi.org/10.1002/mp.70513},
url = {https://aapm.onlinelibrary.wiley.com/doi/abs/10.1002/mp.70513},
eprint = {https://aapm.onlinelibrary.wiley.com/doi/pdf/10.1002/mp.70513},
year = {2026}
}

Changelog

See CHANGELOG.md for version history and release notes.


⚖️ License

Distributed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for the full text.

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

scopexr-1.3.2.tar.gz (3.5 MB view details)

Uploaded Source

Built Distribution

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

scopexr-1.3.2-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file scopexr-1.3.2.tar.gz.

File metadata

  • Download URL: scopexr-1.3.2.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scopexr-1.3.2.tar.gz
Algorithm Hash digest
SHA256 b4327794eea8bd3612e0e6e2e0944ac7efcd611d999ae201a14c1d57a6040c14
MD5 58cf3f2304cddd74b48de2603cf5a169
BLAKE2b-256 a121a50b527b927e50d3751ffcab29b780617b33d89ad784c195a58c7659ff46

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopexr-1.3.2.tar.gz:

Publisher: release.yaml on jacopoaltieri/scope-xr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scopexr-1.3.2-py3-none-any.whl.

File metadata

  • Download URL: scopexr-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scopexr-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9492c482533e1bfc6192daf96d6bfa1699ea09954d9e72bb021fd370cd425cd5
MD5 7d8a1348b0f0f51b9bfb1cc84f3c46e5
BLAKE2b-256 606aba29f0fdf6f1f50f10db6ccaddffb381237a2c3a5e21a8d3a11aef77aa78

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopexr-1.3.2-py3-none-any.whl:

Publisher: release.yaml on jacopoaltieri/scope-xr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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