X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmSerieHeader.h;h=3d5e5bb7f7045701c9efefbe920545d8b17c75d5;hb=7350639601914cd8ab02bfb0d6668c5bf56ce2f4;hp=fe95a31bb8876393f53caf8de9ddd91af0f235b1;hpb=ba78e6c6d47d6db1528e8e88e5ebde7296a26692;p=gdcm.git diff --git a/src/gdcmSerieHeader.h b/src/gdcmSerieHeader.h index fe95a31b..3d5e5bb7 100644 --- a/src/gdcmSerieHeader.h +++ b/src/gdcmSerieHeader.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmSerieHeader.h,v $ Language: C++ - Date: $Date: 2004/12/03 20:16:58 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/30 17:22:55 $ + Version: $Revision: 1.9 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -19,48 +19,54 @@ #ifndef GDCMSERIEHEADER_H #define GDCMSERIEHEADER_H -#include "gdcmCommon.h" +#include "gdcmCommon.h" #include - +#include namespace gdcm { -class Header; +class File; + //----------------------------------------------------------------------------- -/* - * \defgroup SerieHeader +/** * \brief - * * - This class should be used for a stack of 2D dicom images. - * - For a multiframe dicom image better use directly SerieHeader -*/ + * It allows to explore (recursively or not) a directory and + * makes a set of 'Coherent Files' list (coherent : same Serie UID) + * It allows to sort any of the Coherent File list on the image postion + */ class GDCM_EXPORT SerieHeader { public: + typedef std::list GdcmFileList; + typedef std::map CoherentFileListmap; + SerieHeader(); ~SerieHeader(); + void Print(); /// \todo should return bool or throw error ? - void AddFileName(std::string const & filename); - void AddGdcmFile(Header *file); - void SetDirectory(std::string const & dir); - void OrderGdcmFileList(); + void AddFileName(std::string const &filename); + void SetDirectory(std::string const &dir, bool recursive=false); + void OrderGdcmFileList(GdcmFileList *CoherentGdcmFileList); - /// \warning Assumes all elements in the list have the same global infos. - /// Assumes the list is not empty. - Header* GetGdcmHeader() { return CoherentGdcmFileList.front(); } - - typedef std::list GdcmHeaderList; - - /// \brief Gets the *coherent* File List - /// @return the *coherent* File List - const GdcmHeaderList& GetGdcmFileList() { return CoherentGdcmFileList; } + /// \brief Gets the FIRST *coherent* File List. + /// Deprecated; kept not to break the API + /// \note Caller must call OrderGdcmFileList first + /// @return the (first) *coherent* File List + const GdcmFileList &GetGdcmFileList() { return + *CoherentGdcmFileListHT.begin()->second; } + + GdcmFileList *GetFirstCoherentFileList(); + GdcmFileList *GetNextCoherentFileList(); + GdcmFileList *GetCoherentFileList(std::string SerieUID); private: - bool ImagePositionPatientOrdering(); - bool ImageNumberOrdering(); - bool FileNameOrdering(); + bool ImagePositionPatientOrdering(GdcmFileList *CoherentGdcmFileList); + bool ImageNumberOrdering(GdcmFileList *CoherentGdcmFileList); + bool FileNameOrdering(GdcmFileList *CoherentGdcmFileList); - GdcmHeaderList CoherentGdcmFileList; + CoherentFileListmap CoherentGdcmFileListHT; + CoherentFileListmap::iterator ItListHt; }; } // end namespace gdcm