parrec2dcm
Convert Philips PAR/REC files to DICOM.
Given only a .par/.rec pair (no Philips database or scanner export
available), produces standards-conformant DICOM with correct geometry, UIDs,
and pixel data. Two output formats are supported:
- Enhanced MR (default) — one multiframe DICOM file per series, built via
highdicom's legacy conversion (SOP Class1.2.840.10008.5.1.4.1.1.4.4, "Legacy Converted Enhanced MR Image Storage"). - Classic (
--classic) — one single-frame MR Image Storage file per image, matching how most legacy PAR/REC converters behave.
UIDs are deterministic by default (the same PAR content always produces the
same UIDs); pass --randomize-uids to get a fresh UID on every run instead
(useful when repeatedly re-exporting the same source into the same PACS).
If a Philips "database" parameter export is also available (a flat JSON
array of {Name, Value, ...} records — e.g. from a MongoDB/Agora export, or
the same list gtagora-connector-py's Dataset.get_parameters() returns),
pass it with --params to enrich the output beyond what the PAR header alone
can provide. Currently only the "new" (REL11) database format — where the
DICOM tag is embedded in the parameter name, e.g. RFR_SERIES_tag_00180091
— is mapped; the older symbolic-name format is detected and produces a
warning with a graceful PAR-only fallback rather than an error. "Goal"
(pulse-sequence) parameter enrichment is not yet implemented. --params
accepts one or more files, which are merged into a single pool — pass a
combined export or several separate ones, either way.
Installation
pip install parrec2dcm
Usage
As a command-line tool:
parrec2dcm path/to/scan.par -o path/to/output_dir # Enhanced MR (default)
parrec2dcm path/to/scan.par -o path/to/output_dir --classic # classic single-frame
parrec2dcm path/to/scan.par -o path/to/output_dir --params db.json # + database enrichment
As a library:
from parrec2dcm import convert
convert("path/to/scan.par", "path/to/output_dir")
convert("path/to/scan.par", "path/to/output_dir", output_format="classic")
convert("path/to/scan.par", "path/to/output_dir", params=["db.json"])
Development
pip install -e ".[dev]"
pytest
License
MIT
Metadata
Release files for parrec2dcm 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| parrec2dcm-0.2.0.tar.gz | 575.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| parrec2dcm-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 642.3 kB
Release files / parrec2dcm-0.2.0.tar.gz
| Download URL | parrec2dcm-0.2.0.tar.gz |
|---|---|
| Size | 575.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3683233e9f56f86a701181fa570b782c8807f50b08ffb952f297c51ab86a37a7
|
|
BLAKE2b-256 checksum How to use checksums |
98bdf1cc7f6477766e29ec3439ae1388c0ee6241615584bc16e427cf80c2b0c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / parrec2dcm-0.2.0-py3-none-any.whl
| Download URL | parrec2dcm-0.2.0-py3-none-any.whl |
|---|---|
| Size | 66.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f17234aa919579103115bb41e2c0b829522e1e970722b92b86f3bd86a7fe7c8f
|
|
BLAKE2b-256 checksum How to use checksums |
29e06fd3f5a6ab2cc13f75ec8e4ebc7c35648b29e0f76e482c8ca35fa906b089
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log