Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2004/08/27 15:48:44 $
- Version: $Revision: 1.65 $
+ Date: $Date: 2004/08/30 16:15:40 $
+ Version: $Revision: 1.66 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
:gdcmDocument( )
{
Initialize(); // sets all private fields to NULL
-
- std::string pathBidon = "Bidon"; // Sorry, NULL not allowed ...
- SetElement(pathBidon, GDCM_DICOMDIR_META, NULL); // Set the META elements
- AddDicomDirMeta();
+ std::string pathBidon = "Bidon"; // Sorry, NULL not allowed ...
+ metaElems = NewMeta();
}
/**
bool gdcmDicomDir::Write(std::string const & fileName)
{
- uint16_t sq[5] = { 0x0004, 0x1220, 0x0000, 0xffff, 0xffff };
+ uint16_t sq[4] = { 0x0004, 0x1220, 0xffff, 0xffff };
uint16_t sqt[4]= { 0xfffe, 0xe0dd, 0xffff, 0xffff };
FILE * fp = fopen(fileName.c_str(), "wb");
ptrMeta->Write(fp, gdcmExplicitVR);
// force writing 0004|1220 [SQ ], that CANNOT exist within gdcmDicomDirMeta
- fwrite(&sq[0],4,1,fp); // 0004 1220
- //fwrite("SQ" ,2,1,fp); // SQ // VR no written for 'No length' Sequences !
- //fwrite(&sq[2],6,1,fp); // 00 ffffffff
- fwrite(&sq[3],4,1,fp); // ffffffff
+ fwrite(&sq[0],8,1,fp); // 0004 1220 ffff ffff
for(ListDicomDirPatient::iterator cc = patients.begin();cc!=patients.end();++cc)
{
"failure in new Header ",
it->c_str() );
}
+
if( header->IsReadable() )
{
// Add the file header to the chained list:
dbg.Verbose( 1,
"gdcmDicomDir::CreateDicomDirChainedList: readable ",
it->c_str() );
+
}
else
{
}
count++;
}
-
// sorts Patient/Study/Serie/
std::sort(list.begin(), list.end(), gdcmDicomDir::HeaderLessThan );
-
std::string tmp = fileList.GetDirName();
//for each Header of the chained list, add/update the Patient/Study/Serie/Image info
- SetElements(tmp, list);
+ SetElements(tmp, list);
CallEndMethod();
}
}
else // after root directory parsing
{
- //cout << "gdcmDicomDir::NewMeta avec FillObject" << endl;
std::list<gdcmElement> elemList;
elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirMetaElements();
m->FillObject(elemList);
- // we create the Sequence manually
- //gdcmSeqEntry *se =NewSeqEntryByNumber(0x0004, 0x1220); // NOT YET!
- //m->AddEntry(se);
}
m->SetSQItemNumber(0); // To avoid further missprinting
return m;
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
case GDCM_DICOMDIR_META:
elemList = gdcmGlobal::GetDicomDirElements()->GetDicomDirMetaElements();
- // add already done ?
break;
default:
if ( type == GDCM_DICOMDIR_META ) // fusible : should never print !
{
- std::cout << " special Treatment for GDCM_DICOMDIR_META" << std::endl;
- entry->Print(); // just to see
+ std::cout << "GDCM_DICOMDIR_META ?!? should never print that"
+ << std::endl;
}
si->AddEntry(entry);
}
*/
bool gdcmDicomDir::HeaderLessThan(gdcmDocument *header1, gdcmDocument *header2)
{
+
+std::cout <<header1->GetFileName() << " " << header2->GetFileName() <<std::endl;
return *header1 < *header2;
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2004/08/27 15:48:44 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2004/08/30 16:15:40 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
// Print
/**
- * \brief Prints the Object
+ * \brief Prints the Meta Elements
*/
void gdcmDicomDirMeta::Print(std::ostream &os)
{
os << "META" << std::endl;
- //gdcmObject::Print(os);
+ // warning : META doesn't behave exactly like a gdcmObjet
for (ListDocEntry::iterator i = docEntries.begin();
i != docEntries.end();
++i)