gdcmDICOMDIRGenerator.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMDICOMDIRGENERATOR_H
#define GDCMDICOMDIRGENERATOR_H
#include "gdcmDirectory.h"
#include "gdcmTag.h"
#include <utility> // std::pair
namespace gdcm
{
class File;
class Scanner;
class SequenceOfItems;
class VL;
class DICOMDIRGeneratorInternal;
class GDCM_EXPORT DICOMDIRGenerator
{
public:
typedef Directory::FilenamesType FilenamesType;
typedef Directory::FilenameType FilenameType;
DICOMDIRGenerator();
~DICOMDIRGenerator();
void SetFilenames( FilenamesType const & fns );
void SetRootDirectory( FilenameType const & root );
void SetDescriptor( const char *d );
bool Generate();
void SetFile(const File& f);
File &GetFile();
protected:
Scanner &GetScanner();
bool AddPatientDirectoryRecord();
bool AddStudyDirectoryRecord();
bool AddSeriesDirectoryRecord();
bool AddImageDirectoryRecord();
private:
const char *ComputeFileID(const char *);
bool TraverseDirectoryRecords(VL start );
bool ComputeDirectoryRecordsOffset(const SequenceOfItems *sqi, VL start);
size_t FindNextDirectoryRecord( size_t item1, const char *directorytype );
SequenceOfItems *GetDirectoryRecordSequence();
size_t FindLowerLevelDirectoryRecord( size_t item1, const char *directorytype );
typedef std::pair< std::string, Tag> MyPair;
MyPair GetReferenceValueForDirectoryType(size_t item);
bool SeriesBelongToStudy(const char *seriesuid, const char *studyuid);
bool ImageBelongToSeries(const char *sopuid, const char *seriesuid, Tag const &t1, Tag const &t2);
bool ImageBelongToSameSeries(const char *sopuid, const char *seriesuid, Tag const &t);
DICOMDIRGeneratorInternal * Internals;
};
} // end namespace gdcm
#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