- // FIXME : find a trick to know if current object is a
- // gdcm::File or a gdcm::Document
- //if ( dynamic_cast< File* > ( this ) ) { // ignore illegal groups }
+ // 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;