X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmVR.cxx;h=77bbf2313bea542f05c03e027f7fcb9587f2307e;hb=97811f429fdf36ed2d7404e41ce7817c65e96e32;hp=57b9301614d4d17d3c013eb8665406f0c4d812de;hpb=55e7ee6570c585377084dc59d134b2e99964b7dd;p=gdcm.git diff --git a/src/gdcmVR.cxx b/src/gdcmVR.cxx index 57b93016..77bbf231 100644 --- a/src/gdcmVR.cxx +++ b/src/gdcmVR.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmVR.cxx,v $ Language: C++ - Date: $Date: 2005/09/07 14:12:23 $ - Version: $Revision: 1.40 $ + Date: $Date: 2005/10/18 08:35:51 $ + Version: $Revision: 1.41 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -85,7 +85,7 @@ VR::~VR() /** * \brief Simple predicate that checks whether the given argument - * corresponds to the Value Representation of a \ref BinEntry . + * corresponds to the Value Representation of a \ref DataEntry . * @param tested value representation to check for. */ bool VR::IsVROfBinaryRepresentable(VRKey const &tested) @@ -108,14 +108,12 @@ bool VR::IsVROfBinaryRepresentable(VRKey const &tested) /** * \brief Simple predicate that checks whether the given argument - * corresponds to the Value Representation of a \ref ValEntry - * but NOT a \ref BinEntry. + * corresponds to the Value Representation of a representable + * string. * @param tested value representation to be checked. */ bool VR::IsVROfStringRepresentable(VRKey const &tested) { - - return tested == "AE" || tested == "AS" || tested == "CS" || @@ -146,6 +144,26 @@ bool VR::IsVROfStringRepresentable(VRKey const &tested) */ } +unsigned short VR::GetAtomicElementLength(VRKey const &vr) +{ + // Unsigned & signed short + if( vr == "US" || vr == "SS" ) + return 2; + // Unsigned & signed long + if( vr == "UL" || vr == "SL" ) + return 4; + // Float + if( vr == "FL" ) + return 4; + // Double + if( vr == "FD" ) + return 8; + // Word string + if( vr == "OW" ) + return 2; + return 1; +} + //----------------------------------------------------------------------------- // Protected