- if (tag->second->GetVR() == "SQ") //to skip pb of SQ recursive exploration
- continue;
-
- //According to JPR I should also skip those:
-// if (tag->second->GetVR() == "unkn") //to skip pb of SQ recursive exploration
-// continue;
-
- //no clue what to do with this one
- //std::cerr << "Reading: " << tag->second->GetVR() << std::endl;
- std::string value = ((gdcmValEntry*)(tag->second))->GetValue();
-// if( value.find( "gdcm::NotLoaded" ) == 0 )
-// continue;
-
- //no clue what to do with this one
- if( value.find( "gdcm::Loaded" ) == 0 )
- continue;
-
- copy->GetHeader()->ReplaceOrCreateByNumber(
- value,
- tag->second->GetGroup(),
- tag->second->GetElement() );
+ d = tag->second;
+ if ( gdcmBinEntry* b = dynamic_cast<gdcmBinEntry*>(d) )
+ {
+ copy->GetHeader()->ReplaceOrCreateByNumber(
+ b->GetBinArea(),
+ b->GetLength(),
+ b->GetGroup(),
+ b->GetElement(),
+ b->GetVR() );
+ }
+ else if ( gdcmValEntry* v = dynamic_cast<gdcmValEntry*>(d) )
+ {
+ copy->GetHeader()->ReplaceOrCreateByNumber(
+ v->GetValue(),
+ v->GetGroup(),
+ v->GetElement(),
+ v->GetVR() );
+ }
+ else
+ {
+ // We skip pb of SQ recursive exploration
+ //std::cout << "Skipped Sequence "
+ // << "------------- " << d->GetVR() << " "<< std::hex
+ // << d->GetGroup() << " " << d->GetElement()
+ // << std::endl;
+ }