Skip to main content

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 data
  • ITK_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panimg_models-1.0.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panimg_models-1.0.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

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

Hashes for panimg_models-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8e18468b86bfd60af6702123cdcf2b3251d5b122e7ce522945807e515cb065c6
MD5 8235d6dec6c75208ab9e342a9a49e576
BLAKE2b-256 35222aa6247614fa1bdc812d712da286ccb368784a5bd2a66ede6a93053df10b

See more details on using hashes here.

Provenance

The following attestation bundles were made for panimg_models-1.0.0.tar.gz:

Publisher: release.yml on DIAGNijmegen/rse-panimg-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for panimg_models-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64bef8e1d7593726dcd42c4802cc8c5510cb0df2c914ea311ef6877192bbb448
MD5 2495d4bfbfb29a98eadaf6db5fa387cd
BLAKE2b-256 15e1e44ec9a0deb14479f6ac3ff40488fb1178e8c5fb43c6e05464779c66558a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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