GDCM 2.2.1

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

- File List
- File Members

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
41 class GDCM_EXPORT MediaStorage
42 {
43 public:
44 typedef enum {
45 MediaStorageDirectoryStorage = 0,
46 ComputedRadiographyImageStorage,
47 DigitalXRayImageStorageForPresentation,
48 DigitalXRayImageStorageForProcessing,
49 DigitalMammographyImageStorageForPresentation,
50 DigitalMammographyImageStorageForProcessing,
51 DigitalIntraoralXrayImageStorageForPresentation,
52 DigitalIntraoralXRayImageStorageForProcessing,
53 CTImageStorage,
54 EnhancedCTImageStorage,
55 UltrasoundImageStorageRetired,
56 UltrasoundImageStorage,
57 UltrasoundMultiFrameImageStorageRetired,
58 UltrasoundMultiFrameImageStorage,
59 MRImageStorage,
60 EnhancedMRImageStorage,
61 MRSpectroscopyStorage,
62 NuclearMedicineImageStorageRetired,
63 SecondaryCaptureImageStorage,
64 MultiframeSingleBitSecondaryCaptureImageStorage,
65 MultiframeGrayscaleByteSecondaryCaptureImageStorage,
66 MultiframeGrayscaleWordSecondaryCaptureImageStorage,
67 MultiframeTrueColorSecondaryCaptureImageStorage,
68 StandaloneOverlayStorage,
69 StandaloneCurveStorage,
70 LeadECGWaveformStorage, // 12-
71 GeneralECGWaveformStorage,
72 AmbulatoryECGWaveformStorage,
73 HemodynamicWaveformStorage,
74 CardiacElectrophysiologyWaveformStorage,
75 BasicVoiceAudioWaveformStorage,
76 StandaloneModalityLUTStorage,
77 StandaloneVOILUTStorage,
78 GrayscaleSoftcopyPresentationStateStorageSOPClass,
79 XRayAngiographicImageStorage,
80 XRayRadiofluoroscopingImageStorage,
81 XRayAngiographicBiPlaneImageStorageRetired,
82 NuclearMedicineImageStorage,
83 RawDataStorage,
84 SpacialRegistrationStorage, // Spatial
85 SpacialFiducialsStorage, // Spatial..
86 PETImageStorage,
87 RTImageStorage,
88 RTDoseStorage,
89 RTStructureSetStorage,
90 RTPlanStorage,
91 CSANonImageStorage,
92 Philips3D,
93 EnhancedSR,
94 BasicTextSR,
95 HardcopyGrayscaleImageStorage,
96 ComprehensiveSR,
97 DetachedStudyManagementSOPClass,
98 EncapsulatedPDFStorage,
99 EncapsulatedCDAStorage,
100 StudyComponentManagementSOPClass,
101 DetachedVisitManagementSOPClass,
102 DetachedPatientManagementSOPClass,
103 VideoEndoscopicImageStorage,
104 GeneralElectricMagneticResonanceImageStorage,
105 GEPrivate3DModelStorage,
106 ToshibaPrivateDataStorage,
107 MammographyCADSR,
108 KeyObjectSelectionDocument,
109 HangingProtocolStorage,
110 ModalityPerformedProcedureStepSOPClass,
111 PhilipsPrivateMRSyntheticImageStorage,
112 VLPhotographicImageStorage,
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
116 EnhancedXAImageStorage,
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, // ???
130 PDF,
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