X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFileHelper.cxx;h=9d8e8f440499036f1e16f7e360de94c91641962a;hb=ab3dc69a71af640fa49cbd917272d9ff7d1651b6;hp=03e85e1f9c9b52b21595b9ed680a48acbc32406f;hpb=be54aab0103af7dee1a3bb5b8b3ee93b59ca9073;p=gdcm.git diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index 03e85e1f..9d8e8f44 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2005/01/24 16:44:54 $ - Version: $Revision: 1.5 $ + Date: $Date: 2005/01/25 15:44:24 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -23,6 +23,8 @@ #include "gdcmDebug.h" #include "gdcmUtil.h" #include "gdcmBinEntry.h" +#include "gdcmValEntry.h" +#include "gdcmContentEntry.h" #include "gdcmFile.h" #include "gdcmPixelReadConvert.h" #include "gdcmPixelWriteConvert.h" @@ -530,10 +532,10 @@ bool FileHelper::Write(std::string const &fileName) * @param group group number of the Dicom Element to modify * @param elem element number of the Dicom Element to modify */ -bool FileHelper::SetEntryValue(std::string const &content, +bool FileHelper::SetValEntry(std::string const &content, uint16_t group, uint16_t elem) { - return FileInternal->SetEntryValue(content,group,elem); + return FileInternal->SetValEntry(content,group,elem); } @@ -546,10 +548,10 @@ bool FileHelper::SetEntryValue(std::string const &content, * @param group group number of the Dicom Element to modify * @param elem element number of the Dicom Element to modify */ -bool FileHelper::SetEntryBinArea(uint8_t *content, int lgth, +bool FileHelper::SetBinEntry(uint8_t *content, int lgth, uint16_t group, uint16_t elem) { - return FileInternal->SetEntryBinArea(content,lgth,group,elem); + return FileInternal->SetBinEntry(content,lgth,group,elem); } /** @@ -561,10 +563,10 @@ bool FileHelper::SetEntryBinArea(uint8_t *content, int lgth, * \return pointer to the modified/created Dicom entry (NULL when creation * failed). */ -bool FileHelper::Insert(std::string const &content, - uint16_t group, uint16_t elem) +ValEntry *FileHelper::InsertValEntry(std::string const &content, + uint16_t group, uint16_t elem) { - return FileInternal->Insert(content,group,elem) != NULL; + return FileInternal->InsertValEntry(content,group,elem); } /* @@ -577,10 +579,24 @@ bool FileHelper::Insert(std::string const &content, * \return pointer to the modified/created Dicom entry (NULL when creation * failed). */ -bool FileHelper::Insert(uint8_t *binArea, int lgth, - uint16_t group, uint16_t elem) +BinEntry *FileHelper::InsertBinEntry(uint8_t *binArea, int lgth, + uint16_t group, uint16_t elem) { - return FileInternal->Insert(binArea,lgth,group,elem) != NULL; + return FileInternal->InsertBinEntry(binArea,lgth,group,elem); +} + +/* + * \brief Modifies the value of a given DocEntry (Dicom entry) + * when it exists. Create it with the given value when unexistant. + * A copy of the binArea is made to be kept in the Document. + * @param group Group number of the Entry + * @param elem Element number of the Entry + * \return pointer to the modified/created Dicom entry (NULL when creation + * failed). + */ +SeqEntry *FileHelper::InsertSeqEntry(uint16_t group, uint16_t elem) +{ + return FileInternal->InsertSeqEntry(group,elem); } /** @@ -626,16 +642,18 @@ bool FileHelper::CheckWriteIntegrity() case WMODE_RAW : if( decSize!=PixelWriteConverter->GetUserDataSize() ) { - gdcmVerboseMacro( "Data size is incorrect (Raw)" << decSize - << " / " << PixelWriteConverter->GetUserDataSize() ); + gdcmVerboseMacro( "Data size (Raw) is incorrect. Should be " + << decSize << " / Found :" + << PixelWriteConverter->GetUserDataSize() ); return false; } break; case WMODE_RGB : if( rgbSize!=PixelWriteConverter->GetUserDataSize() ) { - gdcmVerboseMacro( "Data size is incorrect (RGB)" << decSize - << " / " << PixelWriteConverter->GetUserDataSize() ); + gdcmVerboseMacro( "Data size (RGB) is incorrect. Should be " + << decSize << " / Found " + << PixelWriteConverter->GetUserDataSize() ); return false; } break;