+ {
+ // depending on the gdcm::Document type
+ // (gdcm::File; gdcm::DicomDir, (more to come ?)
+ // some groups *cannot* be present.
+ // We hereby protect gdcm for writting stupid things
+ // if they were found in the original document.
+ if ( !MayIWrite( (i->second)->GetGroup() ) )
+ continue;
+ // Skip 'Group Length' element, since it may be wrong.
+ // except for Group 0002
+ if ( (i->second)->GetElement() == 0x0000
+ && (i->second)->GetGroup() != 0x0002 )
+ continue;
+ i->second->WriteContent(fp, filetype);