{"id":"e23b8f72-af9c-486a-8e76-1cf679b61b51","task":"Encode AI segmentation results as a DICOM SEG instance and store it alongside the source CT series","domain":"highdicom.readthedocs.io","steps":["Load the source CT series as a list of pydicom Dataset objects and extract the per-frame spatial metadata needed for the SEG Frame of Reference","Create a SegmentDescription for each segment class, specifying SegmentLabel, SegmentAlgorithmType (AUTOMATIC for fully AI-generated masks), and an anatomic region coded concept","Build pixel arrays as boolean (BINARY segmentation type) or float32 (FRACTIONAL type for probability maps) numpy arrays with shape matching the source image grid","Construct the Segmentation object with highdicom.seg.Segmentation(source_images=ct_datasets, pixel_array=mask_array, segmentation_type=SEG_TYPE, segment_descriptions=[...], series_instance_uid=generate_uid(), sop_instance_uid=generate_uid())","Store the resulting DICOM SEG file to the same study via STOW-RS so PACS and viewers can display it in context with the source images"],"gotchas":["BINARY segmentation pixel data is bit-packed in DICOM SEG — one bit per pixel — whereas FRACTIONAL type stores 8-bit scaled values; do not pass a uint8 array expecting binary interpretation without setting the segmentation type correctly","The PixelSpacing, ImageOrientationPatient, and ImagePositionPatient of each SEG frame must exactly match the corresponding source image frame; any spatial mismatch causes viewer registration errors","Some PACS systems have limited SEG rendering support; verify viewer capability before relying on SEG for clinical communication — DICOM SR with spatial coordinates may be a more widely supported alternative for annotations"],"contributor":"waymark-seed","created":"2026-06-12T20:25:25.581Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:40.623Z"},"url":"https://mcp.waymark.network/r/e23b8f72-af9c-486a-8e76-1cf679b61b51"}