Sign in

    medseal

    DICOM metadata validation, collection-consistent pseudonymization, UID remapping and verified binary rewriting in MoonBit.

    dicom
    de-identification
    medical-imaging
    moonbit
    Download zip
    Author
    Version
    0.3.0
    License
    Apache-2.0
    Last updated
    8 days ago
    Downloads
    88

    #MedSeal-MBT

    MoonBit libraries and native tools for DICOM metadata conversion, linked-object consistency and independent output verification. 中文指南.

    #Community upgrade in source / 社区升级源码

    C1 adds a complete portable public collection SDK: strict closed-batch conversion, bounded inputs, revalidated relationships and privacy-safe reports. The source consumer runs on Native, JS, wasm and wasm-gc; an independent pydicom oracle checks its actual output. These additions are included in the 0.3.0 community release. Run moon run --target js examples/consumer from the source checkout. See SDK usage and verification and 六阶段社区升级方案.

    C2 adds an offline rule lab powered by the compiled MoonBit core. Build with python3.12 tools/build_community_lab.py, then open tmp/community-lab/index.html in a regular browser. It uses bundled synthetic objects and provides rule/structure views, failure experiments and public JSON export. 使用与验收边界: Node/DOM contracts pass; V5 also verifies actual Chromium rendering, CSP enforcement, downloads, keyboard activation and a 390px layout. Patient-file import remains a separate design.

    C3a adds public DICOM JSON interchange for 25 VRs, exact decimal token preservation, bounded parsing, and Part 10 reconstruction. A bidirectional pydicom oracle checks actual output. The full consumer now passes through JSON before strict collection conversion. 支持范围与示例. The 实际应用升级计划 next prioritizes dataset preflight, independent reception, measured workloads and usability. V3–V5 now include actual loopback Orthanc reception, licensed phantom fidelity, measured application costs and rendered-browser checks; see the linked plan. V2 adds a bounded dataset preflight with actionable, privacy-safe diagnostics: python3.12 tools/dataset_preflight.py INPUT. 操作说明. These additions are included in the 0.3.0 community release.

    #Current scope: 0.3.0 community release

    EntryImplemented behaviorPlatform / boundary
    Public libraryPolicy compilation, DICOM read/write, validation and privacy-safe explanationPortable core; file I/O and authorization providers require Native
    Collection CLIPatient pseudonyms, identity UID mapping, full-date intervals, references and SHA-256 manifestsPer-job mappings; no persisted secrets in this compatible entry
    Private hostPersistent project/source identities, incremental cache/dedup, delivered-history references, precise time handling, resumable sealed jobs, object review, Ed25519 packages and idempotent directory receiptsPython 3.12 + MoonBit Native, controlled POSIX deployment
    Classic CT researchSingle-frame uncompressed 16-bit MONOCHROME2, independent voxel/HU/geometry checksNarrow ct-classic-research-v1; synthetic series tested
    Local workbenchLoopback job/status/explanation and cancellation interfaceSingle-host capability/CSRF protection; no multi-user network service

    Publication state and the contest remediation ledger are recorded in live competition remediation record. W0–W7 evidence separates implementation, synthetic verification and remaining field evidence. Earlier P/iteration audits are historical snapshots, not the current capability list.

    #Install the library

    Install MoonBit using the official instructions. Verified baseline: moon 0.1.20260920 / moonc 0.10.14+7d59c7ec9. In an existing independent MoonBit module:

    moon add 001-Elsa/medseal@0.3.0

    Create an executable package app/moon.pkg:

    import {
    "001-Elsa/medseal/api/policy",
    }
    pkgtype(kind: "executable")
    supported_targets = "+native"

    Create app/main.mbt:

    ///|
    fn main {
    try {
    let policy = @policy.strict()
    ignore(policy)
    println("public-policy-ok")
    } catch {
    _ => println("public-policy-rejected")
    }
    }

    moon run --target native app

    Expected output: public-policy-ok. Compiling a policy does not authorize privacy, pixel or release approval. Public import paths are api/dicom, api/dicom_json, api/policy, api/validation, api/explain, and Native api/authorization. See API contracts; existing src/ imports remain compatible. This package install supplies the library, not a certified enterprise deployment.

    #Install and run the source CLI

    git clone https://github.com/001-Elsa/MedSeal-MBT.git cd MedSeal-MBT moon update moon run --target native examples/collection

    The demo creates two synthetic patients, four files and two references, converts them and verifies the manifest. It prints a new tmp/demo-... directory. No real patient data is included. In the supplied workspace, tools/moon-local replaces moon using the sibling isolated toolchain without changing shell configuration.

    moon run --target native cmd/main -- plan INPUT_DIR --policy examples/research-policy.json moon run --target native cmd/main -- batch INPUT_DIR --output NEW_JOB_DIR --policy examples/research-policy.json moon run --target native cmd/main -- verify NEW_JOB_DIR moon run --target native cmd/main -- inspect samples/input.dcm --json moon run --target native cmd/main -- validate samples/input.dcm --json mkdir -p tmp moon run --target native cmd/main -- anonymize samples/input.dcm --output tmp/single.dcm --report tmp/single.json --remove-private

    plan checks the candidate collection without publishing outputs. batch stages anonymous DICOM names, per-object audits and a manifest, then publishes a new non-nested output directory. Source byte changes, identity conflicts and broken unauthorized references fail. verify checks manifest integrity and supported structure, not complete privacy. Basic anonymize keeps UIDs and fixed aliases; its separate output/report cannot be committed as a single directory transaction. See policies and support matrix.

    #Persistent workflows and realistic examples

    Use operations and offline installation for Python 3.12 private stores, create/run/resume, review/publish/deliver, backup and rotation. Incremental ledger explains source-domain boundaries, exact-repeat reuse and historical-reference checks. The workbench reuses these operations. Three complete scenarios describe batch integration, longitudinal research and embedding the public library, with executable evidence and explicit failure boundaries. They are intended uses supported by synthetic checks, not claims of hospital adoption.

    #Verification and contribution

    moon info moon fmt --check moon check --target all --deny-warn moon test --target all --deny-warn moon build --target native moon package python3.12 -m pip install -r requirements-qa.txt -r requirements-enterprise.txt python3.12 tools/verify_with_pydicom.py python3.12 tools/verify_ct_research.py --record tmp/ct-research.json python3.12 tools/verify_release_readiness.py

    Core CI covers Linux/macOS/Windows. POSIX host acceptance runs on Linux/macOS; Windows is not an enterprise deployment claim. Fixed corpus, generated-rule drift, negative cases and offline distribution verification are in CI. Records state their source revision; a configured workflow alone is not proof of success. See CONTRIBUTING, CHANGELOG and contribution boundaries.

    #Privacy and limits

    Only Part 10 Explicit VR Little Endian, ASCII / ISO_IR 192 and documented Sequence/metadata rules are supported. Classic CT has a limited research profile; MR/SC metadata checks do not establish full IOD conformance. Unsupported transfer syntax, public UID role, encoding and conflicting identities fail explicitly. Pixel bytes are preserved without OCR, redaction or diagnosis. Unknown public metadata and burned-in identifiers require review. Full Annex E anonymization, compressed pixels, PACS/DICOMweb and real field acceptance are not claimed. Security, streaming limits, field evidence gates.

    #Documentation and submission

    全部文档索引 / document audit · 项目提交指南 · 申报事实与答辩提纲。姓名:韩桢。正式表单由本人提交;项目发布不代表已经取得报名回执。

    文档核对:本文说明已与当前维护代码和实际入口核对;不扩大医疗/生产保证。见文档账本;正式申报由韩桢本人完成。