*/
gdcmDicomDir::~gdcmDicomDir()
{
+ delete metaelems;
+
for(ListPatient::iterator cc=patients.begin();cc!=patients.end();++cc)
{
delete *cc;
*/
void gdcmDicomDir::Print(std::ostream &os)
{
+ (*metaelems).SetPrintLevel(printLevel);
+ (*metaelems).Print(os);
+
for(ListPatient::iterator cc=patients.begin();cc!=patients.end();++cc)
{
(*cc)->SetPrintLevel(printLevel);
// Protected
/*
* \ingroup gdcmDicomDir
- * \brief
+ * \brief create a gdcmDicomDir from a root Directory
* @param path entry point of the stree-like structure
*/
void gdcmDicomDir::NewDicomDir(std::string path)
std::sort(list.begin(),list.end(),gdcmDicomDir::HeaderLessThan);
- SetElements(path,list);
+ std::string tmp=fileList.GetDirName();
+ SetElements(tmp,list);
}
/*
* \ingroup gdcmDicomDir
- * \brief Get the dicom dir path
+ * \brief Get the DicomDir path
* @param
*/
std::string gdcmDicomDir::GetPath(void)
// Private
/*
* \ingroup gdcmDicomDir
- * \brief
- * @param
+ * \brief create a 'gdcmDicomDir' from a DICOMDIR gdcmHeader
*/
void gdcmDicomDir::CreateDicomDir()
{
gdcmDicomDirType type=gdcmDicomDir::GDCM_NONE;
ListTag::iterator begin;
ListTag::iterator end;
+ ListTag::iterator k;
begin=listEntries.begin();
end=begin;
- for(ListTag::iterator i=listEntries.begin();i !=listEntries.end();++i)
+
+ for(ListTag::iterator j=begin;j !=listEntries.end();++j)
+ {
+ if((*j)->GetValue()=="PATIENT ") {
+ k = j;
+ break;
+ }
+ }
+ AddObjectToEnd(gdcmDicomDir::GDCM_META,begin,k);
+
+ for(ListTag::iterator i=k;i !=listEntries.end();++i)
{
std::string v=(*i)->GetValue();
if(v=="PATIENT ")
switch(type)
{
+ case gdcmDicomDir::GDCM_META:
+ AddMetaToEnd(begin,end);
+ break;
case gdcmDicomDir::GDCM_PATIENT:
AddPatientToEnd(begin,end);
break;
}
}
+
+/*
+ * \ingroup gdcmDicomDir
+ * \brief Well ... Not realy to end, there is only one occurence
+ * @param begin
+ * @param end
+*/
+void gdcmDicomDir::AddMetaToEnd(ListTag::iterator begin,ListTag::iterator end)
+{
+ metaelems = new gdcmMeta(begin,end);
+}
+
/*
* \ingroup gdcmDicomDir
* \brief
// if new Serie Deal with 'SERIE' Elements
if(serCurInstanceUID!=serPrevInstanceUID || serCurID!=serPrevID)
- {
SetElement(path,GDCM_SERIE,*it);
- }
// Always Deal with 'IMAGE' Elements
SetElement(path,GDCM_IMAGE,*it);