cati-neuroimaging / deidentification

Tool to remove metadata allowing to identify a subject from DICOM images used in neuroimaging research
MIT License
3 stars 2 forks source link

Multiple private creator #33

Closed Hboni closed 2 years ago

Hboni commented 2 years ago

Add the possibility to use several Private Creator values for the same private tag. It allows config :

Tag Name Action Private Creator
(2005, 0010) Private Creator Tag K SIEMENS MR SDS 01
(2005, 0010) Private Creator Tag K SIEMENS MR SDI 02
Hboni commented 2 years ago

Modifications in config.py file are the modification of the function which return dict from csv file. PrivateCreator value will not be overwritten, but the name and the action will be. As the name is not really used in deidentification it is not a real issue. But for the action maybe ... I can add a check to see if action is the same, but I am not sure what to do if it is not the case. I did not want to make a list of actions too. Do you think it will be necessary?

rbregand commented 2 years ago

It's possible that according to the value of a private change we want to do a specific action but since it's not the case actually may be it's not worth to change anything in this PR. But if we need it in the future may be a dictionary like this might help : tags_profile[tag]= {value1 :{'name'=name1, 'action'=action1}, value2: {'name'=name, 'action'=action2}}

You can also put the name at a higher level in the dictionary. You know better than me if this solution is viable or not

Hboni commented 2 years ago

The only issue that I see with your solution, is that the check mechanism is different between Public and Private Tags, But it may be more robust :+1: