pydicom / deid

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

Save files in a fixed naming format #221

Closed NirutaDhimal closed 1 year ago

NirutaDhimal commented 1 year ago

After the replace_identifiers function is executed the files are stored in a format "PatientID_SOPInstanceID". But I want to store the file in this format "mask_modality_studyDate_instancenumber". here mask is the value that I replaced patientID with. How can I do this?

vsoch commented 1 year ago

Save accepts a filename https://deid.readthedocs.io/en/latest/source/deid.dicom.html?highlight=save#deid.dicom.parser.DicomParser.save.

NirutaDhimal commented 1 year ago

I am using replace_identifiers function. Is there a way for me to save the files in above naming pattern? I am doing this for a bulk of files.

vsoch commented 1 year ago

Through that interface, I would set output_folder from None to a temporary directory, and then rename them after to whatever you'd like.

NirutaDhimal commented 1 year ago

Thanks