GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmDirectoryHelper.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
15 #include "gdcmDirectory.h"
16 #include "gdcmDataSet.h"
17
18 namespace gdcm
19 {
20
35 class GDCM_EXPORT DirectoryHelper
36 {
37 public:
38 //returns all series UIDs in a given directory that match a particular SOP Instance UID
39 static Directory::FilenamesType GetSeriesUIDsBySOPClassUID(const std::string& inDirectory,
40 const std::string& inSOPClassUID);
41
42 //specific implementations of the SOPClassUID grabber, so you don't have to
43 //remember the SOP Class UIDs of CT or MR images.
44 static Directory::FilenamesType GetCTImageSeriesUIDs(const std::string& inDirectory);
45 static Directory::FilenamesType GetMRImageSeriesUIDs(const std::string& inDirectory);
46 static Directory::FilenamesType GetRTStructSeriesUIDs(const std::string& inDirectory);
47
48 //given a directory and a series UID, provide all filenames with that series UID.
49 static Directory::FilenamesType GetFilenamesFromSeriesUIDs(const std::string& inDirectory,
50 const std::string& inSeriesUID);
51
52 //given a series UID, load all the images associated with that series UID
53 //these images will be IPP sorted, so that they can be used for gathering all
54 //the necessary information for generating an RTStruct
55 //this function should be called by the writer once, if the writer's dataset
56 //vector is empty. Make sure to have a new writer for new rtstructs.
57 static std::vector<DataSet> LoadImageFromFiles(const std::string& inDirectory,
58 const std::string& inSeriesUID);
59
60 //When writing RTStructs, each contour will have z position defined.
61 //use that z position to determine the SOPInstanceUID for that plane.
62 static std::string RetrieveSOPInstanceUIDFromZPosition(double inZPos,
63 const std::vector<DataSet>& inDS);
64
65 //When writing RTStructs, the frame of reference is done by planes to start with
66 static std::string RetrieveSOPInstanceUIDFromIndex(int inIndex,
67 const std::vector<DataSet>& inDS);
68
69 //each plane needs to know the SOPClassUID, and that won't change from image to image
70 //so, retrieve this once at the start of writing.
71 static std::string GetSOPClassUID(const std::vector<DataSet>& inDS);
72
73 //retrieve the frame of reference from the set of datasets
74 static std::string GetFrameOfReference(const std::vector<DataSet>& inDS);
75
76 //both the image and polydata readers use these functions to get std::strings
77 static std::string GetStringValueFromTag(const gdcm::Tag& t, const gdcm::DataSet& ds);
78 };
79
80 }