Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

gdcmFile.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmFile.h,v $
00005   Language:  C++
00006   Date:      $Date: 2005/02/06 14:39:35 $
00007   Version:   $Revision: 1.103 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #ifndef GDCMFILE_H
00020 #define GDCMFILE_H
00021 
00022 #include "gdcmDocument.h"
00023 
00024 namespace gdcm 
00025 {
00026 class RLEFramesInfo;
00027 class JPEGFragmentsInfo;
00028 
00029 //-----------------------------------------------------------------------------
00030 // Dicom Part 3.3 Compliant
00031 enum ModalityType {
00032    Unknow,
00033    AU,       // Voice Audio
00034    AS,       // Angioscopy
00035    BI,       // Biomagnetic Imaging
00036    CF,       // Cinefluorography
00037    CP,       // Culposcopy
00038    CR,       // Computed Radiography
00039    CS,       // Cystoscopy
00040    CT,       // Computed Tomography
00041    DD,       // Duplex Dopler
00042    DF,       // Digital Fluoroscopy
00043    DG,       // Diaphanography
00044    DM,       // Digital Microscopy
00045    DS,       // Digital Substraction Angiography
00046    DX,       // Digital Radiography
00047    ECG,      // Echocardiography
00048    EPS,      // Basic Cardiac EP
00049    ES,       // Endoscopy
00050    FA,       // Fluorescein Angiography
00051    FS,       // Fundoscopy
00052    HC,       // Hard Copy
00053    HD,       // Hemodynamic
00054    LP,       // Laparoscopy
00055    LS,       // Laser Surface Scan
00056    MA,       // Magnetic Resonance Angiography
00057    MR,       // Magnetic Resonance
00058    NM,       // Nuclear Medicine
00059    OT,       // Other
00060    PT,       // Positron Emission Tomography
00061    RF,       // Radio Fluoroscopy
00062    RG,       // Radiographic Imaging
00063    RTDOSE,   // Radiotherapy Dose
00064    RTIMAGE,  // Radiotherapy Image
00065    RTPLAN,   // Radiotherapy Plan
00066    RTSTRUCT, // Radiotherapy Structure Set
00067    SM,       // Microscopic Imaging
00068    ST,       // Single-photon Emission Computed Tomography
00069    TG,       // Thermography
00070    US,       // Ultrasound
00071    VF,       // Videofluorography
00072    XA,       // X-Ray Angiography
00073    XC        // Photographic Imaging
00074 };
00075 
00076 //-----------------------------------------------------------------------------
00077 
00095 class GDCM_EXPORT File : public Document
00096 {
00097 public:
00098    File();
00099    File( std::string const &filename );
00100    ~File();
00101 
00102    // Standard values and informations contained in the header
00103    bool IsReadable();
00104 
00105    // Some heuristic based accessors, end user intended 
00106    int GetImageNumber();
00107    ModalityType GetModality();
00108 
00109    int GetXSize();
00110    int GetYSize();
00111    int GetZSize();
00112 
00113    float GetXSpacing();
00114    float GetYSpacing();
00115    float GetZSpacing();
00116 
00117    float GetXOrigin();
00118    float GetYOrigin();
00119    float GetZOrigin();
00120 
00121    void GetImageOrientationPatient( float iop[6] );
00122 
00123    int GetBitsStored();
00124    int GetBitsAllocated();
00125    int GetHighBitPosition();
00126    int GetSamplesPerPixel();
00127    int GetPlanarConfiguration();
00128    int GetPixelSize();
00129    std::string GetPixelType();
00130    bool IsSignedPixelData();
00131    bool IsMonochrome();
00132    bool IsPaletteColor();
00133    bool IsYBRFull();
00134 
00135    bool HasLUT();
00136    int GetLUTNbits();
00137 
00138    // For rescaling graylevel:
00139    float GetRescaleIntercept();
00140    float GetRescaleSlope();
00141 
00142    int GetNumberOfScalarComponents();
00143    int GetNumberOfScalarComponentsRaw();
00144 
00146    uint16_t GetGrPixel()  { return GrPixel; }
00148    uint16_t GetNumPixel() { return NumPixel; }
00149 
00150    size_t GetPixelOffset();
00151    size_t GetPixelAreaLength();
00152 
00154    RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
00156    JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; }
00157 
00158 // Anonymization process
00159    void AddAnonymizeElement (uint16_t group, uint16_t elem, 
00160                              std::string const &value);
00162    void ClearAnonymizeList() { AnonymizeList.clear(); }      
00163    void AnonymizeNoLoad();
00165    bool AnonymizeFile();
00166 
00167    bool Write(std::string fileName, FileType filetype);
00168 
00169 protected:
00171    void InitializeDefaultFile();
00172  
00174    RLEFramesInfo *RLEInfo;
00176    JPEGFragmentsInfo *JPEGInfo;
00177 
00182    uint16_t NumPixel;
00187    uint16_t GrPixel;
00188 
00189 private:
00190    void ComputeRLEInfo();
00191    void ComputeJPEGFragmentInfo();
00192    bool     ReadTag(uint16_t, uint16_t);
00193    uint32_t ReadTagLength(uint16_t, uint16_t);
00194    void ReadAndSkipEncapsulatedBasicOffsetTable();
00195 
00196 };
00197 } // end namespace gdcm
00198 
00199 //-----------------------------------------------------------------------------
00200 #endif

Generated on Thu Feb 10 22:17:58 2005 for gdcm by doxygen 1.3.6