GDCM  2.2.0
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,
112  SegmentationStorage, // "1.2.840.10008.5.1.4.1.1.66.4"
113  RTIonPlanStorage, // 1.2.840.10008.5.1.4.1.1.481.8
114  XRay3DAngiographicImageStorage, // 1.2.840.10008.5.1.4.1.1.13.1.1
116  RTIonBeamsTreatmentRecordStorage, // 1.2.840.10008.5.1.4.1.1.481.9
117  SurfaceSegmentationStorage, // "1.2.840.10008.5.1.4.1.1.66.5"
118  VLWholeSlideMicroscopyImageStorage, // 1.2.840.10008.5.1.4.1.1.77.1.6
119  MS_END
120  } MSType; // Media Storage Type
121 
122 typedef enum {
123  NoObject = 0, // DICOMDIR
124  Video, // Most common, include image, video and volume
125  Waveform, // Isn't it simply a 1D video ?
126  Audio, // ???
128  URI, // URL...
129  Segmentation, // TODO
130  ObjectEnd
131  } ObjectType;
132 
134  static const char* GetMSString(MSType ts);
135 
137  const char* GetString() const;
138  static MSType GetMSType(const char *str);
139 
140  MediaStorage(MSType type = MS_END):MSField(type) {}
141 
144  static bool IsImage(MSType ts);
145 
146  operator MSType () const { return MSField; }
147 
148  const char *GetModality() const;
149  unsigned int GetModalityDimension() const;
150 
151  static unsigned int GetNumberOfMSType();
152  static unsigned int GetNumberOfMSString();
153  static unsigned int GetNumberOfModality();
154 
155 
160  bool SetFromFile(File const &file);
161 
164  bool SetFromDataSet(DataSet const &ds); // Will get the SOP Class UID
165  bool SetFromHeader(FileMetaInformation const &fmi); // Will get the Media Storage SOP Class UID
166  bool SetFromModality(DataSet const &ds);
167  void GuessFromModality(const char *modality, unsigned int dimension = 2);
168 
169  friend std::ostream &operator<<(std::ostream &os, const MediaStorage &ms);
170 
171  bool IsUndefined() const { return MSField == MS_END; }
172 
173 protected:
174  void SetFromSourceImageSequence(DataSet const &ds);
175 
176 private:
177  bool SetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
179  const char* GetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
181  const char* GetFromHeader(FileMetaInformation const &fmi);
183  const char* GetFromDataSet(DataSet const &ds);
184 
185 private:
186  MSType MSField;
187 };
188 //-----------------------------------------------------------------------------
189 inline std::ostream &operator<<(std::ostream &_os, const MediaStorage &ms)
190 {
191  const char *msstring = MediaStorage::GetMSString(ms);
192  _os << (msstring ? msstring : "INVALID MEDIA STORAGE");
193  return _os;
194 
195 }
196 
197 } // end namespace gdcm
198 
199 #endif // GDCMMEDIASTORAGE_H

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