Skip to main content

A Python package for generating methods sections in for ASL parameters.

Project description

pyaslreport

A Python package for generating methods sections and reports for ASL (Arterial Spin Labeling) parameters and other medical imaging modalities.

Overview

pyaslreport is a specialized Python library designed to process and analyze medical imaging data, particularly 'for now' ASL (Arterial Spin Labeling) sequences. It provides comprehensive validation, processing, and report generation capabilities for asl publications.

Features

  • Comprehensive Validation: Validates ASL parameters, M0 data, and TSV files
  • Report Generation: Generates detailed reports with errors, warnings, and parameter summaries
  • Extensible Architecture: Easy to add new modalities and validators

Installation

Prerequisites

  • Python 3.7 or higher
  • pip

Install from Source

# Clone the repository
git clone <repository-url>
cd ASL\ Generator/package

# Install in development mode
pip install -e .

Dependencies

The package automatically installs the following dependencies:

  • PyYAML~=6.0.2 - YAML file processing
  • numpy~=2.2.6 - Numerical computing
  • nibabel~=5.3.2 - Neuroimaging file I/O
  • pydicom~=3.0.1 - DICOM file processing

Quick Start

Basic Usage

from pyaslreport import generate_report

# Prepare your data
data = {
    "modality": "asl",
    "files": ["path/to/asl.json", "path/to/m0scan.json", "path/to/data.tsv"],
    "nifti_file": "path/to/asl.nii",
    "dcm_files": ["path/to/dicom1.dcm", "path/to/dicom2.dcm"]  # Optional
}

# Generate report
result = generate_report(data)
print(result)

Command Line Interface

python -m pyaslreport.cli.generate_report \
    --modality asl \
    --files asl.json m0scan.json data.tsv \
    --filenames asl.json m0scan.json data.tsv \
    --nifti_file image.nii \
    --dcm_files dicom1.dcm dicom2.dcm

Supported Modalities

ASL (Arterial Spin Labeling)

The ASL processor provides comprehensive analysis of ASL sequences including:

  • Parameter Validation: Validates ASL-specific parameters like labeling duration, post-labeling delay, etc.
  • M0 Data Analysis: Processes and validates M0 reference scans
  • TSV File Processing: Analyzes volume types and timing information
  • Error Detection: Identifies major errors, minor errors, and warnings

Input Data Format

Required Files

  • ASL JSON: Contains ASL sequence parameters
  • NIfTI File: The actual imaging data
  • TSV File: Volume type information and timing data

Optional Files

  • DICOM Files: Can be converted to NIfTI format automatically
  • M0 JSON: M0 reference scan parameters

Data Structure

{
    "modality": "asl",                    # Required: Modality type
    "files": ["file1.json", "file2.tsv"], # Required: List of file paths
    "nifti_file": "image.nii",            # Required: NIfTI file path
    "dcm_files": ["dcm1.dcm", "dcm2.dcm"] # Optional: DICOM files
}

Output Format

The package returns a comprehensive dictionary containing:

{
    "report": {
        "basic_report": {...},      # Basic parameter summary
        "extended_report": {...},   # Detailed analysis
        "errors": {...},            # Error information
        "warnings": {...}           # Warning information
    },
    "parameters": {} # Extracted ASL parameters
}

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Acknowledgments

  • Built for medical imaging research and clinical applications
  • Designed to support ASL and related perfusion imaging techniques
  • Extensible architecture for future modality support

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

pyaslreport-0.0.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

pyaslreport-0.0.1-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file pyaslreport-0.0.1.tar.gz.

File metadata

  • Download URL: pyaslreport-0.0.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pyaslreport-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5d4c887748d8d242c40729b89a9d6719e9e5a60e190800cef2c0f7aa4f7bba61
MD5 86ba102de85e1695b6a866031c7d76e1
BLAKE2b-256 7cbbcd9677039aee09971e44c262636211addc44b696e2059e930017c4300955

See more details on using hashes here.

File details

Details for the file pyaslreport-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pyaslreport-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 41.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pyaslreport-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f65f84527de0f6862f5ee4d49ad8ad560efd46111abdd8d0539c6a51d8a2eb0
MD5 1b3a679fe6a3eb67e3dd81b5d44eff17
BLAKE2b-256 d27b260fc908ed5d75b879af73063a4dddc22e62bc11695186b2e1cf75c9df42

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page