pydicom / deid

best effort anonymization for medical images using python
https://pydicom.github.io/deid/
MIT License
142 stars 44 forks source link

(7fe0, 0010) Pixel Data doesn't appear in the dictionary when using get_identifiers #260

Closed aawez closed 5 months ago

aawez commented 5 months ago

Hi, The PixelData attribute doesn't load in the dictionary when the get_identifiers method is used.

However, when I use pydicom.dcmread, it does appear there.

Is this a bug, or am I missing anything? As per the documentation page, PixelData should also be loaded along with other metadata tags when using get_identifiers.

vsoch commented 5 months ago

It's in the default config.json to skip https://github.com/pydicom/deid/blob/467b8bd76c6578683c47600b7194e3caed500fd9/deid/dicom/config.json#L4 unless you specify otherwise (change that file or do disable_skip=True).

aawez commented 5 months ago

Thanks, Vanessa, I did try disable_skip=True, and I didn't see any difference in the dictionary. However, when I created a new config.json file, it worked.

I have a quick question that I would appreciate your help with. I am currently developing a de-identification module for our use case, and I am building it from scratch. My approach involves using the 'get_identifiers' function to extract all the necessary metadata tags (including the nested ones) from the file. After that, I plan to anonymize the values as per our requirements and then use the 'save_as' method to save the file. However, I am concerned that using the 'save_as' method will result in any compatibility issue or would it be saved just as how it was originally but with anonymized values?

vsoch commented 5 months ago

Your best bet (and for your learning) is to look into the code, specifically at the DicomParser that get_identifiers uses, and understand what it is doing (and if you want to change it). The save as will fall back to using pydicom, so any issues there should be asked to that project.

aawez commented 5 months ago

Thanks for your prompt response. Appreciate it!