Deidentification recipes¶
Recipe formats for the deidentification of DICOM files with deid, and their side-cars (see Recipe formats).
- class fileformats.medimage.DeidRecipe(*fspaths: Iterable[str | Path] | str | Path | fileformats.core.FileSet, metadata: Dict[str, Any] | None = None, **load_kwargs: Any)[source]¶
Bases:
UnicodeFileA deidentification recipe for the deid package. Recipes don’t have a standard extension (they are typically named
deid.<format>), so they are identified by theFORMAT <format>line they start with instead
- class fileformats.medimage.DeidTransforms(*fspaths: Iterable[str | Path] | str | Path | fileformats.core.FileSet, metadata: Dict[str, Any] | None = None, **load_kwargs: Any)[source]¶
Bases:
UnicodeFileA YAML file declaring the values of the variables and functions referenced by
var:andfunc:values in a DeidRecipe, using a small expression language rather than code, so that it can be safely distributed to and run at sites (see the “Deid transforms specification” in the docs).Expressions can read DICOM tags and environment variables, combine them with templates, and transform them, e.g. truncating them or hashing them with the key from the DeidSalt side-car of the recipe
- class fileformats.medimage.DeidSalt(*fspaths: Iterable[str | Path] | str | Path | fileformats.core.FileSet, metadata: Dict[str, Any] | None = None, **load_kwargs: Any)[source]¶
Bases:
BinaryFileA secret key used to salt values that are hashed by the transforms of a DeidRecipeX (see DeidTransforms). Surrounding whitespace is stripped when it is loaded. It should only be readable by the user running the deidentification
- class fileformats.medimage.DeidRecipeX(*fspaths: Iterable[str | Path] | str | Path | fileformats.core.FileSet, metadata: Dict[str, Any] | None = None, **load_kwargs: Any)[source]¶
Bases:
WithAdjacentFiles,DeidRecipeA DeidRecipe with a DeidTransforms side-car, which defines the values of the variables and functions referenced by
var:andfunc:values in the recipe, and optionally a DeidSalt side-car with a key for the transforms to salt hashed values with. The side-cars are named after the recipe with its extension (if any) replaced by.transforms.yamland.salt, e.g.dicom-series.deid,dicom-series.transforms.yamlanddicom-series.salt