X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDataEntry.cxx;h=3504fee1ee98e9a52cf5eb43a5bab9f25151cc43;hb=1771b10b3f1a4d6f96ea1869fb005f0d48b62eda;hp=182d7391a9fc56fe5bc3aef348d64f3697a5cf89;hpb=66c8b2ef6c096d675afb963778604ed7ae72a78c;p=gdcm.git diff --git a/src/gdcmDataEntry.cxx b/src/gdcmDataEntry.cxx index 182d7391..3504fee1 100644 --- a/src/gdcmDataEntry.cxx +++ b/src/gdcmDataEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDataEntry.cxx,v $ Language: C++ - Date: $Date: 2007/07/26 08:36:49 $ - Version: $Revision: 1.44 $ + Date: $Date: 2007/08/29 15:30:48 $ + Version: $Revision: 1.47 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -90,7 +90,10 @@ DataEntry::~DataEntry () /** * \brief Sets the value (non string) of the current DataEntry * @param area area - * @param self self + * @param self self=true : The area : *belongs" to the DataEntry + * : will be delete with the DataEntry + * self=false The area *is not* deleted with the DataEntry + * */ void DataEntry::SetBinArea( uint8_t *area, bool self ) { @@ -118,7 +121,7 @@ void DataEntry::CopyBinArea( uint8_t *area, uint32_t length ) NewBinArea(); memcpy(BinArea,area,length); if( length!=lgh ) - BinArea[length]=0; + BinArea[length]=0; // padd with zero State = STATE_LOADED; } @@ -137,7 +140,7 @@ void DataEntry::SetValue(const uint32_t &id, const double &val) if( id > GetValueCount() ) { - gdcmErrorMacro("Index (" << id << ")is greater than the data size"); + gdcmErrorMacro("Index (" << id << ") is greater than the data size"); return; } @@ -172,7 +175,7 @@ void DataEntry::SetValue(const uint32_t &id, const double &val) } } /** - * \brief returns, as a double (?!?) one of the values + * \brief returns, as a double one of the values * (when entry is multivaluated), identified by its index. * Returns 0.0 if index is wrong * @param id id @@ -196,13 +199,11 @@ double DataEntry::GetValue(const uint32_t &id) const return 0.0; } - /// \todo FIX the API : user *knows* that entry contains a US - /// and he receives a double ?!? + // if user *knows* that entry contains a US, + // he just has to cast the double he receives const VRKey &vr = GetVR(); - /// \todo FIX the API : user *knows* that entry contains a US, - /// the method is supposed to return a double - /// but sends a US ?!? + if( vr == "US" || vr == "SS" ) return ((uint16_t *)BinArea)[id]; else if( vr == "UL" || vr == "SL" ) @@ -549,10 +550,10 @@ void DataEntry::Copy(DocEntry *doc) * @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...) */ void DataEntry::WriteContent(std::ofstream *fp, FileType filetype, - bool insideMetaElements) + bool insideMetaElements, bool insideSequence) { // writes the 'common part' - DocEntry::WriteContent(fp, filetype, insideMetaElements); + DocEntry::WriteContent(fp, filetype, insideMetaElements, insideSequence); if ( GetGroup() == 0xfffe ) {