Here is the resulting image
http://rapidshare.com/files/7582934/UN_SQ.html
Now, even though that was a mistake on my part, that image should still be valid, right? All DICOM applications I tested with manage to read it properly, with the exception of the DCMTK tools :(
The error I get is:
After manually changing the VR from UN to SQ, it works.DcmItem: Length of attribute (0008,0100) is odd
DcmElement: CodeValue(0008,0100) larger (411731) that remaining bytes in file
Error: Invalid Stream: reading file: UN_SQ
It's a quite a weird error. It goes into to the sequence properly (it knows a UN with undefined length is a SQ), but once it gets to the first data element in the first item, it reads it as Implicit Little, and obviously gets the wrong length... Why would it be reading the data elements in the UN sequence as Implicit Little?