X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmFile.h;h=0f75b016bd9788250b156e917e5e22017b6ff6b2;hb=327dfe7647e3720b0f3125f9b19397cb9afc0ed3;hp=2cfd69f70eded4db1f3ea55986771a83126c3649;hpb=922095a0dd56f24d651b36f62256690020937d9a;p=gdcm.git diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 2cfd69f7..0f75b016 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/10 13:49:07 $ - Version: $Revision: 1.86 $ + Date: $Date: 2005/01/06 20:03:27 $ + Version: $Revision: 1.91 $ 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 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, + bool SetEntryByNumber(std::string const &content, uint16_t group, uint16_t element); - bool SetEntryByNumber(uint8_t* content, int lgth, + bool SetEntryByNumber(uint8_t *content, int lgth, uint16_t group, uint16_t element); - bool ReplaceOrCreateByNumber(std::string const& content, + 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 ReplaceOrCreateByNumber(uint8_t* binArea, int lgth, - uint16_t group, uint16_t elem); 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;