X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkDicomInfo.cxx;h=202afc762feab842659b4421915b6faf74a4e275;hb=d4377ec80fd4e6f0156bb0673bb661acbf5b8cec;hp=303b1f5cd6056594090f73870d42f363c0e34a1f;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/tools/clitkDicomInfo.cxx b/tools/clitkDicomInfo.cxx index 303b1f5..202afc7 100644 --- a/tools/clitkDicomInfo.cxx +++ b/tools/clitkDicomInfo.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ /** ------------------------------------------------- * @file clitkDicomInfo.cxx @@ -28,6 +28,12 @@ // itk (gdcm) include #include "gdcmFile.h" +#if GDCM_MAJOR_VERSION == 2 +#include "gdcmReader.h" +#include "gdcmPrinter.h" +#include "gdcmDict.h" +#include "gdcmStringFilter.h" +#endif //-------------------------------------------------------------------- int main(int argc, char * argv[]) @@ -39,13 +45,61 @@ int main(int argc, char * argv[]) // check arg if (args_info.inputs_num == 0) return 0; + // Study ID + #if GDCM_MAJOR_VERSION == 2 + if (args_info.studyID_flag) { + std::set l; + for(unsigned int i=0; i tags; + gdcm::Tag StudyInstanceUIDTag(0x0020, 0x000d); + gdcm::Tag SeriesDateTag(0x0008, 0x0021); + tags.insert(StudyInstanceUIDTag); + tags.insert(SeriesDateTag); + if (reader.ReadSelectedTags(tags)) { + gdcm::StringFilter sf; + sf.SetFile(reader.GetFile()); + std::pair p = sf.ToStringPair(StudyInstanceUIDTag); + std::pair d = sf.ToStringPair(SeriesDateTag); + if (args_info.uniq_flag) { + if (l.insert(p.second).second == true) { + if (args_info.filename_flag) + std::cout << args_info.inputs[i] << " " << p.second << " " << d.second << std::endl; + else + std::cout << p.second << std::endl; + } + } + else { + if (args_info.filename_flag) + std::cout << args_info.inputs[i] << " " << p.second << " " << d.second << std::endl; + else + std::cout << p.second << std::endl; + } + } // tag not found + } + } +#endif + // Loop files + if (!args_info.studyID_flag) for(unsigned int i=0; iSetFileName(args_info.inputs[i]); - header->SetMaxSizeLoadEntry(16384); + header->SetMaxSizeLoadEntry(163840); header->Load(); header->Print(); +#endif } // this is the end my friend