GDCM  2.2.0
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 /* this class is designed to help mitigate some of the commonly performed operations on directories.
16 namely:
17 1) the ability to determine the number of series in a directory by what type of series is present
18 2) the ability to find all ct series in a directory
19 3) the ability to find all mr series in a directory
20 4) to load a set of DataSets from a series that's already been sorted by the IPP sorter
21 5) For rtstruct stuff, you need to know the sopinstanceuid of each z plane,
22  so there's a retrieval function for that
23 6) then a few other functions for rtstruct writeouts
24 */
25 
26 #include "gdcmDirectory.h"
27 #include "gdcmDataSet.h"
28 
29 namespace gdcm
30 {
32 {
33 public:
34  //returns all series UIDs in a given directory that match a particular SOP Instance UID
35  static Directory::FilenamesType GetSeriesUIDsBySOPClassUID(const std::string& inDirectory,
36  const std::string& inSOPClassUID);
37 
38  //specific implementations of the SOPClassUID grabber, so you don't have to
39  //remember the SOP Class UIDs of CT or MR images.
40  static Directory::FilenamesType GetCTImageSeriesUIDs(const std::string& inDirectory);
41  static Directory::FilenamesType GetMRImageSeriesUIDs(const std::string& inDirectory);
42  static Directory::FilenamesType GetRTStructSeriesUIDs(const std::string& inDirectory);
43 
44  //given a directory and a series UID, provide all filenames with that series UID.
45  static Directory::FilenamesType GetFilenamesFromSeriesUIDs(const std::string& inDirectory,
46  const std::string& inSeriesUID);
47 
48  //given a series UID, load all the images associated with that series UID
49  //these images will be IPP sorted, so that they can be used for gathering all
50  //the necessary information for generating an RTStruct
51  //this function should be called by the writer once, if the writer's dataset
52  //vector is empty. Make sure to have a new writer for new rtstructs.
53  static std::vector<DataSet> LoadImageFromFiles(const std::string& inDirectory,
54  const std::string& inSeriesUID);
55 
56  //When writing RTStructs, each contour will have z position defined.
57  //use that z position to determine the SOPInstanceUID for that plane.
58  static std::string RetrieveSOPInstanceUIDFromZPosition(double inZPos,
59  const std::vector<DataSet>& inDS);
60 
61  //When writing RTStructs, the frame of reference is done by planes to start with
62  static std::string RetrieveSOPInstanceUIDFromIndex(int inIndex,
63  const std::vector<DataSet>& inDS);
64 
65  //each plane needs to know the SOPClassUID, and that won't change from image to image
66  //so, retrieve this once at the start of writing.
67  static std::string GetSOPClassUID(const std::vector<DataSet>& inDS);
68 
69  //retrieve the frame of reference from the set of datasets
70  static std::string GetFrameOfReference(const std::vector<DataSet>& inDS);
71 };
72 
73 }

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