Hi Victor,
If you have the original DICOMs you could try something like pydicom to overwrite the voxel values. The process would go something like:
1) Convert DICOM to nifti using your favorite tool 2) Deface niftii data using your favorite tool 3) Load the defaced data into python using nibabel, 4) Load the original dicom data into python using pydicom 5) Overwrite voxel values in the dicom with defaced nifti data 6) Use pydicom to save a new defaced DICOM series
Good luck!
-Paul
________________________________ From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Victor Montal Blancafort victor.montal@gmail.com Sent: Tuesday, May 24, 2022 10:39 AM To: freesurfer@nmr.mgh.harvard.edu freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Deface DICOM
External Email - Use Caution
Dear FS experts,
I am using mri_deface to annon our data. Nevertheless, for a recent project, we were requested to share our DICOM original files, instad of .nii or .mgz. Thus, I was wondering if you know a simple way to deface T1 data inputing a DICOM and obtaining a series of DICOM as output?
I have tried to 1) deface using mri_deface, 2) convert the .nii to dicom using the nifti2dicom utility and 3) correct DICOM info thats incorrecly parsed at step 2).
However, such approach does not work correctly for all our data (it fails for several reasons, such as correctly storing acq direction, or dimensions when sampling from nifti 2 dicom).
I have seen that @Doug has been working on a new deface utility (mideface) but it seems to work also only for .nii
Any insight? Victor Montal