]> Creatis software - gdcm.git/blob - src/gdcmHeaderHelper.h
* Test/PrintAllDocument.cxx: looping on files is now effective. It used to
[gdcm.git] / src / gdcmHeaderHelper.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmHeaderHelper.h,v $
5   Language:  C++
6   Date:      $Date: 2004/06/21 21:51:01 $
7   Version:   $Revision: 1.18 $
8                                                                                 
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.htm for details.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMHEADERHELPER_H
20 #define GDCMHEADERHELPER_H
21
22 #include "gdcmHeader.h"
23
24 //-----------------------------------------------------------------------------
25 /*
26  * \defgroup gdcmSerieHeader
27  * \brief  
28  *
29  * - This class should be used for a stack of 2D dicom images.
30  * - For a multiframe dicom image better use directly gdcmHeaderHelper
31 */
32 class GDCM_EXPORT gdcmSerieHeader {
33 public:
34     gdcmSerieHeader() {};
35     ~gdcmSerieHeader();
36
37    void AddFileName(std::string filename); //should return bool or throw error ?
38    void AddGdcmFile(gdcmHeader *file);
39    void SetDirectory(std::string dir);
40    void OrderGdcmFileList();
41    
42    inline gdcmHeader *GetGdcmHeader()
43    {
44       //Assume all element in the list have the same global infos
45       return CoherentGdcmFileList.front();
46    }
47    
48    std::list<gdcmHeader*>& GetGdcmFileList();
49
50 private:
51    bool ImagePositionPatientOrdering();
52    bool ImageNumberOrdering();
53    bool FileNameOrdering();
54    
55    std::list<gdcmHeader*> CoherentGdcmFileList;
56 };
57
58 //-----------------------------------------------------------------------------
59 #endif