Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2005/11/29 12:48:47 $
- Version: $Revision: 1.71 $
+ Date: $Date: 2006/01/31 11:39:47 $
+ Version: $Revision: 1.72 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
}
+/**
+ * \brief Checks whether *all* the DataEntries of the group have all
+ * the same type for VR (ImplicitVR or ExplicitVR)
+ * @param group group number to be checked
+ * @return 1:ImplicitVR 2:ExplicitVR -1:NotCoherent
+ */
+int ElementSet::IsVRCoherent( uint16_t group )
+{
+ uint16_t currentGroup;
+ int codeVR = -1;
+ int currentCodeVR;
+ for(TagDocEntryHT::iterator cc = TagHT.begin();cc != TagHT.end(); ++cc)
+ {
+ currentGroup = cc->second->GetGroup();
+
+ if ( currentGroup < group )
+ continue;
+ if ( currentGroup > group )
+ break;
+ // currentGroup == group
+ if (codeVR == -1)
+ {
+ if (cc->second->IsImplicitVR() )
+ codeVR = 1;
+ else
+ codeVR = 2;
+ continue;
+ }
+ else
+ {
+ if (cc->second->IsImplicitVR() )
+ currentCodeVR = 1; //Implicit
+ else
+ currentCodeVR = 2; // Explicit
+
+ if ( currentCodeVR == codeVR )
+ continue;
+ else
+ return -1; // -1 : not coherent
+ }
+ }
+ return codeVR;
+}
+
+
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmElementSet.h,v $
Language: C++
- Date: $Date: 2005/11/29 12:48:47 $
- Version: $Revision: 1.53 $
+ Date: $Date: 2006/01/31 11:39:47 $
+ Version: $Revision: 1.54 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
/// Tells us if the ElementSet contains no entry
bool IsEmpty() { return TagHT.empty(); }
+
+ int IsVRCoherent(uint16_t group);
virtual void Copy(DocEntrySet *set);