Expand description
DICOM Part-10 metadata parsing, stream traversal, discovery, and overlay specs.
File ingest path — heap allocation is permitted here (not a hot-path evaluator).
Structs§
- Dicom
Metadata - Dicom
Organ MapFile - Dicom
Overlay Spec - Dicom
Pixel Slice - Pixel payload location inside a Part 10 file (not copied — Core 3 streams to blob store).
- Dicom
Placement - Dicom
Split Payload - Result of split-ingestion parse: semantic metadata + raw pixel slice bounds.
- Dicom
TagMatcher
Enums§
Constants§
- DEFAULT_
LOCAL_ DICOM_ DIR - Default relative path for gitignored private DICOM slices (local dev only).
- INLINE_
TAG_ BLOB_ POINTER - Inline datatype tag for mmap blob byte-offset pointers (resolver bits 60–62 = 0b100).
- TS_
EXPLICIT_ VR_ LITTLE_ ENDIAN - TS_
IMPLICIT_ VR_ LITTLE_ ENDIAN - TS_
JPEG2000 - TS_
JPEG2000_ LOSSLESS - TS_
JPEG_ BASELINE - TS_
RLE_ LOSSLESS
Functions§
- build_
overlay_ spec - Assemble a
DicomOverlaySpecfrom parsed metadata — organ inferred when not supplied, placement defaulted per organ. - chat_
mentions_ imaging truewhentextmentions imaging (marker-substring scan overIMAGING_CHAT_MARKERS).- collect_
dicom_ image_ paths_ under - Image slices only (Pixel Data present), preferring
IM*filenames typical of PACS export. - collect_
dicom_ paths_ under - Collect up to
max_filesDICOM Part-10 paths underroot(cold-path helper; may allocate). - decode_
blob_ pointer - Decode a blob pointer from an Object field; returns
Noneif tag mismatch. - default_
organ_ matchers - Built-in token->organ matcher table (heart, lung, liver, brain, kidney, ovary, …) for DICOM text fields.
- default_
placement_ for_ organ - Curated 3D torso-overlay placement per organ label (offset/scale/ rotation), with a generic fallback for unlisted organs.
- dicom_
has_ pixel_ data - True when the buffer contains extractable Pixel Data for split-ingest.
- encode_
blob_ pointer - Encode a Core-3 blob-store byte offset into an inline Object field pointer.
- infer_
organ_ from_ haystack - First-matching-token organ inference over normalized
haystack. - infer_
organ_ from_ metadata - Infer the organ from the file’s text fields (body part, series/
study descriptions, protocol name) via
matchers. - infer_
overlay_ spec_ from_ text - Build a “chat-inferred” overlay spec when
textmentions imaging — organ from keyword match, sensible default opacity/placement. - is_
dicom_ part10 - Returns true when the byte slice looks like DICOM Part 10 (preamble +
DICM). - metadata_
json_ from_ file - Parsed
DicomMetadatafrompathserialized to JSON. - normalize_
dicom_ token - Lowercase, alphanumeric-only, whitespace-collapsed form of
value— the keyword-matching normal form. - overlay_
spec_ from_ file - Read
path, parse its DICOM metadata, and build the overlay spec. - overlay_
spec_ json_ from_ file overlay_spec_from_fileserialized to a JSON string (WASM/FFI seam).- pack_
volume_ metadata - Pack rows/cols/pixel-byte-length into the metadata lane for volume queries.
- parse_
dicom_ file - Parse DICOM metadata from a file path.
- parse_
dicom_ metadata_ bytes - Parse DICOM Part 10 metadata from an on-disk byte buffer (pixel data optional).
- resolve_
local_ dicom_ dir - Resolve private local DICOM root:
QUALIA_DICOM_FIXTURE_DIRenv, then workspace-relative default. - split_
dicom_ payload - Split-ingestion entry: metadata tags + pixel slice bounds (no heap copy of pixels).
- unpack_
volume_ metadata - Inverse of
pack_volume_metadata— (rows, cols, pixel byte length).