-}
-
-/**
- * \ingroup gdcmDicomDir
- * \brief adds *the* Meta to a partially created DICOMDIR
- */
-
- /// \todo FIXME : Heuuuuu ! Il prend les Entries du Document deja parse,
- /// il ne fabrique rien !
-
-gdcmDicomDirMeta * gdcmDicomDir::NewMeta()
-{
- gdcmDicomDirMeta *m = new gdcmDicomDirMeta( &TagHT );
- for ( TagDocEntryHT::iterator cc = TagHT.begin();
- cc != TagHT.end(); ++cc)
- {
- m->AddDocEntry( cc->second );
- }
- return m;
-}
-
-
-/**
- * \brief adds a new Patient (with the basic elements) to a partially created DICOMDIR
- */
-gdcmDicomDirPatient * gdcmDicomDir::NewPatient()
-{
- std::list<gdcmElement>::iterator it;
- uint16_t tmpGr,tmpEl;
- gdcmDictEntry *dictEntry;
- gdcmValEntry *entry;
-
- std::list<gdcmElement> elemList;
- elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirPatientElements();
-// Looks nice, but gdcmDicomDir IS NOT a gdcmObject ...
-// gdcmDicomDirPatient *p = new gdcmDicomDirPatient(ptagHT);
-// FillObject(elemList);
-// patients.push_front( p );
-// return p;
-/// \todo TODO : find a trick to use FillObject !!!
-
- gdcmSQItem *s = new gdcmSQItem(0);
-
- // 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 gdcmValEntry( dictEntry );
- entry->SetOffset(0); // just to avoid further missprinting
- entry->SetValue( it->value );
-
- // dealing with value length ...
-
- 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() );
- }
- s->AddDocEntry( entry );
- }
-
- gdcmDicomDirPatient *p = new gdcmDicomDirPatient(s, &TagHT);
- patients.push_front( p );
-
- return p;
-}
-
-/**
- * \brief adds to the HTable
- * the gdcmEntries (Dicom Elements) corresponding to the given type
- * @param path full path file name (only used when type = GDCM_DICOMDIR_IMAGE
- * @param type gdcmObject type to create (GDCM_DICOMDIR_PATIENT,
- * GDCM_DICOMDIR_STUDY, GDCM_DICOMDIR_SERIE ...)
- * @param header gdcmHeader of the current file
- */
-void gdcmDicomDir::SetElement(std::string &path,gdcmDicomDirType type,
- gdcmDocument *header)
-{
- std::list<gdcmElement> elemList;
- std::list<gdcmElement>::iterator it;
- uint16_t tmpGr, tmpEl;
- gdcmDictEntry *dictEntry;
- gdcmValEntry *entry;
- std::string val;
- //gdcmObject *o;
- switch( type )
- {
- case GDCM_DICOMDIR_IMAGE:
- elemList = gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements();
- break;
-
- case GDCM_DICOMDIR_SERIE:
- elemList = gdcmGlobal::GetDicomDirElements()->GetDicomDirSerieElements();
- break;
-
- case GDCM_DICOMDIR_STUDY:
- elemList = gdcmGlobal::GetDicomDirElements()->GetDicomDirStudyElements();
- break;
-
- case GDCM_DICOMDIR_PATIENT:
- elemList = gdcmGlobal::GetDicomDirElements()->GetDicomDirPatientElements();
- break;
-
- case GDCM_DICOMDIR_META:
- elemList = gdcmGlobal::GetDicomDirElements()->GetDicomDirMetaElements();
- break;