1 /*=========================================================================
4 Module: $RCSfile: gdcmValidator.cxx,v $
6 Date: $Date: 2005/06/14 20:33:54 $
7 Version: $Revision: 1.1 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #include "gdcmValidator.h"
20 #include "gdcmElementSet.h"
21 #include "gdcmBinEntry.h"
22 #include "gdcmValEntry.h"
27 Validator::Validator()
31 Validator::~Validator()
35 // Function to compare the VM found while parsing d->GetValue()
36 // compare to the one from the dictionary
37 bool CheckVM(ValEntry *v)
39 const std::string &s = v->GetValue();
40 std::string::size_type n = s.find("\\");
41 if (n == s.npos) // none found
45 n++; //poteaux / intervalles
47 unsigned int m = atoi(v->GetVM().c_str());
52 void Validator::SetInput(ElementSet *input)
54 // berk for now SetInput do two things at the same time
55 gdcm::DocEntry *d=input->GetFirstEntry();
58 if ( gdcm::BinEntry *b = dynamic_cast<gdcm::BinEntry*>(d) )
60 // copyH->InsertBinEntry( b->GetBinArea(),b->GetLength(),
61 // b->GetGroup(),b->GetElement(),
65 else if ( gdcm::ValEntry *v = dynamic_cast<gdcm::ValEntry*>(d) )
69 std::cout << "Rah this DICOM contains one wrong tag:" <<
70 v->GetValue() << " " <<
71 v->GetGroup() << "," << v->GetElement() << "," <<
72 v->GetVR() << " " << v->GetVM() << " " << v->GetName() << std::endl;
77 // We skip pb of SQ recursive exploration
79 d=input->GetNextEntry();
83 } // end namespace gdcm