The only problem is that CTP removes all private tags so if we need to refer to any of these (e.g. to check for ZIEHM machines which don't populate the Manufacturer tag, only private tags) then we either:
run before CTP anonymiser, or
use the original filename from the rabbitmq message to read the original DICOM file
We need
a way to store the rules
a command line option to apply the rules
tests
Tasks:
[x] library function - read deid rules and call detect() from a pydicom dataset object not a filename
[x] library function - convert deid rectangle coordinates into Rect (or a subclass of)
[x] utility to read the rectangle database and convert into deid rules (needs extra Ziehm metadata?)
[ ] dicom_ocr - read deid rules, check if they apply to the file, write the rectangles to the database
[x] dicom_redact - option to redact rectangles from deid detection rules as well as from database
[x] dcmaudit - read deid rules and add to list of redaction rectangles
Added library function deidrules/test_deid_result_rectangles() and a better-named alias detect() to return DicomRects
As above
Added utility dbrects_to_deid_rules.py
Decided against adding the rectangles derived from rules into the database. It sounds like a neat solution but it's probably better to add the functionality explicitly to dicom_redact and dcmaudit.
dicom_redact.py --deid
dcmaudit now automatically reads deid rules
Rules are stored in files named $SMI_ROOT/data/deid/deid.dicom.*
Currently the redaction rectangles are only taken from a database (or CSV) on a per-filename basis.
We need the ability to redact based on rules (just like CTP and pydicom). Probably base the implementation on the pydicom file format?
The only problem is that CTP removes all private tags so if we need to refer to any of these (e.g. to check for ZIEHM machines which don't populate the Manufacturer tag, only private tags) then we either:
We need
Tasks: