Models for panimg.
Project description
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)
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 panimg_models-1.0.0.tar.gz.
File metadata
- Download URL: panimg_models-1.0.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e18468b86bfd60af6702123cdcf2b3251d5b122e7ce522945807e515cb065c6
|
|
| MD5 |
8235d6dec6c75208ab9e342a9a49e576
|
|
| BLAKE2b-256 |
35222aa6247614fa1bdc812d712da286ccb368784a5bd2a66ede6a93053df10b
|
Provenance
The following attestation bundles were made for panimg_models-1.0.0.tar.gz:
Publisher:
release.yml on DIAGNijmegen/rse-panimg-models
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
panimg_models-1.0.0.tar.gz -
Subject digest:
8e18468b86bfd60af6702123cdcf2b3251d5b122e7ce522945807e515cb065c6 - Sigstore transparency entry: 930489826
- Sigstore integration time:
-
Permalink:
DIAGNijmegen/rse-panimg-models@8d6c5d4aab51a5495c9090661dfd7c6aab544326 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/DIAGNijmegen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d6c5d4aab51a5495c9090661dfd7c6aab544326 -
Trigger Event:
release
-
Statement type:
File details
Details for the file panimg_models-1.0.0-py3-none-any.whl.
File metadata
- Download URL: panimg_models-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64bef8e1d7593726dcd42c4802cc8c5510cb0df2c914ea311ef6877192bbb448
|
|
| MD5 |
2495d4bfbfb29a98eadaf6db5fa387cd
|
|
| BLAKE2b-256 |
15e1e44ec9a0deb14479f6ac3ff40488fb1178e8c5fb43c6e05464779c66558a
|
Provenance
The following attestation bundles were made for panimg_models-1.0.0-py3-none-any.whl:
Publisher:
release.yml on DIAGNijmegen/rse-panimg-models
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
panimg_models-1.0.0-py3-none-any.whl -
Subject digest:
64bef8e1d7593726dcd42c4802cc8c5510cb0df2c914ea311ef6877192bbb448 - Sigstore transparency entry: 930489835
- Sigstore integration time:
-
Permalink:
DIAGNijmegen/rse-panimg-models@8d6c5d4aab51a5495c9090661dfd7c6aab544326 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/DIAGNijmegen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d6c5d4aab51a5495c9090661dfd7c6aab544326 -
Trigger Event:
release
-
Statement type: