X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.h;h=af9382efac99beb6e325683ae3bc0eb660075105;hb=0bbf3772212391cff69ed451c0a089279ee0c27c;hp=f72484188d77d0a8363eaa7d4f457398996aed20;hpb=8d10ccb6794a0f22234983990e2181a24625fbd8;p=gdcm.git diff --git a/src/gdcmFile.h b/src/gdcmFile.h index f7248418..af9382ef 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/04 09:41:02 $ - Version: $Revision: 1.84 $ + Date: $Date: 2005/01/06 08:46:21 $ + Version: $Revision: 1.90 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -19,7 +19,8 @@ #ifndef GDCMFILE_H #define GDCMFILE_H -#include "gdcmCommon.h" +#include +#include "gdcmBase.h" namespace gdcm { @@ -35,21 +36,24 @@ class DocEntryArchive; * for accessing the image/volume content. One can also use it to * write Dicom/ACR-NEMA/RAW files. */ -class GDCM_EXPORT File +class GDCM_EXPORT File : public Base { public: enum FileMode { - WMODE_DECOMPRESSED, + WMODE_RAW, WMODE_RGB }; public: + File( ); File( Header* header ); File( std::string const& filename ); virtual ~File(); + void Print(std::ostream &os = std::cout); + /// Accessor to \ref Header Header* GetHeader() { return HeaderInternal; } @@ -60,7 +64,18 @@ public: uint8_t* GetImageDataRaw(); size_t GetImageDataIntoVector(void* destination, size_t maxSize); - bool SetImageData (uint8_t* data, size_t expectedSize); + void SetImageData(uint8_t* data, size_t expectedSize); + + // User datas + void SetUserData(uint8_t* data, size_t expectedSize); + uint8_t* GetUserData(); + size_t GetUserDataSize(); + // RBG datas (from file + uint8_t* GetRGBData(); + size_t GetRGBDataSize(); + // RAW datas (from file + uint8_t* GetRawData(); + size_t GetRawDataSize(); // Write pixels of ONE image on hard drive // No test is made on processor "endianity" @@ -72,11 +87,18 @@ public: bool Write(std::string const& fileName); 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 element); + uint8_t* GetLutRGBA(); // Write mode - void SetWriteModeToDecompressed() { SetWriteMode(WMODE_DECOMPRESSED); }; + void SetWriteModeToRaw() { SetWriteMode(WMODE_RAW); }; void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); }; void SetWriteMode(FileMode mode) { WriteMode = mode; }; FileMode GetWriteMode() { return WriteMode; }; @@ -90,10 +112,9 @@ public: FileType GetWriteType() { return WriteType; }; protected: - bool WriteBase(std::string const& fileName); bool CheckWriteIntegrity(); - void SetWriteToDecompressed(); + void SetWriteToRaw(); void SetWriteToRGB(); void RestoreWrite(); @@ -112,12 +133,9 @@ protected: private: void Initialise(); - uint8_t* GetDecompressed(); - int ComputeDecompressedPixelDataSizeFromHeader(); + uint8_t* GetRaw(); -private: // members variables: - /// Header to use to load the file Header *HeaderInternal;