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 processingnumpy~=2.2.6- Numerical computingnibabel~=5.3.2- Neuroimaging file I/Opydicom~=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
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
- Ibrahim Abdelazim - ibrahim.abdelazim@fau.de
- Hanliang Xu - hxu110@jh.edu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7073e6b2cf5a8ea067fe7ff971590b66571038f9e7c896e94759b5722f5213ef
|
|
| MD5 |
9917e21d7b9f2c34eef039c2b35bbb38
|
|
| BLAKE2b-256 |
e0ac9f0c61024dda686c96cabb06058df28827d08b4d0045fd6066b79f2432f9
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfeed10cb2d0a1e30ceba74a4ba72b115efbb67fd376c55829af5bc7fd8ba165
|
|
| MD5 |
0e13dcc303efd3c8b316db346b0d4ea2
|
|
| BLAKE2b-256 |
b904f38439a70c8b8255e7a27ef32b3c23d0f07f80cd9ba5e9fd136d0fd52e33
|