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
#ifndef GDCMFILE_H
#define GDCMFILE_H
-#include "gdcmCommon.h"
+#include <iostream>
+#include "gdcmBase.h"
namespace gdcm
{
* 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; }
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"
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; };
FileType GetWriteType() { return WriteType; };
protected:
- bool WriteBase(std::string const& fileName);
bool CheckWriteIntegrity();
- void SetWriteToDecompressed();
+ void SetWriteToRaw();
void SetWriteToRGB();
void RestoreWrite();
private:
void Initialise();
- uint8_t* GetDecompressed();
- int ComputeDecompressedPixelDataSizeFromHeader();
+ uint8_t* GetRaw();
-private:
// members variables:
-
/// Header to use to load the file
Header *HeaderInternal;