X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmFile.h;h=23f87ff6edc4f47298a05aa82e310512ade5bd6e;hb=446ab2af0e3045cd559b086ced08a8cc5a61d2e2;hp=01b638c497934786550c948f85c6b7e91a28224f;hpb=2bb60efea83f2bfa1823f27b2a5536a0e6cfd8c0;p=gdcm.git diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 01b638c4..23f87ff6 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2004/12/03 10:21:54 $ - Version: $Revision: 1.80 $ + Date: $Date: 2004/12/07 17:28:50 $ + Version: $Revision: 1.85 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,12 +20,15 @@ #define GDCMFILE_H #include "gdcmCommon.h" -#include "gdcmHeader.h" -#include "gdcmPixelReadConvert.h" -#include "gdcmDocEntryArchive.h" namespace gdcm { +class Header; +class ValEntry; +class BinEntry; +class PixelReadConvert; +class PixelWriteConvert; +class DocEntryArchive; //----------------------------------------------------------------------------- /* * In addition to Dicom header exploration, this class is designed @@ -35,20 +38,14 @@ namespace gdcm class GDCM_EXPORT File { public: - enum TWriteMode + enum FileMode { WMODE_DECOMPRESSED, WMODE_RGB }; - enum TWriteType - { - WTYPE_IMPL_VR, - WTYPE_EXPL_VR, - WTYPE_ACR - }; - public: + File( ); File( Header* header ); File( std::string const& filename ); @@ -60,9 +57,6 @@ public: size_t GetImageDataSize(); size_t GetImageDataRawSize(); - /// Accessor to \ref PixelReadConverter - PixelReadConvert* GetPixelReadConverter() { return PixelReadConverter; }; - uint8_t* GetImageData(); uint8_t* GetImageDataRaw(); size_t GetImageDataIntoVector(void* destination, size_t maxSize); @@ -78,29 +72,33 @@ public: bool WriteAcr (std::string const& fileName); bool Write(std::string const& fileName); - virtual bool SetEntryByNumber(std::string const& content, - uint16_t group, uint16_t element) - { - HeaderInternal->SetEntryByNumber(content,group,element); - return true; - } + bool SetEntryByNumber(std::string const& content, + uint16_t group, uint16_t element); + bool SetEntryByNumber(uint8_t* content, int lgth, + uint16_t group, uint16_t element); + bool ReplaceOrCreateByNumber(std::string const& content, + uint16_t group, uint16_t element); + bool ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, + uint16_t group, uint16_t elem); + uint8_t* GetLutRGBA(); // Write mode - void SetWriteModeToDecompressed() { SetWriteMode(WMODE_DECOMPRESSED); }; - void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); }; - void SetWriteMode(unsigned int mode) { WriteMode = mode; }; - unsigned int GetWriteMode() { return WriteMode; }; + void SetWriteModeToDecompressed() { SetWriteMode(WMODE_DECOMPRESSED); }; + void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); }; + void SetWriteMode(FileMode mode) { WriteMode = mode; }; + FileMode GetWriteMode() { return WriteMode; }; // Write format - void SetWriteTypeToDcmImplVR() { SetWriteType(WTYPE_EXPL_VR); }; - void SetWriteTypeToDcmExplVR() { SetWriteType(WTYPE_EXPL_VR); }; - void SetWriteTypeToAcr() { SetWriteType(WTYPE_ACR); }; - void SetWriteType(unsigned int format) { WriteType = format; }; - unsigned int GetWriteType() { return WriteType; }; + void SetWriteTypeToDcmImplVR() { SetWriteType(ImplicitVR); }; + void SetWriteTypeToDcmExplVR() { SetWriteType(ExplicitVR); }; + void SetWriteTypeToAcr() { SetWriteType(ACR); }; + void SetWriteTypeToAcrLibido() { SetWriteType(ACR_LIBIDO); }; + void SetWriteType(FileType format) { WriteType = format; }; + FileType GetWriteType() { return WriteType; }; protected: - bool WriteBase(std::string const& fileName, FileType type); + bool WriteBase(std::string const& fileName); bool CheckWriteIntegrity(); void SetWriteToDecompressed(); @@ -141,32 +139,14 @@ private: /// Utility pixel converter PixelReadConvert* PixelReadConverter; + PixelWriteConvert* PixelWriteConverter; // Utility header archive DocEntryArchive *Archive; // Write variables - unsigned int WriteMode; - unsigned int WriteType; - -/// FIXME -// --------------- Will be moved to a PixelData class -// - - /// \brief to hold the Pixels (when read) - uint8_t* Pixel_Data; // (was PixelData) - - /// \brief Size (in bytes) of requited memory to hold the the pixels - /// of this image in it's RGB convertion either from: - /// - Plane R, Plane G, Plane B - /// - Grey Plane + Palette Color - /// - YBR Pixels (or from RGB Pixels, as well) - size_t ImageDataSize; - -// -// --------------- end of future PixelData class -// - + FileMode WriteMode; + FileType WriteType; }; } // end namespace gdcm