X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmVR.cxx;h=66006a86f1971b9749ee32dfbca6a8e7b4f31169;hb=251590eb8bbe0635858d05909052d11c6a7ba490;hp=02eb2c893f34d1717cd805b9da998417e85e4a8f;hpb=616fe6757e5e27ce6ebb48e9e3bf3b42ab15be1c;p=gdcm.git diff --git a/src/gdcmVR.cxx b/src/gdcmVR.cxx index 02eb2c89..66006a86 100644 --- a/src/gdcmVR.cxx +++ b/src/gdcmVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmVR.cxx,v $ Language: C++ - Date: $Date: 2004/11/03 18:08:56 $ - Version: $Revision: 1.22 $ + Date: $Date: 2005/01/06 13:35:38 $ + Version: $Revision: 1.25 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -117,10 +117,10 @@ bool VR::IsVROfGdcmBinaryRepresentable(VRKey const & tested) //std::cout << "VR::IsVROfGdcmBinaryRepresentable====================" // << tested << std::endl; - if ( tested == "unkn") + if ( tested == GDCM_UNKNOWN) return true; - if ( ! Count(tested) ) + if ( ! IsValidVR(tested) ) { dbg.Verbose(0, "VR::IsVROfGdcmBinaryRepresentable: tested not a VR!"); return false; @@ -145,23 +145,41 @@ bool VR::IsVROfGdcmBinaryRepresentable(VRKey const & tested) bool VR::IsVROfGdcmStringRepresentable(VRKey const & tested) { - if ( ! Count(tested) ) + if ( ! IsValidVR(tested) ) { dbg.Verbose(0, "VR::IsVROfGdcmStringRepresentable: tested not a VR!"); return false; } - if (tested == "AE" || tested == "AS" || tested == "DA" || tested == "PN" || - tested == "UI" || tested == "TM" || tested == "SH" || tested == "LO" || - tested == "CS" || tested == "IS" || tested == "LO" || tested == "LT" || - tested == "SH" || tested == "ST" || tested == "DS" || tested == "SL" || - tested == "SS" || tested == "UL" || tested == "US" || tested == "UN") + if ( tested == "AE" || + tested == "AS" || + tested == "CS" || + tested == "DA" || + tested == "DS" || + tested == "IS" || + tested == "LO" || + tested == "LT" || + tested == "PN" || + tested == "SH" || + tested == "SL" || + tested == "SS" || + tested == "ST" || + tested == "TM" || + tested == "UI" || + tested == "UL" || + tested == "UN" || + tested == "US" ) { return true; } return false; } +bool VR::IsValidVR(VRKey const & key) +{ + return(vr.find(key)!=vr.end()); +} + //----------------------------------------------------------------------------- // Protected