Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMDICOMDIRGENERATOR_H
00016 #define GDCMDICOMDIRGENERATOR_H
00017
00018 #include "gdcmDirectory.h"
00019 #include "gdcmTag.h"
00020 #include <utility>
00021
00022 namespace gdcm
00023 {
00024 class File;
00025 class Scanner;
00026 class SequenceOfItems;
00027 class VL;
00028 class DICOMDIRGeneratorInternal;
00029
00057 class GDCM_EXPORT DICOMDIRGenerator
00058 {
00059 public:
00060 typedef Directory::FilenamesType FilenamesType;
00061 typedef Directory::FilenameType FilenameType;
00062 DICOMDIRGenerator();
00063 ~DICOMDIRGenerator();
00064
00066 void SetFilenames( FilenamesType const & fns );
00067
00069 void SetRootDirectory( FilenameType const & root );
00070
00073 void SetDescriptor( const char *d );
00074
00076 bool Generate();
00077
00079 void SetFile(const File& f);
00080 File &GetFile();
00081
00082 protected:
00083 Scanner &GetScanner();
00084 bool AddPatientDirectoryRecord();
00085 bool AddStudyDirectoryRecord();
00086 bool AddSeriesDirectoryRecord();
00087 bool AddImageDirectoryRecord();
00088
00089 private:
00090 const char *ComputeFileID(const char *);
00091 bool TraverseDirectoryRecords(VL start );
00092 bool ComputeDirectoryRecordsOffset(const SequenceOfItems *sqi, VL start);
00093 unsigned int FindNextDirectoryRecord( unsigned int item1, const char *directorytype );
00094 SequenceOfItems *GetDirectoryRecordSequence();
00095 unsigned int FindLowerLevelDirectoryRecord( unsigned int item1, const char *directorytype );
00096 typedef std::pair< std::string, Tag> MyPair;
00097 MyPair GetReferenceValueForDirectoryType(unsigned int item);
00098 bool SeriesBelongToStudy(const char *seriesuid, const char *studyuid);
00099 bool ImageBelongToSeries(const char *sopuid, const char *seriesuid, Tag const &t1, Tag const &t2);
00100 bool ImageBelongToSameSeries(const char *sopuid, const char *seriesuid, Tag const &t);
00101
00102 DICOMDIRGeneratorInternal * Internals;
00103 };
00104
00110 }
00111
00112 #endif //GDCMDICOMDIRGENERATOR_H