X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestDicomDir.cxx;h=6039f22a4b041cf6fbdb9b41c57b117a2637248e;hb=315440762bb5f22f9f2e39a4b2993ce585e1e320;hp=dc21f559cf3be004a70611577a688eb77afa0d6f;hpb=b746e20eb22f7032673d36a34d672d1913a7daad;p=gdcm.git diff --git a/Testing/TestDicomDir.cxx b/Testing/TestDicomDir.cxx index dc21f559..6039f22a 100644 --- a/Testing/TestDicomDir.cxx +++ b/Testing/TestDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/01/31 12:36:59 $ - Version: $Revision: 1.36 $ + Date: $Date: 2005/02/03 10:00:06 $ + Version: $Revision: 1.38 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -39,9 +39,10 @@ int CompareSQItem(gdcm::SQItem *pa1, gdcm::SQItem *pa2 ) { // locate the corresponding element in 'source' file e1 = pa1->GetDocEntry( e2->GetGroup(),e2->GetElement() ); + + // an element doesn't exist in origin file if (!e1) { - // an element doesn't exist in source file std::cout << "DicomDir element " << std::hex << e2->GetGroup() << "," <GetElement() << std::endl; return 1; @@ -51,9 +52,21 @@ int CompareSQItem(gdcm::SQItem *pa1, gdcm::SQItem *pa2 ) !dynamic_cast(e2) ) continue; + // a value is read as GDCM_UNFOUND + if ( ((gdcm::ValEntry*)e1)->GetValue() == gdcm::GDCM_UNFOUND ) + { + std::cout << "for gdcm source DicomDir : element (" << std::hex + << e1->GetGroup() << "," <GetElement() + << ") has values [" << gdcm::GDCM_UNFOUND << "]" + << std::endl; + return 1; + } + + // values differ in source file and destination file if ( ((gdcm::ValEntry*)e1)->GetValue() != ((gdcm::ValEntry*)e2)->GetValue() ) { + // serious trouble : values differ in source and destination file std::cout << "for gdcm DicomDir element (" << std::hex << e2->GetGroup() << "," <GetElement() @@ -67,14 +80,14 @@ int CompareSQItem(gdcm::SQItem *pa1, gdcm::SQItem *pa2 ) return 0; } -int TestDicomDir(int argc, char* argv[]) +int TestDicomDir(int argc, char *argv[]) { gdcm::DicomDir *dicomdir; - gdcm::DicomDirPatient * pa1; - gdcm::DicomDirStudy *st1; - gdcm::DicomDirSerie *se1; - gdcm::DicomDirImage *im1; + gdcm::DicomDirPatient *pa1; + gdcm::DicomDirStudy *st1; + gdcm::DicomDirSerie *se1; + gdcm::DicomDirImage *im1; gdcm::TSKey v; @@ -185,9 +198,9 @@ int TestDicomDir(int argc, char* argv[]) << std::endl<< std::endl; gdcm::DicomDirPatient *pa2; - gdcm::DicomDirStudy *st2; - gdcm::DicomDirSerie *se2; - gdcm::DicomDirImage *im2; + gdcm::DicomDirStudy *st2; + gdcm::DicomDirSerie *se2; + gdcm::DicomDirImage *im2; pa1 = dicomdir->GetFirstPatient(); pa2 = d2->GetFirstPatient();