GDCM 2.2.0

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

- File List
- File Members

gdcmMediaStorage.h
Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004
    00005   Copyright (c) 2006-2011 Mathieu Malaterre
    00006   All rights reserved.
    00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00008
    00009      This software is distributed WITHOUT ANY WARRANTY; without even
    00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00011      PURPOSE.  See the above copyright notice for more information.
    00012
    00013 =========================================================================*/
    00014 #ifndef GDCMMEDIASTORAGE_H
    00015 #define GDCMMEDIASTORAGE_H
    00016
    00017 #include "gdcmTransferSyntax.h"
    00018
    00019 namespace gdcm
    00020 {
    00021
    00022 class DataSet;
    00023 class Tag;
    00024 class FileMetaInformation;
    00025 class File;
    00026
    00027 // WARNING: This class will be deprecated in the future. There is no reason to extend this class.
    00028 // Please check the gdcm::UIDs class if adding new well known UID.
    00029
    00041 class GDCM_EXPORT MediaStorage
    00042 {
    00043 public:
    00044   typedef enum {
    00045     MediaStorageDirectoryStorage = 0,
    00046     ComputedRadiographyImageStorage,
    00047     DigitalXRayImageStorageForPresentation,
    00048     DigitalXRayImageStorageForProcessing,
    00049     DigitalMammographyImageStorageForPresentation,
    00050     DigitalMammographyImageStorageForProcessing,
    00051     DigitalIntraoralXrayImageStorageForPresentation,
    00052     DigitalIntraoralXRayImageStorageForProcessing,
    00053     CTImageStorage,
    00054     EnhancedCTImageStorage,
    00055     UltrasoundImageStorageRetired,
    00056     UltrasoundImageStorage,
    00057     UltrasoundMultiFrameImageStorageRetired,
    00058     UltrasoundMultiFrameImageStorage,
    00059     MRImageStorage,
    00060     EnhancedMRImageStorage,
    00061     MRSpectroscopyStorage,
    00062     NuclearMedicineImageStorageRetired,
    00063     SecondaryCaptureImageStorage,
    00064     MultiframeSingleBitSecondaryCaptureImageStorage,
    00065     MultiframeGrayscaleByteSecondaryCaptureImageStorage,
    00066     MultiframeGrayscaleWordSecondaryCaptureImageStorage,
    00067     MultiframeTrueColorSecondaryCaptureImageStorage,
    00068     StandaloneOverlayStorage,
    00069     StandaloneCurveStorage,
    00070     LeadECGWaveformStorage, // 12-
    00071     GeneralECGWaveformStorage,
    00072     AmbulatoryECGWaveformStorage,
    00073     HemodynamicWaveformStorage,
    00074     CardiacElectrophysiologyWaveformStorage,
    00075     BasicVoiceAudioWaveformStorage,
    00076     StandaloneModalityLUTStorage,
    00077     StandaloneVOILUTStorage,
    00078     GrayscaleSoftcopyPresentationStateStorageSOPClass,
    00079     XRayAngiographicImageStorage,
    00080     XRayRadiofluoroscopingImageStorage,
    00081     XRayAngiographicBiPlaneImageStorageRetired,
    00082     NuclearMedicineImageStorage,
    00083     RawDataStorage,
    00084     SpacialRegistrationStorage, // Spatial
    00085     SpacialFiducialsStorage, // Spatial..
    00086     PETImageStorage,
    00087     RTImageStorage,
    00088     RTDoseStorage,
    00089     RTStructureSetStorage,
    00090     RTPlanStorage,
    00091     CSANonImageStorage,
    00092     Philips3D,
    00093     EnhancedSR,
    00094     BasicTextSR,
    00095     HardcopyGrayscaleImageStorage,
    00096     ComprehensiveSR,
    00097     DetachedStudyManagementSOPClass,
    00098     EncapsulatedPDFStorage,
    00099     StudyComponentManagementSOPClass,
    00100     DetachedVisitManagementSOPClass,
    00101     DetachedPatientManagementSOPClass,
    00102     VideoEndoscopicImageStorage,
    00103     GeneralElectricMagneticResonanceImageStorage,
    00104     GEPrivate3DModelStorage,
    00105     ToshibaPrivateDataStorage,
    00106     MammographyCADSR,
    00107     KeyObjectSelectionDocument,
    00108     HangingProtocolStorage,
    00109     ModalityPerformedProcedureStepSOPClass,
    00110     PhilipsPrivateMRSyntheticImageStorage,
    00111     VLPhotographicImageStorage,
    00112     SegmentationStorage, // "1.2.840.10008.5.1.4.1.1.66.4"
    00113     RTIonPlanStorage, // 1.2.840.10008.5.1.4.1.1.481.8
    00114     XRay3DAngiographicImageStorage, // 1.2.840.10008.5.1.4.1.1.13.1.1
    00115     EnhancedXAImageStorage,
    00116     RTIonBeamsTreatmentRecordStorage, // 1.2.840.10008.5.1.4.1.1.481.9
    00117     SurfaceSegmentationStorage, // "1.2.840.10008.5.1.4.1.1.66.5"
    00118     VLWholeSlideMicroscopyImageStorage, // 1.2.840.10008.5.1.4.1.1.77.1.6
    00119     MS_END
    00120   } MSType; // Media Storage Type
    00121
    00122 typedef enum {
    00123     NoObject = 0, // DICOMDIR
    00124     Video, // Most common, include image, video and volume
    00125     Waveform, // Isn't it simply a 1D video ?
    00126     Audio, // ???
    00127     PDF,
    00128     URI, // URL...
    00129     Segmentation, // TODO
    00130     ObjectEnd
    00131   } ObjectType;
    00132
    00134   static const char* GetMSString(MSType ts);
    00135
    00137   const char* GetString() const;
    00138   static MSType GetMSType(const char *str);
    00139
    00140   MediaStorage(MSType type = MS_END):MSField(type) {}
    00141
    00144   static bool IsImage(MSType ts);
    00145
    00146   operator MSType () const { return MSField; }
    00147
    00148   const char *GetModality() const;
    00149   unsigned int GetModalityDimension() const;
    00150
    00151   static unsigned int GetNumberOfMSType();
    00152   static unsigned int GetNumberOfMSString();
    00153   static unsigned int GetNumberOfModality();
    00154
    00155
    00160   bool SetFromFile(File const &file);
    00161
    00164   bool SetFromDataSet(DataSet const &ds); // Will get the SOP Class UID
    00165   bool SetFromHeader(FileMetaInformation const &fmi); // Will get the Media Storage SOP Class UID
    00166   bool SetFromModality(DataSet const &ds);
    00167   void GuessFromModality(const char *modality, unsigned int dimension = 2);
    00168
    00169   friend std::ostream &operator<<(std::ostream &os, const MediaStorage &ms);
    00170
    00171   bool IsUndefined() const { return MSField == MS_END; }
    00172
    00173 protected:
    00174   void SetFromSourceImageSequence(DataSet const &ds);
    00175
    00176 private:
    00177   bool SetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
    00179   const char* GetFromDataSetOrHeader(DataSet const &ds, const Tag & tag);
    00181   const char* GetFromHeader(FileMetaInformation const &fmi);
    00183   const char* GetFromDataSet(DataSet const &ds);
    00184
    00185 private:
    00186   MSType MSField;
    00187 };
    00188 //-----------------------------------------------------------------------------
    00189 inline std::ostream &operator<<(std::ostream &_os, const MediaStorage &ms)
    00190 {
    00191   const char *msstring = MediaStorage::GetMSString(ms);
    00192   _os << (msstring ? msstring : "INVALID MEDIA STORAGE");
    00193   return _os;
    00194
    00195 }
    00196
    00197 } // end namespace gdcm
    00198
    00199 #endif // GDCMMEDIASTORAGE_H