sjoerdk / idis

Image DeIdentification Service, a wrapper around RSNA CTP for anonymizion of medical images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make PII lists more readable

sjoerdk opened this issue · comments

Currently these are rather deep python structures. See for example a SafePrivateDefinition:

safe_private = SafePrivateDefinition(
    blocks=[
        SafePrivateBlock(
            tags=[
                "0023[SIEMENS MED SP DXMG WH AWS 1]10",
                "0023[SIEMENS MED SP DXMG WH AWS 1]11",
                "00b1[TestCreator]01",
                "00b1[TestCreator]02",
            ],
            criterion=lambda x: x.Modality == "CT",
            comment="Some test tags, only valid for CT datasets",
        ),
        SafePrivateBlock(
            tags=["00b1[othercreator]11", "00b1[othercreator]12"],
            comment="Some more test tags, without a criterion",
        ),
    ]
)

This is hard to read and edit, easy to get wrong. Make this more like this:

if Modality == "CT"  # Some test tags, only valid for CT datasets
    "0023[SIEMENS MED SP DXMG WH AWS 1]10",
    "0023[SIEMENS MED SP DXMG WH AWS 1]11",
    "00b1[TestCreator]01",
    "00b1[TestCreator]02",

"00b1[othercreator]11"
"00b1[othercreator]12"