Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/01/17 10:59:52 $
- Version: $Revision: 1.103 $
+ Date: $Date: 2005/01/19 08:57:14 $
+ Version: $Revision: 1.106 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Constructor / Destructor
/**
- * \ingroup DicomDir
* \brief Constructor : creates an empty DicomDir
*/
DicomDir::DicomDir()
/**
- * \ingroup DicomDir
* \brief fills the whole structure, starting from a root Directory
*/
void DicomDir::ParseDirectory()
}
/**
- * \ingroup DicomDir
* \brief Set the start method to call when the parsing of the
* directory starts.
* @param method Method to call
}
/**
- * \ingroup DicomDir
* \brief Set the method to delete the argument
* The argument is destroyed when the method is changed or when the
* class is destroyed
}
/**
- * \ingroup DicomDir
* \brief Set the progress method to call when the parsing of the
* directory progress
* @param method Method to call
}
/**
- * \ingroup DicomDir
* \brief Set the method to delete the argument
* The argument is destroyed when the method is changed or when the
* class is destroyed
}
/**
- * \ingroup DicomDir
* \brief Set the end method to call when the parsing of the directory ends
* @param method Method to call
* @param arg Argument to pass to the method
}
/**
- * \ingroup DicomDir
* \brief Set the method to delete the argument
* The argument is destroyed when the method is changed or when
* the class is destroyed
}
/**
- * \ingroup DicomDir
* \brief writes on disc a DICOMDIR
* \ warning does NOT add the missing elements in the header :
* it's up to the user doing it !
// Protected
/**
- * \ingroup DicomDir
* \brief create a Document-like chained list from a root Directory
* @param path entry point of the tree-like structure
*/
}
/**
- * \ingroup DicomDir
* \brief adds *the* Meta to a partially created DICOMDIR
*/
//-----------------------------------------------------------------------------
/**
- * \ingroup DicomDir
* \brief CallProgressMethod
*/
void DicomDir::CallProgressMethod()
//-----------------------------------------------------------------------------
/**
- * \ingroup DicomDir
* \brief CallEndMethod
*/
void DicomDir::CallEndMethod()
//-----------------------------------------------------------------------------
// Private
/**
- * \ingroup DicomDir
* \brief create a 'DicomDir' from a DICOMDIR Header
*/
void DicomDir::CreateDicomDir()
}
/**
- * \ingroup DicomDir
* \brief Well ... there is only one occurence
*/
bool DicomDir::AddDicomDirMeta()
}
/**
- * \ingroup DicomDir
* \brief AddDicomDirPatientToEnd
* @param dd SQ Item to enqueue to the DicomPatient chained List
*/
}
/**
- * \ingroup DicomDir
* \brief AddDicomDirStudyToEnd
* @param dd SQ Item to enqueue to the DicomDirStudy chained List
*/
}
/**
- * \ingroup DicomDir
* \brief AddDicomDirSerieToEnd
* @param dd SQ Item to enqueue to the DicomDirSerie chained List
*/
}
/**
- * \ingroup DicomDir
* \brief AddDicomDirImageToEnd
* @param dd SQ Item to enqueue to the DicomDirImage chained List
*/
}
/**
- * \ingroup DicomDir
* \brief for each Header of the chained list, add/update the Patient/Study/Serie/Image info
* @param path path of the root directory
* @param list chained list of Headers
}
/**
- * \ingroup DicomDir
- * \brief Move the content of the src SQItem to the dst SQItem
+ * \brief Move the content of the source SQItem to the destination SQItem
* Only DocEntry's are moved
- *
+ * @param dst destination SQItem
+ * @param src source SQItem
*/
void DicomDir::MoveSQItem(SQItem *dst,SQItem *src)
{
DocEntry *entry;
- src->Initialize();
- entry = src->GetNextEntry();
+ entry = src->GetFirstEntry();
while(entry)
{
src->RemoveEntryNoDestroy(entry);
dst->AddEntry(entry);
-
- src->Initialize();
entry = src->GetNextEntry();
}
}
/**
- * \ingroup DicomDir
* \brief compares two dgcmHeaders
*/
bool DicomDir::HeaderLessThan(Document *header1, Document *header2)
return *header1 < *header2;
}
+
/**
- * \brief Initialise the visit of the DicomDirPatients of the DicomDir
- */
-void DicomDir::InitTraversal()
+ * \brief Get the first entry while visiting the DicomDirPatients
+ * \return The first DicomDirPatient if found, otherwhise NULL
+ */
+DicomDirPatient *DicomDir::GetFirstEntry()
{
ItDicomDirPatient = Patients.begin();
+ if ( ItDicomDirPatient != Patients.end() )
+ return *ItDicomDirPatient;
+ return NULL;
}
/**
* \brief Get the next entry while visiting the DicomDirPatients
+ * \note : meaningfull only if GetFirstEntry already called
* \return The next DicomDirPatient if found, otherwhise NULL
*/
DicomDirPatient *DicomDir::GetNextEntry()
{
- if (ItDicomDirPatient != Patients.end())
+ gdcmAssertMacro (ItDicomDirPatient != Patients.end());
{
- DicomDirPatient *tmp = *ItDicomDirPatient;
++ItDicomDirPatient;
- return tmp;
- }
- else
- {
- return NULL;
+ if ( ItDicomDirPatient != Patients.end() )
+ return *ItDicomDirPatient;
}
+ return NULL;
}