GDCM 3.2.1

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
56 class GDCM_EXPORT DICOMDIRGenerator
57{
58 public:
59 typedef Directory::FilenamesType FilenamesType;
60 typedef Directory::FilenameType FilenameType;
61 DICOMDIRGenerator();
62 ~DICOMDIRGenerator();
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 size_t FindNextDirectoryRecord( size_t item1, const char *directorytype );
93 SequenceOfItems *GetDirectoryRecordSequence();
94 size_t FindLowerLevelDirectoryRecord( size_t item1, const char *directorytype );
95 typedef std::pair< std::string, Tag> MyPair;
96 MyPair GetReferenceValueForDirectoryType(size_t 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
108
109} // end namespace gdcm
110
111#endif //GDCMDICOMDIRGENERATOR_H
gdcm::DICOMDIRGenerator::FilenamesType
Directory::FilenamesType FilenamesType
Definition gdcmDICOMDIRGenerator.h:59
gdcm::DICOMDIRGenerator::Generate
bool Generate()
Main function to generate the DICOMDIR.
gdcm::DICOMDIRGenerator::AddStudyDirectoryRecord
bool AddStudyDirectoryRecord()
gdcm::DICOMDIRGenerator::SetRootDirectory
void SetRootDirectory(FilenameType const &root)
Set the root directory from which the filenames should be considered.
gdcm::DICOMDIRGenerator::SetFile
void SetFile(const File &f)
Set/Get file. The DICOMDIR file will be valid once a call to Generate has been done.
gdcm::DICOMDIRGenerator::DICOMDIRGenerator
DICOMDIRGenerator()
gdcm::DICOMDIRGenerator::SetDescriptor
void SetDescriptor(const char *d)
gdcm::DICOMDIRGenerator::AddImageDirectoryRecord
bool AddImageDirectoryRecord()
gdcm::DICOMDIRGenerator::SetFilenames
void SetFilenames(FilenamesType const &fns)
Set the list of filenames from which the DICOMDIR should be generated from.
gdcm::DICOMDIRGenerator::~DICOMDIRGenerator
~DICOMDIRGenerator()
gdcm::DICOMDIRGenerator::GetFile
File & GetFile()
gdcm::DICOMDIRGenerator::AddPatientDirectoryRecord
bool AddPatientDirectoryRecord()
gdcm::DICOMDIRGenerator::GetScanner
Scanner & GetScanner()
gdcm::DICOMDIRGenerator::AddSeriesDirectoryRecord
bool AddSeriesDirectoryRecord()
gdcm::DICOMDIRGenerator::FilenameType
Directory::FilenameType FilenameType
Definition gdcmDICOMDIRGenerator.h:60
gdcm::Directory::FilenamesType
std::vector< FilenameType > FilenamesType
Definition gdcmDirectory.h:49
gdcm::Directory::FilenameType
std::string FilenameType
Definition gdcmDirectory.h:48
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::Scanner
Scanner.
Definition gdcmScanner.h:56
gdcm::SequenceOfItems
Class to represent a Sequence Of Items.
Definition gdcmSequenceOfItems.h:40
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcm::VL
Value Length.
Definition gdcmVL.h:30
gdcmDirectory.h
gdcmTag.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21