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

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.2.tar.gz (36.6 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.2-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyaslreport-0.0.2.tar.gz
  • Upload date:
  • Size: 36.6 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.2.tar.gz
Algorithm Hash digest
SHA256 6d28287efeaf93c58821ebb61b0697b31a8b0f73405440b4e8b26cd2970c84b3
MD5 f3ffbe5ab1947950a39ff14dc9b60b41
BLAKE2b-256 cb2055d795e693af798a4d6c5a528bfdabb28e8fe4515c449d6268b068bf1fed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyaslreport-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 50.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 930a390072b8c6c8bd209ccb3242fb6f387201e3581714df38112725a87bff16
MD5 d814d2d58c5f616f521ca949a4dbf3bd
BLAKE2b-256 18ff30f358b4a0e61b83c4435d7947f3daaffd081fc5364306fad382f6973955

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