Skip to content

Instantly share code, notes, and snippets.

@nanodocumet
Created February 23, 2013 19:41
Show Gist options
  • Save nanodocumet/5021031 to your computer and use it in GitHub Desktop.
Save nanodocumet/5021031 to your computer and use it in GitHub Desktop.
Removing a tag from a DICOM file using Nanodicom
<?php
/*
* Current way to unset (remove) a tag from a DICOM file.
*/
echo "Removing a tag from a DICOM file using Nanodicom";
$filename = "myfile.dcm";
// We need to use dumper
$dicom = Nanodicom::factory($filename, 'dumper');
// We need to do dump
$dicom->dump();
// We must use this method of using the tag name
unset($dicom->patient_name);
// Save as new file. PatientName must be gone
$dicom->write_file('newFile.dcm');
unset($dicom);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment