Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/08/31 14:24:47 $
- Version: $Revision: 1.69 $
+ Date: $Date: 2004/09/07 13:57:04 $
+ Version: $Revision: 1.71 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
uint16_t elem )
{
gdcmValEntry* valEntry = 0;
-
gdcmDocEntry* currentEntry = GetDocEntryByNumber( group, elem);
+
if (!currentEntry)
{
// The entry wasn't present and we simply create the required ValEntry:
* \brief Checks if a given Dicom Element exists within the H table
* @param group Group number of the searched Dicom Element
* @param element Element number of the searched Dicom Element
- * @return number of occurences
+ * @return true is found
*/
-int gdcmDocument::CheckIfEntryExistByNumber(uint16_t group, uint16_t element )
+bool gdcmDocument::CheckIfEntryExistByNumber(uint16_t group, uint16_t element )
{
const std::string &key = gdcmDictEntry::TranslateToKey(group, element );
return TagHT.count(key);
gdcmVRKey vr = valEntry->GetVR();
if( vr == "US" || vr == "SS" )
{
- valEntry->SetLength(2);
+ int c = CountSubstring(content, "\\"); // for multivaluated items
+ valEntry->SetLength((c+1)*2);
}
else if( vr == "UL" || vr == "SL" )
{
- valEntry->SetLength(4);
+ int c = CountSubstring(content, "\\"); // for multivaluated items
+ valEntry->SetLength((c+1)*4);
}
else
{