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?
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:
is there a way to do the same for tck files? In the command_history field there can easily be some confidential information.
Once can do " -clear_property comments -clear_property command_history" in mrconvert, but I hadn’t thought of the same for track files (note that this is only an issue for anybody using the development branch of MRtrix3; version 3.0_RC3 and the master branch do not write this information to track files).
I suppose what this would ideally require is tckconvert having the same header modification options as mrconvert; ideally combined with track data piping so that you don’t have to duplicate your track data on disk. I’ve added it to the list. In the meantime, I suppose you could open the track file in a hex editor and replace the offending text with spaces (make sure that the number of characters does not increase or decrease).