GDCM  2.2.1
gdcmMediaStorage.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 GDCMMEDIASTORAGE_H
15 #define GDCMMEDIASTORAGE_H
16 
17 #include "gdcmTransferSyntax.h"
18 
19 namespace gdcm
20 {
21 
22 class DataSet;
23 class Tag;
24 class FileMetaInformation;
25 class File;
26 
27 // WARNING: This class will be deprecated in the future. There is no reason to extend this class.
28 // Please check the gdcm::UIDs class if adding new well known UID.
29 
42 {
43 public:
44  typedef enum {
45  MediaStorageDirectoryStorage = 0,
113  SegmentationStorage, // "1.2.840.10008.5.1.4.1.1.66.4"
114  RTIonPlanStorage, // 1.2.840.10008.5.1.4.1.1.481.8
115  XRay3DAngiographicImageStorage, // 1.2.840.10008.5.1.4.1.1.13.1.1
117  RTIonBeamsTreatmentRecordStorage, // 1.2.840.10008.5.1.4.1.1.481.9
118  SurfaceSegmentationStorage, // "1.2.840.10008.5.1.4.1.1.66.5"
119  VLWholeSlideMicroscopyImageStorage, // 1.2.840.10008.5.1.4.1.1.77.1.6
120  RTTreatmentSummaryRecordStorage, // 1.2.840.10008.5.1.4.1.1.481.7
121  EnhancedUSVolumeStorage, // 1.2.840.10008.5.1.4.1.1.6.2
122  MS_END
123  } MSType; // Media Storage Type
124 
125 typedef enum {
126  NoObject = 0, // DICOMDIR
127  Video, // Most common, include image, video and volume
128  Waveform, // Isn't it simply a 1D video ?
129  Audio, // ???
131  URI, // URL...
132  Segmentation, // TODO
133  ObjectEnd
134  } ObjectType;
135 
137  static const char* GetMSString(MSType ts);
138 
140  const char* GetString() const;
141  static MSType GetMSType(const char *str);
142 
143  MediaStorage(MSType type = MS_END):MSField(type) {}
144 
147  static bool IsImage(MSType ts);
148 
149  operator MSType () const { return MSField; }
150 
151  const char *GetModality() const;
152  unsigned int GetModalityDimension() const;
153 
154  static unsigned int GetNumberOfMSType();
155  static unsigned int GetNumberOfMSString();
156  static unsigned int GetNumberOfModality();
157 
158 
163  bool SetFromFile(File const &file);
164 
167  bool SetFromDataSet(DataSet const &ds); // Will get the SOP Class UID
168  bool SetFromHeader(FileMetaInformation const &fmi); // Will get the Media Storage SOP Class UID
169  bool SetFromModality(DataSet const &ds);
170  void GuessFromModality(const char *modality, unsigned int dimension = 2);
171 
172  friend std::ostream &operator<<(std::ostream &os, const MediaStorage &ms);
173 
174  bool IsUndefined() const { return MSField == MS_END; }
175 
176 protected:
177  void SetFromSourceImageSequence(DataSet const &ds);
178 
179 private:
180  bool SetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
182  const char* GetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
184  const char* GetFromHeader(FileMetaInformation const &fmi);
186  const char* GetFromDataSet(DataSet const &ds);
187 
188 private:
189  MSType MSField;
190 };
191 //-----------------------------------------------------------------------------
192 inline std::ostream &operator<<(std::ostream &_os, const MediaStorage &ms)
193 {
194  const char *msstring = MediaStorage::GetMSString(ms);
195  _os << (msstring ? msstring : "INVALID MEDIA STORAGE");
196  return _os;
197 
198 }
199 
200 } // end namespace gdcm
201 
202 #endif // GDCMMEDIASTORAGE_H

Generated on Wed Apr 10 2013 04:43:09 for GDCM by doxygen 1.8.2
SourceForge.net Logo