-void gdcmDicomDir::CheckBoundaries()
-{
- ListDicomDirPatient::iterator itPatient;
- ListDicomDirStudy::iterator itStudy;
- ListDicomDirSerie::iterator itSerie;
- ListDicomDirImage::iterator itImage;
- ListTag::iterator i,j;
-
- GetDicomDirMeta()->ResetBoundaries(0);
-
- itPatient = GetDicomDirPatients().begin();
- while ( itPatient != GetDicomDirPatients().end() ) {
- (*itPatient)->ResetBoundaries(1);
- itStudy = ((*itPatient)->GetDicomDirStudies()).begin();
- while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) {
- (*itStudy)->ResetBoundaries(1);
- itSerie = ((*itStudy)->GetDicomDirSeries()).begin();
- while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) {
- (*itSerie)->ResetBoundaries(1);
- itImage = ((*itSerie)->GetDicomDirImages()).begin();
- while (itImage != (*itSerie)->GetDicomDirImages().end() ) {
- (*itImage)->ResetBoundaries(1);
- ++itImage;
- }
- ++itSerie;
- }
- ++itStudy;
- }
- ++itPatient;
- }
-}
-
-
-/**
- * \ingroup gdcmDicomDir
- * \brief adds a new Patient to a partially created DICOMDIR
- */
-gdcmDicomDirPatient * gdcmDicomDir::NewPatient(void) {
- std::list<gdcmElement> elemList;
- std::list<gdcmElement>::iterator it;
- guint16 tmpGr,tmpEl;
- gdcmDictEntry *dictEntry;
- gdcmHeaderEntry *entry;
-
- elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirPatientElements();
- std::list<gdcmHeaderEntry *>::iterator debInsertion, finInsertion, i,j;
-
- debInsertion = metaElems->fin();
- ++debInsertion;
- finInsertion=debInsertion;
-
- // for all the DicomDirPatient Elements
- for(it=elemList.begin();it!=elemList.end();++it)
- {
- tmpGr=it->group;
- tmpEl=it->elem;
- dictEntry=GetPubDict()->GetDictEntryByNumber(tmpGr,tmpEl);
- entry=new gdcmHeaderEntry(dictEntry);
- entry->SetOffset(0); // just to avoid missprinting
- entry->SetValue(it->value);
-
- if(dictEntry->GetGroup()==0xfffe)
- {
- entry->SetLength(entry->GetValue().length());
- }
- else if( (dictEntry->GetVR()=="UL") || (dictEntry->GetVR()=="SL") )
- {
- entry->SetLength(4);
- }
- else if( (dictEntry->GetVR()=="US") || (dictEntry->GetVR()=="SS") )
- {
- entry->SetLength(2);
- }
- else if(dictEntry->GetVR()=="SQ")
- {
- entry->SetLength(0xffffffff);
- }
- else
- {
- entry->SetLength(entry->GetValue().length());
- }
-
- tagHT.insert( PairHT(entry->GetKey(),entry) ); // add in the (multimap) H Table
- listEntries.insert(debInsertion ,entry); // en tete de liste des Patients
- ++finInsertion;