| 509 | |
| 510 | |
| 511 | E_Condition DcmDicomDir::convertLinearToTree() |
| 512 | { |
| 513 | Bdebug((1, "dcdicdir:DcmDicomDir::convertLinearToTree()" )); |
| 514 | |
| 515 | DcmDataset &dset = this->getDataset(); // existiert auf jeden Fall |
| 516 | DcmSequenceOfItems &localDirRecSeq = this->getDirRecSeq( dset ); |
| 517 | E_Condition l_error = resolveAllOffsets( dset ); |
| 518 | |
| 519 | // Suche ersten Directory Record: |
| 520 | DcmDirectoryRecord *firstRootRecord = (DcmDirectoryRecord*)NULL; |
| 521 | DcmUnsignedLongOffset *offElem = lookForOffsetElem( &dset, |
| 522 | DCM_RootDirectoryFirstRecord ); |
| 523 | if ( offElem != (DcmUnsignedLongOffset*)NULL ) |
| 524 | firstRootRecord = (DcmDirectoryRecord*)offElem->getNextRecord(); |
| 525 | |
| 526 | // bilde aus linearer Anordnung der Records eine Baumstruktur: |
| 527 | moveRecordToTree( firstRootRecord, localDirRecSeq, &this->getRootRecord() ); |
| 528 | |
| 529 | // Verschiebe MRDRs von localDirRecSeq nach globaler MRDRSeq: |
| 530 | moveMRDRbetweenSQs( localDirRecSeq, this->getMRDRSequence() ); |
| 531 | |
| 532 | // loese MRDR-Referenzen bei allen uebrig gebliebenen Items auf |
| 533 | for (unsigned long i = localDirRecSeq.card(); i > 0; i-- ) |
| 534 | linkMRDRtoRecord( (DcmDirectoryRecord*)localDirRecSeq.getItem(i-1) ); |
| 535 | |
| 536 | Edebug(()); |
| 537 | |
| 538 | return l_error; |
| 539 | } |
| 540 | |
| 541 | |
| 542 | // ******************************** |
nothing calls this directly
no test coverage detected