]> Creatis software - gdcm.git/blob - src/gdcmHeaderHelper.h
Fix warnings, and fix TestWriteRead
[gdcm.git] / src / gdcmHeaderHelper.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmHeaderHelper.h,v $
5   Language:  C++
6   Date:      $Date: 2004/06/25 20:48:25 $
7   Version:   $Revision: 1.19 $
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 {
34 public:
35     gdcmSerieHeader();
36     ~gdcmSerieHeader();
37
38    void AddFileName(std::string const & filename); //should return bool or throw error ?
39    void AddGdcmFile(gdcmHeader *file);
40    void SetDirectory(std::string const & dir);
41    void OrderGdcmFileList();
42    
43    inline gdcmHeader *GetGdcmHeader()
44    {
45       // Assume all element in the list have the same global infos
46       // Assume the list is not empty
47       return CoherentGdcmFileList.front();
48    }
49
50    typedef std::list<gdcmHeader* > GdcmHeaderList;
51    /**
52     * \brief Gets the *coherent* File List
53     * @return the *coherent* File List
54     */
55    const GdcmHeaderList& GetGdcmFileList()
56    {
57      return CoherentGdcmFileList;
58    }
59
60 private:
61    bool ImagePositionPatientOrdering();
62    bool ImageNumberOrdering();
63    bool FileNameOrdering();
64    
65    GdcmHeaderList CoherentGdcmFileList;
66 };
67
68 //-----------------------------------------------------------------------------
69 #endif