PanImg Models
Data models for medical image processing and management.
Overview
This module provides Pydantic dataclasses and enums for handling medical imaging data, including support for various image formats, metadata, and processing results.
Core Components
Enums
ImageBuilderOptions: Supported image builder formats
- MHD, NIFTI, NRRD, DICOM, TIFF, OCT, FALLBACK
PostProcessorOptions: Post-processing formats
- DZI (Deep Zoom Image)
ColorSpace: Image color spaces
- GRAY, RGB, RGBA, YCBCR
ImageType: Output image types
- MHD, TIFF, DZI
EyeChoice: Eye selection for ophthalmology images
- OD (Oculus Dexter - right eye)
- OS (Oculus Sinister - left eye)
- U (Unknown)
- NA (Not Applicable)
Data Models
PanImg: Immutable image metadata
PanImg(
pk=uuid4(),
name="scan.mhd",
width=512,
height=512,
depth=100,
voxel_width_mm=0.5,
voxel_height_mm=0.5,
voxel_depth_mm=1.0,
color_space=ColorSpace.GRAY,
eye_choice=EyeChoice.OD,
segments=frozenset({1, 2, 3})
)
PanImgFile: Image file reference
PanImgFile(
image_id=uuid4(),
image_type=ImageType.DZI,
file=Path("/data/image.dzi"),
directory=Path("/data/image_files")
)
PanImgResult: Image processing results
PanImgResult(
new_images={img1, img2},
new_image_files={file1, file2},
consumed_files={Path("/input/scan.mhd")},
file_errors={Path("/bad.mhd"): ["Invalid header"]}
)
PostProcessorResult: Post-processing output
PostProcessorResult(
new_image_files={dzi_file}
)
Constants
MAXIMUM_SEGMENTS_LENGTH = 64: Max segments for int8/uint8 dataITK_COLOR_SPACE_MAP: Maps ITK channel counts to ColorSpace
Testing
Run tests with pytest:
pytest test_module.py -v
Requirements
- Python 3.10+
- pydantic
- pytest (for testing)
Metadata
Release files for panimg-models 1.0.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 | |
|---|---|---|---|
| panimg_models-1.0.0.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| panimg_models-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.5 kB
Release files / panimg_models-1.0.0.tar.gz
| Download URL | panimg_models-1.0.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8e18468b86bfd60af6702123cdcf2b3251d5b122e7ce522945807e515cb065c6
|
|
BLAKE2b-256 checksum How to use checksums |
35222aa6247614fa1bdc812d712da286ccb368784a5bd2a66ede6a93053df10b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Feb 9, 2026.
Transparency logRelease files / panimg_models-1.0.0-py3-none-any.whl
| Download URL | panimg_models-1.0.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64bef8e1d7593726dcd42c4802cc8c5510cb0df2c914ea311ef6877192bbb448
|
|
BLAKE2b-256 checksum How to use checksums |
15e1e44ec9a0deb14479f6ac3ff40488fb1178e8c5fb43c6e05464779c66558a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Feb 9, 2026.
Transparency log