- f1->ReplaceOrCreateByNumber(0x0028, 0x0008,
- f2->GetPubElValByNumber(0x0028, 0x0008));// nb Frames
- f1->ReplaceOrCreateByNumber(0x0028, 0x0010,
- f2->GetPubElValByNumber(0x0028, 0x0010));// nbLig
- f1->ReplaceOrCreateByNumber(0x0028, 0x0011,
- f2->GetPubElValByNumber(0x0028, 0x0011));// nbCol
+ std::string nbFrames = f2->GetHeader()->GetPubElValByNumber(0x0028, 0x0008);
+ if(nbFrames != "gdcm::Unfound") {
+ f1->GetHeader()->ReplaceOrCreateByNumber( nbFrames, 0x0028, 0x0008);
+ }
+
+ f1->GetHeader()->ReplaceOrCreateByNumber(f2->GetHeader()->GetPubElValByNumber(0x0028, 0x0010),
+ 0x0028, 0x0010);// nbLig
+ f1->GetHeader()->ReplaceOrCreateByNumber( f2->GetHeader()->GetPubElValByNumber(0x0028, 0x0011),
+ 0x0028, 0x0011);// nbCol
+