Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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/12/21 14:52:13 $
00007   Version:   $Revision: 1.123 $
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 "gdcmDebug.h"
00023 #include "gdcmDocument.h"
00024 
00025 
00026 
00027 namespace gdcm 
00028 {
00029 
00030 class RLEFramesInfo;
00031 class JPEGFragmentsInfo;
00032 
00033 //-----------------------------------------------------------------------------
00034 // Dicom Part 3.3 Compliant
00035 enum ModalityType {
00036    Unknow,
00037    AU,       // Voice Audio
00038    AS,       // Angioscopy
00039    BI,       // Biomagnetic Imaging
00040    CF,       // Cinefluorography
00041    CP,       // Culposcopy
00042    CR,       // Computed Radiography
00043    CS,       // Cystoscopy
00044    CT,       // Computed Tomography
00045    DD,       // Duplex Dopler
00046    DF,       // Digital Fluoroscopy
00047    DG,       // Diaphanography
00048    DM,       // Digital Microscopy
00049    DS,       // Digital Substraction Angiography
00050    DX,       // Digital Radiography
00051    ECG,      // Echocardiography
00052    EPS,      // Basic Cardiac EP
00053    ES,       // Endoscopy
00054    FA,       // Fluorescein Angiography
00055    FS,       // Fundoscopy
00056    HC,       // Hard Copy
00057    HD,       // Hemodynamic
00058    LP,       // Laparoscopy
00059    LS,       // Laser Surface Scan
00060    MA,       // Magnetic Resonance Angiography
00061    MR,       // Magnetic Resonance
00062    NM,       // Nuclear Medicine
00063    OT,       // Other
00064    PT,       // Positron Emission Tomography
00065    RF,       // Radio Fluoroscopy
00066    RG,       // Radiographic Imaging
00067    RTDOSE,   // Radiotherapy Dose
00068    RTIMAGE,  // Radiotherapy Image
00069    RTPLAN,   // Radiotherapy Plan
00070    RTSTRUCT, // Radiotherapy Structure Set
00071    SM,       // Microscopic Imaging
00072    ST,       // Single-photon Emission Computed Tomography
00073    TG,       // Thermography
00074    US,       // Ultrasound
00075    VF,       // Videofluorography
00076    XA,       // X-Ray Angiography
00077    XC        // Photographic Imaging
00078 };
00079 
00080 //-----------------------------------------------------------------------------
00081 
00099 class GDCM_EXPORT File : public Document
00100 {
00101    gdcmTypeMacro(File);
00102 
00103 public:
00104    static File *New() {return new File();}
00105 
00106    // Loading
00107    //GDCM_LEGACY(bool Load( std::string const &filename ));
00108    bool Load(); 
00109    // Standard values and informations contained in the header
00110    bool IsReadable();
00111 
00112    // Some heuristic based accessors, end user intended 
00113    int GetImageNumber();
00114    ModalityType GetModality();
00115 
00116    int GetXSize();
00117    int GetYSize();
00118    int GetZSize();
00119 
00120    float GetXSpacing();
00121    float GetYSpacing();
00122    float GetZSpacing();
00123 
00124    float GetXOrigin();
00125    float GetYOrigin();
00126    float GetZOrigin();
00127 
00128    bool GetImageOrientationPatient( float iop[6] );
00129 
00130    int GetBitsStored();
00131    int GetBitsAllocated();
00132    int GetHighBitPosition();
00133    int GetSamplesPerPixel();
00134    int GetPlanarConfiguration();
00135    int GetPixelSize();
00136    std::string GetPixelType();
00137    bool IsSignedPixelData();
00138    bool IsMonochrome();
00139    bool IsMonochrome1();
00140    bool IsPaletteColor();
00141    bool IsYBRFull();
00142 
00143    bool HasLUT();
00144    int GetLUTNbits();
00145 
00146    // For rescaling graylevel:
00147    float GetRescaleIntercept();
00148    float GetRescaleSlope();
00149 
00150    int GetNumberOfScalarComponents();
00151    int GetNumberOfScalarComponentsRaw();
00152 
00154    uint16_t GetGrPixel()  { return GrPixel; }
00156    uint16_t GetNumPixel() { return NumPixel; }
00157 
00158    size_t GetPixelOffset();
00159    size_t GetPixelAreaLength();
00160 
00162    RLEFramesInfo *GetRLEInfo() { return RLEInfo; }
00164    JPEGFragmentsInfo *GetJPEGInfo() { return JPEGInfo; }
00165 
00166 // Anonymization process
00167    void AddAnonymizeElement (uint16_t group, uint16_t elem, 
00168                              std::string const &value);
00170    void ClearAnonymizeList() { UserAnonymizeList.clear(); }      
00171    void AnonymizeNoLoad();
00173    bool AnonymizeFile();
00174   
00175    bool Write(std::string fileName, FileType filetype);
00176 
00177    
00178 protected:
00179    File();
00180    ~File();
00182    bool MayIWrite(uint16_t group)
00183      { if (group < 8 &&  group !=2 ) return false; else return true; }
00184       
00186    RLEFramesInfo *RLEInfo;
00188    JPEGFragmentsInfo *JPEGInfo;
00189 
00194    uint16_t NumPixel;
00199    uint16_t GrPixel;
00200 
00201 private:
00202    bool DoTheLoadingJob();
00203    void ComputeRLEInfo();
00204    void ComputeJPEGFragmentInfo();
00205    bool     ReadTag(uint16_t, uint16_t);
00206    uint32_t ReadTagLength(uint16_t, uint16_t);
00207    void ReadEncapsulatedBasicOffsetTable();
00208    uint32_t *BasicOffsetTableItemValue;
00209 
00210 };
00211 } // end namespace gdcm
00212 
00213 //-----------------------------------------------------------------------------
00214 #endif

Generated on Fri Jan 20 10:14:25 2006 for gdcm by  doxygen 1.4.4