[Insight-developers] anonymize DICOM files
Peter Cech
pcech at vision.ee.ethz.ch
Thu Feb 3 19:16:29 EST 2005
On Thu, Feb 03, 2005 at 17:26:17 -0600, Kent Williams wrote:
> I have several DICOM data sets that for one reason or another are not
> working properly with the gdcm Dicom reader. The problems we're having
> aren't a big deal -- and I can deal with it off the list with the GDCM
> guy -- but I need to anonymize the datasets before sending them offsite.
Got similar problem in the past. Usually anonymizers read and then write
new DICOM file, so there is no guarantee an anonymized file contains the
same bug (in my case if they read it correctly, no bug at output).
My final solution was to look in the file for sensitive strings and
replace them using sed.
> My idea was to write a simple app that anonymizes the header and dumps a
> new file out. gdcm::Header has a function called 'AnonymizeHeader' that
> I copied to blank out the problem fields, but it's not clear to me how
> to read in the whole dicom slice and write it back out along with the
> pixel data -- using GDCM.
>
> What's happening is that it appears the header is getting written out OK
> but the pixel data is not.
Depending on the bug, some headers could be read incorrectly and it
tries to read something other as pixel data. Try to compile CVS version
of GDCM (from GDCM repository, not from ITK). There are some examples
that dump DICOM headers (e.g. PrintHeader). If the headers turn strange
in the middle, you cannot use your approach to anonymize (using sed will
do).
Regards,
Peter
More information about the Insight-developers
mailing list