GDCM  2.2.0
gdcmDICOMDIRGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMDICOMDIRGENERATOR_H
15 #define GDCMDICOMDIRGENERATOR_H
16 
17 #include "gdcmDirectory.h"
18 #include "gdcmTag.h"
19 #include <utility> // std::pair
20 
21 namespace gdcm
22 {
23 class File;
24 class Scanner;
25 class SequenceOfItems;
26 class VL;
27 class DICOMDIRGeneratorInternal;
28 
57 {
58 public:
63 
65  void SetFilenames( FilenamesType const & fns );
66 
68  void SetRootDirectory( FilenameType const & root );
69 
72  void SetDescriptor( const char *d );
73 
75  bool Generate();
76 
78  void SetFile(const File& f);
79  File &GetFile();
80 
81 protected:
82  Scanner &GetScanner();
83  bool AddPatientDirectoryRecord();
84  bool AddStudyDirectoryRecord();
85  bool AddSeriesDirectoryRecord();
86  bool AddImageDirectoryRecord();
87 
88 private:
89  const char *ComputeFileID(const char *);
90  bool TraverseDirectoryRecords(VL start );
91  bool ComputeDirectoryRecordsOffset(const SequenceOfItems *sqi, VL start);
92  unsigned int FindNextDirectoryRecord( unsigned int item1, const char *directorytype );
93  SequenceOfItems *GetDirectoryRecordSequence();
94  unsigned int FindLowerLevelDirectoryRecord( unsigned int item1, const char *directorytype );
95  typedef std::pair< std::string, Tag> MyPair;
96  MyPair GetReferenceValueForDirectoryType(unsigned int item);
97  bool SeriesBelongToStudy(const char *seriesuid, const char *studyuid);
98  bool ImageBelongToSeries(const char *sopuid, const char *seriesuid, Tag const &t1, Tag const &t2);
99  bool ImageBelongToSameSeries(const char *sopuid, const char *seriesuid, Tag const &t);
100 
101  DICOMDIRGeneratorInternal * Internals;
102 };
103 
109 } // end namespace gdcm
110 
111 #endif //GDCMDICOMDIRGENERATOR_H

Generated on Wed Jun 13 2012 20:40:37 for GDCM by doxygen 1.8.1
SourceForge.net Logo