X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestSerieHelper.cxx;h=76ef8544bd0ced67b3f17f1272c29af9138f19be;hb=02e5b298070faff881e584dd818d85bfc05e92bf;hp=e8b6a31325d443c851366ffd7299560e6adf9744;hpb=0628dcb30529c5cab0ed002fc10bfc0cdc3a5a47;p=gdcm.git diff --git a/Testing/TestSerieHelper.cxx b/Testing/TestSerieHelper.cxx index e8b6a313..76ef8544 100644 --- a/Testing/TestSerieHelper.cxx +++ b/Testing/TestSerieHelper.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestSerieHelper.cxx,v $ Language: C++ - Date: $Date: 2005/02/05 01:25:45 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/07/17 04:25:12 $ + Version: $Revision: 1.6 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -35,36 +35,58 @@ int TestSerieHelper(int argc, char *argv[]) //if (argc > 2) // gdcm::Debug::DebugOn(); + std::cout << "Dir Name :[" << dirName << "]" << std::endl; s = new gdcm::SerieHelper(); - s->SetDirectory(dirName, true); // true : recursive exploration - std::cout << " -------------------------------------------Finish parsing :[" + s->SetLoadMode(0x00000000); // Load everything for each File + //s->AddRestriction(tagKey, valueToCheck); // Keep only files where + // restriction is true + s->SetDirectory(dirName, true); // true : recursive exploration + std::cout << " ---------------------------------------- Finish parsing :[" << dirName << "]" << std::endl; s->Print(); - std::cout << " -----------------------------------------Finish printing (1)" + std::cout << " ---------------------------------------- Finish printing (1)" << std::endl; int nbFiles; // For all the Coherent Files lists of the gdcm::Serie - gdcm::GdcmFileList *l = s->GetFirstCoherentFileList(); + gdcm::FileList *l = s->GetFirstCoherentFileList(); while (l) { nbFiles = l->size() ; if ( l->size() > 3 ) // Why not ? Just an example, for testing { std::cout << "Sort list : " << nbFiles << " long" << std::endl; - s->OrderGdcmFileList(l); // sort the list + s->OrderFileList(l); // sort the list } l = s->GetNextCoherentFileList(); } - std::cout << " ----------------------------------------------Finish sorting" + std::cout << " -------------------------------------------- Finish sorting" << std::endl; s->Print(); // Prints all the Coherent Files lists (sorted or not) - std::cout << " ---------------------------------------------Finish printing" + std::cout << " -------------------------------------------- Finish printing" << std::endl; + + // Only for the first Coherent File List + // ( Why not ? Just an example, for testing ) + // Display all the file names + + std::string fileName; + l = s->GetFirstCoherentFileList(); + for (std::vector::iterator it = l->begin(); + it != l->end(); + ++it) + { + fileName = (*it)->GetFileName(); + std::cout << fileName << std::endl; + // Remark : vtkGdcmReader users can use this loop to AddFileName(fileName) + // in the right order + } + + delete s; return 0;