]> Creatis software - gdcm.git/blobdiff - src/gdcmFileHelper.h
COMP: Fix comp on dash8 (gcc296)
[gdcm.git] / src / gdcmFileHelper.h
index 983c14c6bb972ba9f13171cb03b6b95fa7a1aa68..684f3ea9ef5d60aca766feda70288b39537a4fac 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmFileHelper.h,v $
   Language:  C++
-  Date:      $Date: 2006/03/01 09:45:04 $
-  Version:   $Revision: 1.39 $
+  Date:      $Date: 2006/05/11 19:49:38 $
+  Version:   $Revision: 1.44 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 #include "gdcmDebug.h"
 #include "gdcmRefCounter.h"
-
+#include "gdcmVRKey.h"
+#include "gdcmFile.h"
 
 namespace gdcm 
 {
-class File;
+//class File;
 class DataEntry;
 class SeqEntry;
 class PixelReadConvert;
@@ -75,9 +76,9 @@ public:
                             uint16_t group, uint16_t elem);
 
    DataEntry *InsertEntryString(std::string const &content,
-                                       uint16_t group, uint16_t elem);
+                                uint16_t group, uint16_t elem, const VRKey &vr);
    DataEntry *InsertEntryBinArea(uint8_t *binArea, int lgth,
-                                        uint16_t group, uint16_t elem);
+                                 uint16_t group, uint16_t elem, const VRKey &vr);
    SeqEntry *InsertSeqEntry(uint16_t group, uint16_t elem);
 
    // File helpers
@@ -87,7 +88,7 @@ public:
    uint8_t *GetImageData();
    uint8_t *GetImageDataRaw();
 
-   GDCM_LEGACY(size_t GetImageDataIntoVector(void *destination,size_t maxSize));
+   GDCM_LEGACY(size_t GetImageDataIntoVector(void *destination,size_t maxSize))
 
    void SetImageData(uint8_t *data, size_t expectedSize);
 
@@ -116,7 +117,11 @@ public:
    ///        (as opposed to 'Grey pixels + Palettes color')
    void SetWriteModeToRGB()           { SetWriteMode(WMODE_RGB);  }
    /// \brief Sets the Write Mode ( )
-   void SetWriteMode(FileMode mode)   { WriteMode = mode;         }
+   void SetWriteMode(FileMode mode)   { 
+      WriteMode = mode;
+      // Deal with Samples per Pixel    
+      //if (mode == WMODE_RGB) FileInternal->InsertEntryString("3",0x0028,0x0002);
+   }
    /// \brief Gets the Write Mode ( )
    FileMode GetWriteMode()            { return WriteMode;         }
 
@@ -155,8 +160,8 @@ public:
 ///    FILTERED_IMAGE
 /// -3) user created a new image, using existing images (eg MIP, MPR, cartography image)
 ///   CREATED_IMAGE
-/// -4) user anonymized an image without processing the pixels.
-///   ANONYMIZED_IMAGE
+/// -4) user modified/added some tags *without processing* the pixels (anonymization...
+///   UNMODIFIED_PIXELS_IMAGE
 
    void SetContentType (ImageContentType c) { ContentType = c; }
    // no GetContentType() method, on purpose!
@@ -187,11 +192,14 @@ protected:
    void RestoreWriteOfLibido();
 
    DataEntry *CopyDataEntry(uint16_t group, uint16_t elem, 
-                               const TagName &vr = GDCM_VRUNKNOWN);
+                               const VRKey &vr = GDCM_VRUNKNOWN);
    void CheckMandatoryElements();
-   void CheckMandatoryEntry(uint16_t group, uint16_t elem, std::string value);
-   void SetMandatoryEntry(uint16_t group, uint16_t elem, std::string value);
-   void CopyMandatoryEntry(uint16_t group, uint16_t elem, std::string value);
+   void CheckMandatoryEntry(uint16_t group, uint16_t elem, std::string value,
+                               const VRKey &vr = GDCM_VRUNKNOWN);
+   void SetMandatoryEntry(uint16_t group, uint16_t elem, std::string value,
+                               const VRKey &vr = GDCM_VRUNKNOWN);
+   void CopyMandatoryEntry(uint16_t group, uint16_t elem, std::string value,
+                               const VRKey &vr = GDCM_VRUNKNOWN);
    void RestoreWriteMandatory();
 
 private: