6 #include "gdcmCommon.h"
7 #include "gdcmHeader.h"
9 ////////////////////////////////////////////////////////////////////////////
10 // In addition to Dicom header exploration, this class is designed
11 // for accessing the image/volume content. One can also use it to
14 class GDCM_EXPORT gdcmFile: public gdcmHeader
19 int Parsed; // weather already parsed
20 std::string OrigFileName; // To avoid file overwrite
21 void SwapZone(void* im, int swap, int lgr, int nb);
23 bool ReadPixelData(void * destination);
25 int gdcm_read_JPEG_file (void * image_buffer); // For JPEG 8 Bits
26 int gdcm_read_JPEG_file12 (void * image_buffer); // For JPEG 12 Bits
27 int gdcm_read_JPEG2000_file (void * image_buffer); // For JPEG 2000 (TODO)
29 // For Run Length Encoding (TOCHECK)
30 int gdcm_read_RLE_file (void * image_buffer);
34 int WriteBase(std::string FileName, FileType type);
36 gdcmFile(std::string & filename);
37 gdcmFile(const char * filename);
39 // For promotion (performs a deepcopy of pointed header object)
40 // TODO Swig gdcmFile(gdcmHeader* header);
41 // TODO Swig ~gdcmFile();
43 // On writing purposes. When instance was created through
44 // gdcmFile(std::string filename) then the filename argument MUST be
45 // different from the constructor's one (no overwriting allowed).
46 // TODO Swig int SetFileName(std::string filename);
48 void SetPixelDataSizeFromHeader(void);
49 size_t GetImageDataSize();
50 void * GetImageData();
51 size_t GetImageDataIntoVector(void* destination, size_t MaxSize );
53 // Allocates ExpectedSize bytes of memory at this->Data and copies the
54 // pointed data to it. Copying the image might look useless but
55 // the caller might destroy it's image (without knowing it: think
56 // of a complicated interface where display is done with a library
57 // e.g. VTK) before calling the Write
58 int SetImageData (void * Data, size_t ExpectedSize);
59 // When the caller is aware we simply point to the data:
60 // TODO int SetImageDataNoCopy (void * Data, size_t ExpectedSize);
61 void SetImageDataSize (size_t ExpectedSize);
64 // A NE PAS OUBLIER : que fait-on en cas de Transfert Syntax (dans l'entete)
65 // incohérente avec l'ordre des octets en mémoire ?
66 // TODO Swig int Write();
68 // Ecrit sur disque les pixels d'UNE image
69 // Aucun test n'est fait sur l'"Endiannerie" du processeur.
70 // Ca sera à l'utilisateur d'appeler son Reader correctement
72 int WriteRawData (std::string fileName);
73 int WriteDcmImplVR(std::string fileName);
74 int WriteDcmImplVR(const char * fileName);
75 int WriteDcmExplVR(std::string fileName);
76 int WriteAcr (std::string fileName);
78 bool ParsePixelData(void);