X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=src%2FgdcmFile.h;h=dd5b4655e87e720530cc6f336f11014260b4cbd4;hb=2012716d624d631dcdb825fdd4470908e115a717;hp=6773662c46f08f9d47ec7a75682d508d63239b9d;hpb=06c1c583239fdf5196260e6ef83a78669c1bd17f;p=gdcm.git diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 6773662c..dd5b4655 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -1,5 +1,21 @@ -// gdcmFile.h -//----------------------------------------------------------------------------- +/*========================================================================= + + Program: gdcm + Module: $RCSfile: gdcmFile.h,v $ + Language: C++ + Date: $Date: 2004/06/20 18:08:47 $ + Version: $Revision: 1.30 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + #ifndef GDCMFILE_H #define GDCMFILE_H @@ -10,14 +26,22 @@ /* * In addition to Dicom header exploration, this class is designed * for accessing the image/volume content. One can also use it to - * write Dicom files. + * write Dicom/ACR-NEMA/RAW files. */ class GDCM_EXPORT gdcmFile { public: gdcmFile(gdcmHeader *header); - gdcmFile(std::string & filename); - gdcmFile(const char * filename); + gdcmFile(std::string & filename, + bool exception_on_error = false, + bool enable_sequences = false, + bool skip_shadow = false); + + gdcmFile(const char * filename, + bool exception_on_error = false, + bool enable_sequences = false, + bool skip_shadow = false); + virtual ~gdcmFile(void); gdcmHeader *GetHeader(void); @@ -57,20 +81,25 @@ public: // TODO Swig int Write(); // Write pixels of ONE image on hard drive - // No test is made on processor "stupidity" + // No test is made on processor "endianity" // The user must call his reader correctly bool WriteRawData (std::string fileName); bool WriteDcmImplVR(std::string fileName); bool WriteDcmImplVR(const char * fileName); bool WriteDcmExplVR(std::string fileName); bool WriteAcr (std::string fileName); - -protected: - bool WriteBase(std::string FileName, FileType type); // Body in file gdcmParse.cxx bool ParsePixelData(void); + inline virtual bool SetEntryByNumber(std::string content, + guint16 group, guint16 element) + { GetHeader()->SetEntryByNumber(content,group,element); } + + +protected: + bool WriteBase(std::string FileName, FileType type); + private: void SwapZone(void* im, int swap, int lgr, int nb); @@ -89,16 +118,35 @@ private: bool gdcm_read_RLE_file (FILE *fp,void * image_buffer); // Variables - gdcmHeader *Header; // Header to use to load the file + + /// \brief Header to use to load the file + gdcmHeader *Header; + + /// \brief Whether the underlying \ref gdcmHeader was loaded by + /// the constructor or passed to the constructor. When false + /// the destructor is in charge of deletion. bool SelfHeader; + /// \brief to hold the Pixels (when read) void* PixelData; - size_t lgrTotaleRaw; // Area length to receive the pixels - size_t lgrTotale; // Area length to receive the RGB pixels - // from Grey Plane + Palette Color + + /// \brief Area length to receive the pixels + size_t lgrTotaleRaw; + + /// \brief Area length to receive the RGB pixels + /// from Grey Plane + Palette Color + size_t lgrTotale; + + /// \brief ==1 if GetImageDataRaw was used + /// ==0 if GetImageData was used + /// ==-1 if ImageData never read + int PixelRead; - int Parsed; // weather already parsed - std::string OrigFileName; // To avoid file overwrite + /// weather already parsed + int Parsed; + + /// To avoid file overwrite + std::string OrigFileName; }; //-----------------------------------------------------------------------------