"""
Usage:
python NewSequence.py input.dcm output.dcm
Thanks to Robert Irie for code
"""
import sys
import gdcm
if __name__ == "__main__":
file1 = sys.argv[1]
file2 = sys.argv[2]
r.SetFileName( file1 )
if not r.Read():
sys.exit(1)
f = r.GetFile()
ds = f.GetDataSet()
de.SetByteValue(
"Occupation",
gdcm.VL(len(
"Occupation")))
it.SetVLToUndefined()
nds=it.GetNestedDataSet()
nds.Insert(de)
sq.SetLengthToUndefined()
sq.AddItem(it)
des.SetValue(sq.__ref__())
des.SetVLToUndefined()
ds.Insert(des)
w.SetFile( f )
w.SetFileName( file2 )
if not w.Write():
sys.exit(1)