I'm trying to run mri_reface on a set of data, but I need additional Dicom information to be retained in the header.
I have tried adding my header fields to the tag_blocklist variable in the ADIRnii2dicom script where nii2dicom gets defined. However, when I rerun reface, it still outputs only the standard Dicom header fields. Do I need to change something else to include these headers in the output dicom file?
Or is there a version of mri_reface that doesn't change the header? I have other anonymization scripts to remove PHI, and am more interested in using mri_reface more so for the removal of facial features from the scans.
Thanks,
Greg Wade
Now that I'm using the correct information I was able to output the entirety of the dicom header to the refaced image after adjusting the input variables in nii2dicom.
Thanks anyway, this is an incredibly helpful tool!
Hi Greg, I know this is many months later, but I'm sorry I missed your message. I thought I was subscribed to this forum, but apparently I was only subscribed to the "general discussion" subforum. I'm glad you were able to figure it out! We preserve basically every DICOM tag that we can. The only ones in tag_blocklist are there because we are overwriting them elsewhere or because they would indicate that the image was mosaic or enhanced, when that would no longer be true after this process.
Thanks,
Chris
Hi Chris,
When you process DICOM data do you generate unique UIDs for things like Series Instance UID and SOP Instance UID? Or are those directly copied from the original data? In general, I think for our purposes we'd want all relevant UIDs to be new ones that uniquely distinguish this modified series from the original.
Also, do you populate the De-identification Method Code Sequence to indicate the Clean Recognizable Visual Features Option has been applied?
Thanks,
Justin
Justin,
When you use the DICOM-based workflow, it does NOT assign new UIDs for study and series instance UID (copies them verbatim), but it DOES add 113102 "Clean Recognizable Visual Features Option" to DeidentificationMethodCodeSequence. SOPInstanceUID and MediaStorageSOPInstanceUID are assignesd a new UID, however. I based this on the idea that it's new DICOM files, but it's still the original study and series. We also assume that this would typically be used in tandem with some other DICOM deidentification suite, which would typically assign new Study and Series UIDs while de-identifying other DICOM tags, so having our software change them would be redundant in most reasonable workflows.
Chris
Originally posted by Justin Kirby:
Hi Chris,
When you process DICOM data do you generate unique UIDs for things like Series Instance UID and SOP Instance UID? Or are those directly copied from the original data? In general, I think for our purposes we'd want all relevant UIDs to be new ones that uniquely distinguish this modified series from the original.
Also, do you populate the De-identification Method Code Sequence to indicate the Clean Recognizable Visual Features Option has been applied?
Thanks,
Justin
Hi Chris,
In our use case we intend to keep both the defaced and original series for potential use. I agree that leaving the Study Instance UIDs alone makes sense as we want the defaced series to show up in the same study as the original series when we present the data to users who have access to both versions. However, since the pixel data is different between the series, we don't think it's still "the same series" and should receive a new Series Instance UID.
We could certainly address modifying the Series UID in other parts of our workflow, but I think If you're already going to the trouble of generating new SOPInstanceUIDs and MediaStorageSOPInstanceUIDs it would make logical sense to generate a new Series UID as well.
Best,
Justin
Justin,
I don't think I want to make this change for everyone, and it seems
like something that wouldn't have enough usage to warrant making it
an option at the top levels of the run-scripts, so anyone calling
it would have to modify some code at one level or another in order
to use it.
However, unlike the core of mri_reface, ADIR_nii2dicom.py is open source.
If you look at line 665:
metaOut.file_meta.MediaStorageSOPInstanceUID =
pydicom.uid.generate_uid(prefix=uid_root)
you should accomplish what you want by copying this and changing it to
metaOut.file_meta.SeriesInstanceUID = pydicom.uid.generate_uid(prefix=uid_root)
Does that work for you?
Best,
Chris