Anonymise nifti?

Is there a handy command line way of anonymising nifti-files using MRtrix?

I know there is an option in dcmedit for anonymising DICOM files. Also, I could manually edit the header (after mrconvert into .mih) by removing the information under “comments”. But is there a command line way of doing this?

Thanks a lot, Samuel

Hi Samuel,

Short answer is, yes, as of ~4 minutes ago… We’ve just added options to mrconvert to manipulate generic header entries/properties. Once you update, you should be able to anonymise any images (DICOM, NIfTI or whatever) by clearing or setting the comments field (the only field where MRtrix3 would store patient-confidential information right now). For example:

mrconvert DICOM_folder/ -clear_property comments out.mif

or:

mrconvert in.nii.gz -set_property comments anonymous out.nii

And if you use the MRtrix3 option shortening feature, you can write it more simply like this:

mrconvert DICOM/ -clear comments out.nii

Hope this does the trick!
Donald

works great, thanks a lot!!! :slight_smile:
Samuel

Hi everyone,
is there a way to do the same for tck files? In the command_history field there can easily be some confidential information.

Thank you in advance for your help.
Matteo