]> Creatis software - gdcm.git/blob - src/gdcmHeaderHelper.h
1540a1293675127992846115416e9ee3da5a4f4d
[gdcm.git] / src / gdcmHeaderHelper.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmHeaderHelper.h,v $
5   Language:  C++
6   Date:      $Date: 2004/09/27 08:39:07 $
7   Version:   $Revision: 1.21 $
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.html 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    /// \todo should return bool or throw error ?
39    void AddFileName(std::string const & filename);
40    void AddGdcmFile(gdcmHeader *file);
41    void SetDirectory(std::string const & dir);
42    void OrderGdcmFileList();
43    
44    /// \warning Assumes all elements in the list have the same global infos.
45    ///          Assumes the list is not empty.
46    gdcmHeader* GetGdcmHeader() { return CoherentGdcmFileList.front(); }
47
48    typedef std::list<gdcmHeader* > GdcmHeaderList;
49
50    /// \brief Gets the *coherent* File List
51    /// @return the *coherent* File List
52    const GdcmHeaderList& GetGdcmFileList() { return CoherentGdcmFileList; }
53
54 private:
55    bool ImagePositionPatientOrdering();
56    bool ImageNumberOrdering();
57    bool FileNameOrdering();
58    
59    GdcmHeaderList CoherentGdcmFileList;
60 };
61
62 //-----------------------------------------------------------------------------
63 #endif