1 /*=========================================================================
4 Module: $RCSfile: gdcmSerieHelper.h,v $
6 Date: $Date: 2005/02/02 16:16:07 $
7 Version: $Revision: 1.2 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef GDCMSERIEHELPER_H
20 #define GDCMSERIEHELPER_H
22 #include "gdcmCommon.h"
30 typedef std::list<File* > GdcmFileList;
32 //-----------------------------------------------------------------------------
35 * - This class should be used for a stack of 2D dicom images.
36 * It allows to explore (recursively or not) a directory and
37 * makes a set of 'Coherent Files' list (coherent : same Serie UID)
38 * It allows to sort any of the Coherent File list on the image postion
40 class GDCM_EXPORT SerieHelper
43 typedef std::map<std::string, GdcmFileList *> CoherentFileListmap;
44 typedef std::vector<File* > GdcmFileVector;
50 /// \todo should return bool or throw error ?
51 void AddFileName(std::string const &filename);
52 void SetDirectory(std::string const &dir, bool recursive=false);
53 void OrderGdcmFileList(GdcmFileList *CoherentGdcmFileList);
55 /// \brief Gets the FIRST *coherent* File List.
56 /// Deprecated; kept not to break the API
57 /// \note Caller must call OrderGdcmFileList first
58 /// @return the (first) *coherent* File List
59 const GdcmFileList &GetGdcmFileList() { return
60 *CoherentGdcmFileListHT.begin()->second; }
62 GdcmFileList *GetFirstCoherentFileList();
63 GdcmFileList *GetNextCoherentFileList();
64 GdcmFileList *GetCoherentFileList(std::string SerieUID);
67 bool ImagePositionPatientOrdering(GdcmFileList *CoherentGdcmFileList);
68 bool ImageNumberOrdering(GdcmFileList *CoherentGdcmFileList);
69 bool FileNameOrdering(GdcmFileList *CoherentGdcmFileList);
71 CoherentFileListmap CoherentGdcmFileListHT;
72 CoherentFileListmap::iterator ItListHt;
75 } // end namespace gdcm
77 //-----------------------------------------------------------------------------