X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmSerieHeader.h;h=3d5e5bb7f7045701c9efefbe920545d8b17c75d5;hb=ff8631dd8488e6604df635faf472ee85f5b8a4b6;hp=b6a8a76da083d6e308a6452055b68c6027611e10;hpb=fccdf8e6409f9cf8c2a66a658dcfdfb7a332cbb9;p=gdcm.git diff --git a/src/gdcmSerieHeader.h b/src/gdcmSerieHeader.h index b6a8a76d..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: 2005/01/14 21:30:53 $ - Version: $Revision: 1.6 $ + 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,46 +19,54 @@ #ifndef GDCMSERIEHEADER_H #define GDCMSERIEHEADER_H -#include "gdcmCommon.h" +#include "gdcmCommon.h" #include - +#include namespace gdcm { -class Header; +class File; + //----------------------------------------------------------------------------- /** - * \ingroup 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 GdcmHeaderList; + 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 SetDirectory(std::string const &dir); - void OrderGdcmFileList(); + void SetDirectory(std::string const &dir, bool recursive=false); + void OrderGdcmFileList(GdcmFileList *CoherentGdcmFileList); - /// \brief Gets the *coherent* File List - /// @return the *coherent* File List - /// Caller must call OrderGdcmFileList first - 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; - /// Ref to the current Serie Instance UID to avoid mixing two series - /// within the same directory - std::string CurrentSerieUID; + CoherentFileListmap CoherentGdcmFileListHT; + CoherentFileListmap::iterator ItListHt; }; } // end namespace gdcm