Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2005/10/21 15:16:52 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/10/21 15:52:13 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool valid = false;
uint32_t vm;
const std::string &strVM = GetVM();
+ uint32_t vc = GetValueCount();
if( strVM == "1-n" )
{
// make sure it is at least one ??? FIXME
- valid = GetValueCount() >= 1;
+ valid = vc >= 1 || vc == 0;
}
else
{
std::istringstream os;
os.str( strVM );
os >> vm;
- valid = vm == GetValueCount();
+ // Two cases:
+ // vm respect the one from the dict
+ // vm is 0 (we need to check is this element is allowed to be empty) FIXME
+ valid = vc == vm || vc == 0;
}
return valid;
}
return GetLength()/sizeof(double);
else if( Global::GetVR()->IsVROfStringRepresentable(vr) )
{
+ // Some element in DICOM are allowed to be empty
+ if( !GetLength() ) return 0;
// Don't use std::string to accelerate processing
uint32_t count = 1;
for(uint32_t i=0;i<GetLength();i++)