X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDataEntry.cxx;h=d183d93675735ef05adea15b231abb002d25b2a0;hb=96775cd7d34ec152fbf1430634bb338f524ee212;hp=e318600b245f02cd530f2854b4c410b92189823d;hpb=9dcd2e2063c6566193a7982c51f9551fa5f0ef3a;p=gdcm.git diff --git a/src/gdcmDataEntry.cxx b/src/gdcmDataEntry.cxx index e318600b..d183d936 100644 --- a/src/gdcmDataEntry.cxx +++ b/src/gdcmDataEntry.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDataEntry.cxx,v $ Language: C++ - Date: $Date: 2005/12/09 12:23:38 $ - Version: $Revision: 1.25 $ + Date: $Date: 2006/02/07 12:37:19 $ + Version: $Revision: 1.31 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -25,6 +25,12 @@ #include +#if defined(__BORLANDC__) + #include // for memcpy + #include // for atof + #include // for isdigit +#endif + namespace gdcm { //----------------------------------------------------------------------------- @@ -75,7 +81,7 @@ DataEntry::~DataEntry () //----------------------------------------------------------------------------- // Public /** - * \brief Sets the value (non string) of the current Dicom Header Entry + * \brief Sets the value (non string) of the current DataEntry * @param area area * @param self self */ @@ -89,7 +95,7 @@ void DataEntry::SetBinArea( uint8_t *area, bool self ) State = STATE_LOADED; } /** - * \brief Inserts the value (non string) into the current Dicom Header Entry + * \brief Inserts the value (non string) into the current DataEntry * @param area area * @param length length */ @@ -112,9 +118,9 @@ void DataEntry::CopyBinArea( uint8_t *area, uint32_t length ) } /** - * \brief Inserts the value (non string) into the current Dicom Header Entry - * @param id id - * @param val val + * \brief Inserts the elementary (non string) value into the current DataEntry + * @param id index of the elementary value to be set + * @param val value, passed as a double */ void DataEntry::SetValue(const uint32_t &id, const double &val) { @@ -317,7 +323,7 @@ uint32_t DataEntry::GetValueCount( ) const return GetLength(); } /** - * \brief Sets the 'value' of an Entry, passed as a std::string + * \brief Sets the 'value' of a DataEntry, passed as a std::string * @param value string representation of the value to be set */ void DataEntry::SetString(std::string const &value) @@ -495,7 +501,7 @@ void DataEntry::WriteContent(std::ofstream *fp, FileType filetype) return; //delimitors have NO value } - // --> We only deal with Little Endian writting + // --> We only deal with Little Endian writting. // --> forget Big Endian Transfer Syntax writting! // Next DICOM version will give it up ... @@ -516,8 +522,8 @@ void DataEntry::WriteContent(std::ofstream *fp, FileType filetype) uint8_t *data = BinArea; //safe notation size_t l = GetLength(); - gdcmDebugMacro ("in DataEntry::WriteContent " << GetKey() - << " : " << Global::GetVR()->GetAtomicElementLength(this->GetVR()) + gdcmDebugMacro("in DataEntry::WriteContent " << GetKey() << " AtomicLength: " + << Global::GetVR()->GetAtomicElementLength(this->GetVR() ) // << " BinArea in :" << &BinArea ); if (BinArea) // the binArea was *actually* loaded { @@ -534,7 +540,6 @@ void DataEntry::WriteContent(std::ofstream *fp, FileType filetype) } case 2: { -gdcmDebugMacro ("AtomicLength = 2 found; lgt =" << l); uint16_t *data16 = (uint16_t *)data; for(i=0;iseekp(l, std::ios::cur); // At Write time, for unloaded elems + } } // to avoid gdcm to propagate oddities // (length was already modified) if (l%2) - fp->seekp(1, std::ios::cur); + fp->seekp(1, std::ios::cur); // At Write time, for non even length elems } /** @@ -634,13 +642,8 @@ void DataEntry::Print(std::ostream &os, std::string const & ) v = GetString(); const VRKey &vr = GetVR(); - if( vr == "US" || vr == "SS" ) - s << " [" << GetString() << "]"; - else if( vr == "UL" || vr == "SL" ) - s << " [" << GetString() << "]"; - else if ( vr == "FL" ) - s << " [" << GetString() << "]"; - else if ( vr == "FD" ) + if( vr == "US" || vr == "SS" || vr == "UL" || vr == "SL" + || vr == "FL" || vr == "FD") s << " [" << GetString() << "]"; else {