X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageCommon.cxx;h=f5a8d3c813fbdc1e873693369e29f032e4ae6117;hb=495aeaf7af1cb34b0a87edf7f8de51440e0c2236;hp=cfcbbe34225b3034adab9770bf127e92bfeb1f69;hpb=1361e8457bdc0d189ab0d44530a20cc2d5e04393;p=clitk.git diff --git a/common/clitkImageCommon.cxx b/common/clitkImageCommon.cxx index cfcbbe3..f5a8d3c 100644 --- a/common/clitkImageCommon.cxx +++ b/common/clitkImageCommon.cxx @@ -63,6 +63,13 @@ void clitk::ReadImageDimensionAndPixelType(const std::string & filename, gdcm::File * clitk::readDicomHeader(const std::string & filename, const bool verbose) { +#if GDCM_MAJOR_VERSION == 2 + gdcm::Reader hreader; + hreader.SetFileName(filename.c_str()); + hreader.Read(); + gdcm::SmartPointer p = hreader.GetFile(); + return p; +#else if (verbose) { std::cout << "Reading DICOM <" << filename << ">" << std::endl; } @@ -71,6 +78,7 @@ gdcm::File * clitk::readDicomHeader(const std::string & filename, header->SetMaxSizeLoadEntry(16384); // required ? header->Load(); return header; +#endif } ///--------------------------------------------------------------------