X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.h;h=da097692bcaa53af0423387cdc766a2f5a3b541b;hb=7059f7f1ad9d1466d7b752a40cfeb95ba81aa3d8;hp=ce3d99565c7b6e4c18d50ce109fb03c946be79d6;hpb=2903216d32144f3c716c1dc14fb29a5bc422c3b4;p=gdcm.git diff --git a/src/gdcmFile.h b/src/gdcmFile.h index ce3d9956..da097692 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/16 10:51:49 $ - Version: $Revision: 1.87 $ + Date: $Date: 2005/01/08 15:03:59 $ + Version: $Revision: 1.92 $ 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,7 +36,7 @@ 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 @@ -46,25 +47,27 @@ public: public: File( ); - File( Header* header ); - File( std::string const& filename ); + 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; } + Header *GetHeader() { return HeaderInternal; } size_t GetImageDataSize(); size_t GetImageDataRawSize(); - uint8_t* GetImageData(); - uint8_t* GetImageDataRaw(); - size_t GetImageDataIntoVector(void* destination, size_t maxSize); + uint8_t *GetImageData(); + uint8_t *GetImageDataRaw(); + size_t GetImageDataIntoVector(void *destination, size_t maxSize); - void 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); + void SetUserData(uint8_t *data, size_t expectedSize); uint8_t* GetUserData(); size_t GetUserDataSize(); // RBG datas (from file @@ -77,20 +80,20 @@ public: // Write pixels of ONE image on hard drive // No test is made on processor "endianity" // The user must call his reader correctly - bool WriteRawData (std::string const& fileName); - bool WriteDcmImplVR(std::string const& fileName); - bool WriteDcmExplVR(std::string const& fileName); - bool WriteAcr (std::string const& fileName); - 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); + bool WriteRawData (std::string const &fileName); + bool WriteDcmImplVR(std::string const &fileName); + bool WriteDcmExplVR(std::string const &fileName); + bool WriteAcr (std::string const &fileName); + bool Write (std::string const &fileName); + + bool SetEntry(std::string const &content, + uint16_t group, uint16_t element); + bool SetEntry(uint8_t *content, int lgth, + uint16_t group, uint16_t element); + bool ReplaceOrCreate(std::string const &content, + uint16_t group, uint16_t element); + bool ReplaceOrCreate(uint8_t *binArea, int lgth, + uint16_t group, uint16_t element); uint8_t* GetLutRGBA(); @@ -109,7 +112,6 @@ public: FileType GetWriteType() { return WriteType; }; protected: - bool WriteBase(std::string const& fileName); bool CheckWriteIntegrity(); void SetWriteToRaw(); @@ -125,17 +127,15 @@ protected: void SetWriteToNoLibido(); void RestoreWriteOfLibido(); - ValEntry* CopyValEntry(uint16_t group,uint16_t element); - BinEntry* CopyBinEntry(uint16_t group,uint16_t element); + ValEntry *CopyValEntry(uint16_t group,uint16_t element); + BinEntry *CopyBinEntry(uint16_t group,uint16_t element); private: void Initialise(); - uint8_t* GetRaw(); + uint8_t *GetRaw(); -private: // members variables: - /// Header to use to load the file Header *HeaderInternal; @@ -148,8 +148,8 @@ private: bool Parsed; /// Utility pixel converter - PixelReadConvert* PixelReadConverter; - PixelWriteConvert* PixelWriteConverter; + PixelReadConvert *PixelReadConverter; + PixelWriteConvert *PixelWriteConverter; // Utility header archive DocEntryArchive *Archive;