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.3.tar.gz (41.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.3-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyaslreport-0.0.3.tar.gz
Algorithm Hash digest
SHA256 7073e6b2cf5a8ea067fe7ff971590b66571038f9e7c896e94759b5722f5213ef
MD5 9917e21d7b9f2c34eef039c2b35bbb38
BLAKE2b-256 e0ac9f0c61024dda686c96cabb06058df28827d08b4d0045fd6066b79f2432f9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyaslreport-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cfeed10cb2d0a1e30ceba74a4ba72b115efbb67fd376c55829af5bc7fd8ba165
MD5 0e13dcc303efd3c8b316db346b0d4ea2
BLAKE2b-256 b904f38439a70c8b8255e7a27ef32b3c23d0f07f80cd9ba5e9fd136d0fd52e33

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