GDCM  2.2.4
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  XRayRadiationDoseSR, // 1.2.840.10008.5.1.4.1.1.88.67
123  VLEndoscopicImageStorage, // 1.2.840.10008.5.1.4.1.1.77.1.1
124  BreastTomosynthesisImageStorage, // 1.2.840.10008.5.1.4.1.1.13.1.3
125  FujiPrivateCRImageStorage, // 1.2.392.200036.9125.1.1.2
126  OphthalmicPhotography8BitImageStorage, // 1.2.840.10008.5.1.4.1.1.77.1.5.1
127  OphthalmicTomographyImageStorage, // 1.2.840.10008.5.1.4.1.1.77.1.5.4
128  MS_END
129  } MSType; // Media Storage Type
130 
131 typedef enum {
132  NoObject = 0, // DICOMDIR
133  Video, // Most common, include image, video and volume
134  Waveform, // Isn't it simply a 1D video ?
135  Audio, // ???
137  URI, // URL...
138  Segmentation, // TODO
139  ObjectEnd
140  } ObjectType;
141 
143  static const char* GetMSString(MSType ts);
144 
146  const char* GetString() const;
147  static MSType GetMSType(const char *str);
148 
149  MediaStorage(MSType type = MS_END):MSField(type) {}
150 
153  static bool IsImage(MSType ts);
154 
155  operator MSType () const { return MSField; }
156 
157  const char *GetModality() const;
158  unsigned int GetModalityDimension() const;
159 
160  static unsigned int GetNumberOfMSType();
161  static unsigned int GetNumberOfMSString();
162  static unsigned int GetNumberOfModality();
163 
164 
169  bool SetFromFile(File const &file);
170 
173  bool SetFromDataSet(DataSet const &ds); // Will get the SOP Class UID
174  bool SetFromHeader(FileMetaInformation const &fmi); // Will get the Media Storage SOP Class UID
175  bool SetFromModality(DataSet const &ds);
176  void GuessFromModality(const char *modality, unsigned int dimension = 2);
177 
178  friend std::ostream &operator<<(std::ostream &os, const MediaStorage &ms);
179 
180  bool IsUndefined() const { return MSField == MS_END; }
181 
182 protected:
183  void SetFromSourceImageSequence(DataSet const &ds);
184 
185 private:
186  bool SetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
188  const char* GetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
190  const char* GetFromHeader(FileMetaInformation const &fmi);
192  const char* GetFromDataSet(DataSet const &ds);
193 
194 private:
195  MSType MSField;
196 };
197 //-----------------------------------------------------------------------------
198 inline std::ostream &operator<<(std::ostream &_os, const MediaStorage &ms)
199 {
200  const char *msstring = MediaStorage::GetMSString(ms);
201  _os << (msstring ? msstring : "INVALID MEDIA STORAGE");
202  return _os;
203 
204 }
205 
206 } // end namespace gdcm
207 
208 #endif // GDCMMEDIASTORAGE_H

Generated on Tue Aug 13 2013 15:28:54 for GDCM by doxygen 1.8.4
SourceForge.net Logo