diff -Nru gdcm-3.0.10/Applications/Cxx/CMakeLists.txt gdcm-3.0.14/Applications/Cxx/CMakeLists.txt --- gdcm-3.0.10/Applications/Cxx/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -46,6 +46,7 @@ gdcmraw gdcmscanner gdcmanon + gdcmclean gdcmgendir #gdcmoverlay gdcmimg @@ -115,6 +116,12 @@ if(LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE) list(APPEND libpoppler_flags -DLIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE) endif() + CHECK_CXX_SOURCE_COMPILES( + "\#include \nint main() { std::optional ownerPW, userPW; PDFDoc d((BaseStream*)nullptr,ownerPW,userPW); return 0;}" + LIBPOPPLER_PDFDOC_HAS_OPTIONAL) + if(LIBPOPPLER_PDFDOC_HAS_OPTIONAL) + list(APPEND libpoppler_flags -DLIBPOPPLER_PDFDOC_HAS_OPTIONAL) + endif() if(libpoppler_flags) string(REPLACE ";" " " libpoppler_flags_string "${libpoppler_flags}") set_source_files_properties( diff -Nru gdcm-3.0.10/Applications/Cxx/gdcmanon.cxx gdcm-3.0.14/Applications/Cxx/gdcmanon.cxx --- gdcm-3.0.10/Applications/Cxx/gdcmanon.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcmanon.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -45,7 +45,9 @@ static bool AnonymizeOneFileDumb(gdcm::Anonymizer &anon, const char *filename, const char *outfilename, - std::vector const &empty_tags, std::vector const &remove_tags, std::vector< std::pair > const & replace_tags, bool continuemode = false) + std::vector const &empty_tags, std::vector const &clear_tags, std::vector const &remove_tags, std::vector< std::pair > const & replace_tags, + std::vector const &empty_privatetags, std::vector const &clear_privatetags, std::vector const &remove_privatetags, std::vector< std::pair > const & replace_privatetags, + bool continuemode = false) { gdcm::Reader reader; reader.SetFileName( filename ); @@ -67,29 +69,66 @@ anon.SetFile( file ); - if( empty_tags.empty() && replace_tags.empty() && remove_tags.empty() ) + if( empty_tags.empty() && clear_tags.empty() && replace_tags.empty() && remove_tags.empty() + && empty_privatetags.empty() && clear_privatetags.empty() && replace_privatetags.empty() && remove_privatetags.empty() ) { - std::cerr << "No operation to be done." << std::endl; + std::cerr << "No operation(s) to be done." << std::endl; return false; } - std::vector::const_iterator it = empty_tags.begin(); bool success = true; - for(; it != empty_tags.end(); ++it) + // Private Creator(s) must be done first: +{ + std::vector< std::pair >::const_iterator it2 = replace_tags.begin(); + for(; it2 != replace_tags.end(); ++it2) + { + success = success && anon.Replace( it2->first, it2->second.c_str() ); + } +} + + // Regular Private: +{ + std::vector::const_iterator it = empty_privatetags.begin(); + for(; it != empty_privatetags.end(); ++it) { success = success && anon.Empty( *it ); } - it = remove_tags.begin(); - for(; it != remove_tags.end(); ++it) + it = clear_privatetags.begin(); + for(; it != clear_privatetags.end(); ++it) + { + success = success && anon.Clear( *it ); + } + it = remove_privatetags.begin(); + for(; it != remove_privatetags.end(); ++it) { success = success && anon.Remove( *it ); } - std::vector< std::pair >::const_iterator it2 = replace_tags.begin(); - for(; it2 != replace_tags.end(); ++it2) + std::vector< std::pair >::const_iterator it2 = replace_privatetags.begin(); + for(; it2 != replace_privatetags.end(); ++it2) { success = success && anon.Replace( it2->first, it2->second.c_str() ); } +} + + // Public Remove or Empty may impact Private Creator, so do them last. +{ + std::vector::const_iterator it = empty_tags.begin(); + for(; it != empty_tags.end(); ++it) + { + success = success && anon.Empty( *it ); + } + it = clear_tags.begin(); + for(; it != clear_tags.end(); ++it) + { + success = success && anon.Clear( *it ); + } + it = remove_tags.begin(); + for(; it != remove_tags.end(); ++it) + { + success = success && anon.Remove( *it ); + } +} gdcm::Writer writer; writer.SetFileName( outfilename ); @@ -237,8 +276,13 @@ std::cout << " --aes256 AES 256 (default)." << std::endl; std::cout << "Dumb mode options:" << std::endl; std::cout << " --empty %d,%d DICOM tag(s) to empty" << std::endl; + std::cout << " %d,%d,%s DICOM private tag(s) to empty" << std::endl; + std::cout << " --clear %d,%d DICOM tag(s) to clear" << std::endl; + std::cout << " %d,%d,%s DICOM private tag(s) to clear" << std::endl; std::cout << " --remove %d,%d DICOM tag(s) to remove" << std::endl; + std::cout << " %d,%d,%s DICOM private tag(s) to remove" << std::endl; std::cout << " --replace %d,%d=%s DICOM tag(s) to replace" << std::endl; + std::cout << " %d,%d,%s=%s DICOM private tag(s) to replace" << std::endl; std::cout << "General Options:" << std::endl; std::cout << " -V --verbose more verbose (warning+error)." << std::endl; std::cout << " -W --warning print warning info." << std::endl; @@ -308,13 +352,20 @@ int recursive = 0; int continuemode = 0; int empty_tag = 0; + int clear_tag = 0; int remove_tag = 0; int replace_tag = 0; int crypto_api = 0; std::vector empty_tags; + std::vector clear_tags; std::vector remove_tags; std::vector< std::pair > replace_tags_value; + std::vector empty_privatetags; + std::vector clear_privatetags; + std::vector remove_privatetags; + std::vector< std::pair > replace_privatetags_value; gdcm::Tag tag; + gdcm::PrivateTag privatetag; gdcm::CryptoFactory::CryptoLib crypto_lib; crypto_lib = gdcm::CryptoFactory::DEFAULT; @@ -340,10 +391,11 @@ {"recursive", no_argument, nullptr, 'r'}, {"dumb", no_argument, &dumb_mode, 1}, {"empty", required_argument, &empty_tag, 1}, // 15 + {"clear", required_argument, &clear_tag, 1}, // 16 {"remove", required_argument, &remove_tag, 1}, {"replace", required_argument, &replace_tag, 1}, {"continue", no_argument, &continuemode, 1}, - {"crypto", required_argument, &crypto_api, 1}, //19 + {"crypto", required_argument, &crypto_api, 1}, //20 {"verbose", no_argument, nullptr, 'V'}, {"warning", no_argument, nullptr, 'W'}, @@ -409,49 +461,75 @@ else if( option_index == 15 ) /* empty */ { assert( strcmp(s, "empty") == 0 ); - if( !tag.ReadFromCommaSeparatedString(optarg) ) + if( privatetag.ReadFromCommaSeparatedString(optarg) ) + empty_privatetags.push_back( privatetag ); + else if( tag.ReadFromCommaSeparatedString(optarg) ) + empty_tags.push_back( tag ); + else { - std::cerr << "Could not read Tag: " << optarg << std::endl; + std::cerr << "Could not read Tag/PrivateTag: " << optarg << std::endl; return 1; } - empty_tags.push_back( tag ); } - else if( option_index == 16 ) /* remove */ + else if( option_index == 16 ) /* clear */ + { + assert( strcmp(s, "clear") == 0 ); + if( privatetag.ReadFromCommaSeparatedString(optarg) ) + clear_privatetags.push_back( privatetag ); + else if( tag.ReadFromCommaSeparatedString(optarg) ) + clear_tags.push_back( tag ); + else + { + std::cerr << "Could not read Tag/PrivateTag: " << optarg << std::endl; + return 1; + } + } + else if( option_index == 17 ) /* remove */ { assert( strcmp(s, "remove") == 0 ); - if( !tag.ReadFromCommaSeparatedString(optarg) ) + if( privatetag.ReadFromCommaSeparatedString(optarg) ) + remove_privatetags.push_back( privatetag ); + else if( tag.ReadFromCommaSeparatedString(optarg) ) + remove_tags.push_back( tag ); + else { - std::cerr << "Could not read Tag: " << optarg << std::endl; + std::cerr << "Could not read Tag/PrivateTag: " << optarg << std::endl; return 1; } - remove_tags.push_back( tag ); } - else if( option_index == 17 ) /* replace */ + else if( option_index == 18 ) /* replace */ { assert( strcmp(s, "replace") == 0 ); - if( !tag.ReadFromCommaSeparatedString(optarg) ) + if( privatetag.ReadFromCommaSeparatedString(optarg) ) + { + return 1; + } + else if( tag.ReadFromCommaSeparatedString(optarg) ) + { + std::stringstream ss; + ss.str( optarg ); + uint16_t dummy; + char cdummy; // comma + ss >> std::hex >> dummy; + assert( tag.GetGroup() == dummy ); + ss >> cdummy; + assert( cdummy == ',' ); + ss >> std::hex >> dummy; + assert( tag.GetElement() == dummy ); + ss >> cdummy; + assert( cdummy == ',' || cdummy == '=' ); + std::string str; + //ss >> str; + std::getline(ss, str); // do not skip whitespace + replace_tags_value.emplace_back(tag, str ); + } + else { - std::cerr << "Could not read Tag: " << optarg << std::endl; + std::cerr << "Could not read Tag/PrivateTag: " << optarg << std::endl; return 1; } - std::stringstream ss; - ss.str( optarg ); - uint16_t dummy; - char cdummy; // comma - ss >> std::hex >> dummy; - assert( tag.GetGroup() == dummy ); - ss >> cdummy; - assert( cdummy == ',' ); - ss >> std::hex >> dummy; - assert( tag.GetElement() == dummy ); - ss >> cdummy; - assert( cdummy == ',' || cdummy == '=' ); - std::string str; - //ss >> str; - std::getline(ss, str); // do not skip whitespace - replace_tags_value.emplace_back(tag, str ); } - else if( option_index == 19 ) /* crypto */ + else if( option_index == 20 ) /* crypto */ { assert( strcmp(s, "crypto") == 0 ); if (strcmp(optarg, "openssl") == 0) @@ -811,7 +889,8 @@ { const char *in = filenames[i].c_str(); const char *out = outfilenames[i].c_str(); - if( !AnonymizeOneFileDumb(anon, in, out, empty_tags, remove_tags, replace_tags_value, (continuemode > 0 ? true: false)) ) + if( !AnonymizeOneFileDumb(anon, in, out, empty_tags, clear_tags, remove_tags, replace_tags_value, + empty_privatetags, clear_privatetags, remove_privatetags, replace_privatetags_value, (continuemode > 0 ? true: false)) ) { //std::cerr << "Could not anonymize: " << in << std::endl; delete cms_ptr; diff -Nru gdcm-3.0.10/Applications/Cxx/gdcmclean.cxx gdcm-3.0.14/Applications/Cxx/gdcmclean.cxx --- gdcm-3.0.10/Applications/Cxx/gdcmclean.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcmclean.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,544 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/* + */ +#include "gdcmCSAHeader.h" +#include "gdcmCleaner.h" +#include "gdcmDPath.h" +#include "gdcmDefs.h" +#include "gdcmDict.h" +#include "gdcmDicts.h" +#include "gdcmDirectory.h" +#include "gdcmGlobal.h" +#include "gdcmReader.h" +#include "gdcmSystem.h" +#include "gdcmVR.h" +#include "gdcmVersion.h" +#include "gdcmWriter.h" + +#include +#include + +static void PrintVersion() { + std::cout << "gdcmclean: gdcm " << gdcm::Version::GetVersion() << " "; + const char date[] = "$Date$"; + std::cout << date << std::endl; +} + +static bool CleanOneFile(gdcm::Cleaner &cleaner, const char *filename, + const char *outfilename, bool skipmeta, + bool continuemode = false) { + gdcm::Reader reader; + reader.SetFileName(filename); + if (!reader.Read()) { + std::cerr << "Could not read : " << filename << std::endl; + if (continuemode) { + std::cerr << "Skipping from cleaning process (continue mode)." + << std::endl; + return true; + } else { + std::cerr << "Check [--continue] option for skipping files." << std::endl; + return false; + } + } + gdcm::File &file = reader.GetFile(); + cleaner.SetFile(file); + if (!cleaner.Clean()) { + std::cerr << "Could not clean: " << filename << std::endl; + if (continuemode) { + std::cerr << "Skipping from cleaning process (continue mode)." + << std::endl; + return true; + } else { + std::cerr << "Check [--continue] option for skipping files." << std::endl; + return false; + } + } + + gdcm::Writer writer; + writer.SetFileName(outfilename); + writer.SetCheckFileMetaInformation(!skipmeta); + writer.SetFile(file); + if (!writer.Write()) { + std::cerr << "Could not Write : " << outfilename << std::endl; + if (strcmp(filename, outfilename) != 0) { + gdcm::System::RemoveFile(outfilename); + } else { + std::cerr << "gdcmclean just corrupted: " << filename + << " for you (data lost)." << std::endl; + } + return false; + } + return true; +} + +static inline bool isValidPublicKeyword(const char *keyword, gdcm::Tag &tag) { + static const gdcm::Global &g = gdcm::Global::GetInstance(); + static const gdcm::Dicts &dicts = g.GetDicts(); + static const gdcm::Dict &pubdict = dicts.GetPublicDict(); + + pubdict.GetDictEntryByKeyword(keyword, tag); + if (tag != gdcm::Tag(0xffff, 0xffff)) return true; + return false; +} + +static void PrintHelp() { + PrintVersion(); + std::cout << "Usage: gdcmclean [OPTION]... FILE..." << std::endl; + std::cout << "Options:" << std::endl; + std::cout << " -i --input DICOM filename / directory" + << std::endl; + std::cout << " -o --output DICOM filename / directory" + << std::endl; + std::cout + << " -r --recursive recursively process (sub-)directories." + << std::endl; + std::cout << " --continue Do not stop when file found is " + "not DICOM." + << std::endl; + std::cout << "Edition options:" << std::endl; + std::cout << " --empty %d,%d DICOM tag(s) to empty" + << std::endl; + std::cout << " %d,%d,%s DICOM private tag(s) to empty" + << std::endl; + std::cout << " %s DICOM keyword/path(s) to empty" + << std::endl; + std::cout << " --remove %d,%d DICOM tag(s) to remove" + << std::endl; + std::cout << " %d,%d,%s DICOM private tag(s) to remove" + << std::endl; + std::cout << " %s DICOM keyword/path(s) to remove" + << std::endl; + std::cout << " --scrub %d,%d DICOM tag(s) to scrub" + << std::endl; + std::cout << " %d,%d,%s DICOM private tag(s) to scrub" + << std::endl; + std::cout << " %s DICOM keyword/path(s) to scrub" + << std::endl; + std::cout << " --preserve %s DICOM path(s) to preserve" + << std::endl; + std::cout << " --preserve-missing-private-creator Whether or " + "not preserve private attributes with missing private creator." + << std::endl; + std::cout << " --preserve-group-length Whether or " + "not preserve deprecated group length attributes (will not be " + "re-computed)." + << std::endl; + std::cout << " --preserve-illegal Whether or " + "not preserve illegal attributes (eg. group 0003...)." + << std::endl; + std::cout << "General Options:" << std::endl; + std::cout << " -V --verbose more verbose (warning+error)." + << std::endl; + std::cout << " -W --warning print warning info." << std::endl; + std::cout << " -D --debug print debug info." << std::endl; + std::cout << " -E --error print error info." << std::endl; + std::cout << " -h --help print help." << std::endl; + std::cout << " -v --version print version." << std::endl; +} + +int main(int argc, char *argv[]) { + int c; + + std::string filename; + gdcm::Directory::FilenamesType filenames; + std::string outfilename; + gdcm::Directory::FilenamesType outfilenames; + int skipmeta = 0; + int continuemode = 0; + int verbose = 0; + int warning = 0; + int debug = 0; + int error = 0; + int help = 0; + int version = 0; + int recursive = 0; + int empty_tag = 0; + int remove_tag = 0; + int scrub_tag = 0; + int preserve_tag = 0; + int preserveAllMissingPrivateCreator = 0; + int preserveAllGroupLength = 0; + int preserveAllIllegal = 0; + std::vector empty_dpaths; + std::vector remove_dpaths; + std::vector scrub_dpaths; + std::vector preserve_dpaths; + std::vector empty_vrs; + std::vector empty_tags; + std::vector empty_privatetags; + std::vector remove_vrs; + std::vector remove_tags; + std::vector remove_privatetags; + std::vector scrub_tags; // clean-digital-trash + std::vector scrub_privatetags; // clean-digital-trash + gdcm::Tag tag; + gdcm::PrivateTag privatetag; + gdcm::DPath dpath; + + while (1) { + // int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = { + {"input", required_argument, NULL, 'i'}, // i + {"output", required_argument, NULL, 'o'}, // o + {"recursive", no_argument, NULL, 'r'}, + {"empty", required_argument, &empty_tag, 1}, // 3 + {"remove", required_argument, &remove_tag, 1}, // 4 + {"scrub", required_argument, &scrub_tag, 1}, // 5 + {"preserve", required_argument, &preserve_tag, 1}, // 5 + {"continue", no_argument, NULL, 'c'}, + {"skip-meta", 0, &skipmeta, 1}, // should I document this one ? + {"preserve-missing-private-creator", 0, + &preserveAllMissingPrivateCreator, 1}, // + {"preserve-group-length", 0, &preserveAllGroupLength, 1}, // + {"preserve-illegal", 0, &preserveAllIllegal, 1}, // + + {"verbose", no_argument, NULL, 'V'}, + {"warning", no_argument, NULL, 'W'}, + {"debug", no_argument, NULL, 'D'}, + {"error", no_argument, NULL, 'E'}, + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'v'}, + + {0, 0, 0, 0}}; + + c = getopt_long(argc, argv, "i:o:rcVWDEhv", long_options, &option_index); + if (c == -1) { + break; + } + + switch (c) { + case 0: { + const char *s = long_options[option_index].name; + (void)s; + if (optarg) { + if (option_index == 3) /* empty */ + { + assert(strcmp(s, "empty") == 0); + if (gdcm::VR::IsValid(optarg)) + empty_vrs.push_back(gdcm::VR::GetVRTypeFromFile(optarg)); + else if (privatetag.ReadFromCommaSeparatedString(optarg)) + empty_privatetags.push_back(privatetag); + else if (tag.ReadFromCommaSeparatedString(optarg)) + empty_tags.push_back(tag); + else if (isValidPublicKeyword(optarg, tag)) + empty_tags.push_back(tag); + else if (dpath.ConstructFromString(optarg)) + empty_dpaths.push_back(dpath); + else { + std::cerr << "Could not read Tag/PrivateTag/DPath: " << optarg + << std::endl; + return 1; + } + + } else if (option_index == 4) /* remove */ + { + if (gdcm::VR::IsValid(optarg)) + remove_vrs.push_back(gdcm::VR::GetVRTypeFromFile(optarg)); + if (privatetag.ReadFromCommaSeparatedString(optarg)) + remove_privatetags.push_back(privatetag); + else if (tag.ReadFromCommaSeparatedString(optarg)) + remove_tags.push_back(tag); + else if (isValidPublicKeyword(optarg, tag)) + remove_tags.push_back(tag); + else if (dpath.ConstructFromString(optarg)) + remove_dpaths.push_back(dpath); + else { + std::cerr << "Could not read Tag/PrivateTag/DPath: " << optarg + << std::endl; + return 1; + } + + } else if (option_index == 5) /* scrub */ + { + if (privatetag.ReadFromCommaSeparatedString(optarg)) + scrub_privatetags.push_back(privatetag); + else if (tag.ReadFromCommaSeparatedString(optarg)) + scrub_tags.push_back(tag); + else if (isValidPublicKeyword(optarg, tag)) + scrub_tags.push_back(tag); + else { + std::cerr << "Could not read Tag/PrivateTag/DPath: " << optarg + << std::endl; + return 1; + } + } else if (option_index == 6) /* preserve */ + { + if (dpath.ConstructFromString(optarg)) + preserve_dpaths.push_back(dpath); + else { + std::cerr << "Could not read DPath: " << optarg << std::endl; + return 1; + } + } else { + assert(0); + } + } + } break; + + case 'i': + assert(filename.empty()); + filename = optarg; + break; + + case 'o': + assert(outfilename.empty()); + outfilename = optarg; + break; + + case 'c': + continuemode = 1; + break; + + case 'r': + recursive = 1; + break; + + case 'V': + verbose = 1; + break; + + case 'W': + warning = 1; + break; + + case 'D': + debug = 1; + break; + + case 'E': + error = 1; + break; + + case 'h': + help = 1; + break; + + case 'v': + version = 1; + break; + + case '?': + break; + + default: + printf("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) { + std::vector files; + while (optind < argc) { + files.push_back(argv[optind++]); + } + if (files.size() == 2 && filename.empty() && outfilename.empty()) { + filename = files[0]; + outfilename = files[1]; + } else { + PrintHelp(); + return 1; + } + } + + if (version) { + PrintVersion(); + return 0; + } + + if (help) { + PrintHelp(); + return 0; + } + + if (filename.empty()) { + PrintHelp(); + return 1; + } + + if (!gdcm::System::FileExists(filename.c_str())) { + std::cerr << "Could not find file: " << filename << std::endl; + return 1; + } + + // Are we in single file or directory mode: + unsigned int nfiles = 1; + gdcm::Directory dir; + if (gdcm::System::FileIsDirectory(filename.c_str())) { + if (!gdcm::System::FileIsDirectory(outfilename.c_str())) { + if (gdcm::System::FileExists(outfilename.c_str())) { + std::cerr << "Could not create directory since " << outfilename + << " is already a file" << std::endl; + return 1; + } + } + // For now avoid user mistake + if (filename == outfilename) { + std::cerr << "Input directory should be different from output directory" + << std::endl; + return 1; + } + if (*outfilename.rbegin() != '/') outfilename += '/'; + nfiles = dir.Load(filename, (recursive > 0 ? true : false)); + filenames = dir.GetFilenames(); + gdcm::Directory::FilenamesType::const_iterator it = filenames.begin(); + // Prepare outfilenames + for (; it != filenames.end(); ++it) { + std::string dup = *it; // make a copy + std::string &out = dup.replace(0, filename.size(), outfilename); + outfilenames.push_back(out); + } + // Prepare outdirectory + gdcm::Directory::FilenamesType const &dirs = dir.GetDirectories(); + gdcm::Directory::FilenamesType::const_iterator itdir = dirs.begin(); + for (; itdir != dirs.end(); ++itdir) { + std::string dirdup = *itdir; // make a copy + std::string &dirout = dirdup.replace(0, filename.size(), outfilename); + if (!gdcm::System::MakeDirectory(dirout.c_str())) { + std::cerr << "Could not create directory: " << dirout << std::endl; + return 1; + } + } + } else { + filenames.push_back(filename); + outfilenames.push_back(outfilename); + } + + if (filenames.size() != outfilenames.size()) { + std::cerr << "Something went really wrong" << std::endl; + return 1; + } + + // Debug is a little too verbose + gdcm::Trace::SetDebug((debug > 0 ? true : false)); + gdcm::Trace::SetWarning((warning > 0 ? true : false)); + gdcm::Trace::SetError((error > 0 ? true : false)); + // when verbose is true, make sure warning+error are turned on: + if (verbose) { + gdcm::Trace::SetWarning((verbose > 0 ? true : false)); + gdcm::Trace::SetError((verbose > 0 ? true : false)); + } + + gdcm::FileMetaInformation::SetSourceApplicationEntityTitle("gdcmclean"); + + // Setup gdcm::Cleaner + gdcm::Cleaner cleaner; + cleaner.RemoveAllMissingPrivateCreator(!preserveAllMissingPrivateCreator); + cleaner.RemoveAllGroupLength(!preserveAllGroupLength); + cleaner.RemoveAllIllegal(!preserveAllIllegal); + // Preserve + for (std::vector::const_iterator it = preserve_dpaths.begin(); + it != preserve_dpaths.end(); ++it) { + if (!cleaner.Preserve(*it)) { + std::cerr << "Impossible to Preserve: " << *it << std::endl; + return 1; + } + } + // VR + for (std::vector::const_iterator it = empty_vrs.begin(); + it != empty_vrs.end(); ++it) { + if (!cleaner.Empty(*it)) { + std::cerr << "Impossible to Empty: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = remove_vrs.begin(); + it != remove_vrs.end(); ++it) { + if (!cleaner.Remove(*it)) { + std::cerr << "Impossible to Remove: " << *it << std::endl; + return 1; + } + } + // Empty + for (std::vector::const_iterator it = empty_tags.begin(); + it != empty_tags.end(); ++it) { + if (!cleaner.Empty(*it)) { + std::cerr << "Impossible to Empty: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = + empty_privatetags.begin(); + it != empty_privatetags.end(); ++it) { + if (!cleaner.Empty(*it)) { + std::cerr << "Impossible to Empty: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = empty_dpaths.begin(); + it != empty_dpaths.end(); ++it) { + if (!cleaner.Empty(*it)) { + std::cerr << "Impossible to Empty: " << *it << std::endl; + return 1; + } + } + // Remove + for (std::vector::const_iterator it = remove_tags.begin(); + it != remove_tags.end(); ++it) { + if (!cleaner.Remove(*it)) { + std::cerr << "Impossible to Remove: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = + remove_privatetags.begin(); + it != remove_privatetags.end(); ++it) { + if (!cleaner.Remove(*it)) { + std::cerr << "Impossible to Remove: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = remove_dpaths.begin(); + it != remove_dpaths.end(); ++it) { + if (!cleaner.Remove(*it)) { + std::cerr << "Impossible to Remove: " << *it << std::endl; + return 1; + } + } + // Scrub + for (std::vector::const_iterator it = scrub_tags.begin(); + it != scrub_tags.end(); ++it) { + if (!cleaner.Scrub(*it)) { + std::cerr << "Impossible to Scrub: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = + scrub_privatetags.begin(); + it != scrub_privatetags.end(); ++it) { + if (!cleaner.Scrub(*it)) { + std::cerr << "Impossible to Scrub: " << *it << std::endl; + return 1; + } + } + for (std::vector::const_iterator it = scrub_dpaths.begin(); + it != scrub_dpaths.end(); ++it) { + if (!cleaner.Scrub(*it)) { + std::cerr << "Impossible to Scrub: " << *it << std::endl; + return 1; + } + } + { + for (unsigned int i = 0; i < nfiles; ++i) { + const char *in = filenames[i].c_str(); + const char *out = outfilenames[i].c_str(); + if (!CleanOneFile(cleaner, in, out, skipmeta > 0 ? true : false, + continuemode)) { + return 1; + } + } + } + + return 0; +} diff -Nru gdcm-3.0.10/Applications/Cxx/gdcmdump.cxx gdcm-3.0.14/Applications/Cxx/gdcmdump.cxx --- gdcm-3.0.10/Applications/Cxx/gdcmdump.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcmdump.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -53,6 +53,10 @@ #include #include +#ifdef GDCM_HAVE_CODECVT +#include +#endif +#include #include /* for printf */ #include /* for exit */ @@ -861,14 +865,45 @@ } const gdcm::DataSet& ds = reader.GetFile().GetDataSet(); + int ret; + { const gdcm::PrivateTag tpmtf(0x0029,0x1,"PMTF INFORMATION DATA"); const gdcm::PrivateTag tseq(0x0029,0x90,"PMTF INFORMATION DATA"); - int ret = cleanup::DumpTOSHIBA_Reverse( ds, tpmtf, tseq ); + ret += cleanup::DumpTOSHIBA_Reverse( ds, tpmtf, tseq ); + } + + { + const gdcm::PrivateTag tpmtf(0x0029,0x1,"CANON_MEC_MR3"); + const gdcm::PrivateTag tseq(0x0029,0x90,"CANON_MEC_MR3"); + ret += cleanup::DumpTOSHIBA_Reverse( ds, tpmtf, tseq ); + } + + { + const gdcm::PrivateTag tpmtf(0x0029,0x1,"TOSHIBA_MEC_MR3"); + const gdcm::PrivateTag tseq(0x0029,0x90,"TOSHIBA_MEC_MR3"); + ret += cleanup::DumpTOSHIBA_Reverse( ds, tpmtf, tseq ); + + const gdcm::PrivateTag tpmtf2(0x0029,0x2,"TOSHIBA_MEC_MR3"); + ret += cleanup::DumpTOSHIBA_Reverse( ds, tpmtf2, tseq ); + } return ret; } -static int PrintMECMR3(const std::string & filename, bool verbose) +static void print_utf8(std::string const& s) +{ + const char delim = 0; + auto start = 0U; + auto end = s.find(delim); + while (end != std::string::npos) + { + std::cout << s.substr(start, end - start) << std::endl; + start = end + 1; + end = s.find(delim, start); + } +} + +static int PrintMedComHistory(const std::string & filename, bool verbose) { (void)verbose; gdcm::Reader reader; @@ -880,18 +915,26 @@ } const gdcm::DataSet& ds = reader.GetFile().GetDataSet(); - const gdcm::PrivateTag tpmtf(0x0029,0x1,"TOSHIBA_MEC_MR3"); - const gdcm::PrivateTag tseq(0x0029,0x90,"TOSHIBA_MEC_MR3"); - int ret = cleanup::DumpTOSHIBA_Reverse( ds, tpmtf, tseq ); - - const gdcm::PrivateTag tpmtf2(0x0029,0x2,"TOSHIBA_MEC_MR3"); - int ret2 = cleanup::DumpTOSHIBA_Reverse( ds, tpmtf2, tseq ); - - return ret +ret2; + const gdcm::PrivateTag tmedcom(0x0029,0x20,"SIEMENS MEDCOM HEADER"); + if( !ds.FindDataElement( tmedcom) ) return 1; + const gdcm::DataElement& medcom = ds.GetDataElement( tmedcom); + if ( medcom.IsEmpty() ) return 1; + const gdcm::ByteValue * bv = medcom.GetByteValue(); + + const size_t size = bv->GetLength(); + std::u16string u16((size / 2) + 0, '\0'); + bv->GetBuffer( (char*)&u16[0], size ); + +#ifdef GDCM_HAVE_CODECVT + std::string utf8 = std::wstring_convert< + std::codecvt_utf8_utf16, char16_t>{}.to_bytes(u16); + print_utf8(utf8); +#else + std::cerr << "Missing GDCM_HAVE_CODECVT support" << std::endl; +#endif + return 0; } - - static int PrintPDB(const std::string & filename, bool verbose) { (void)verbose; @@ -1157,6 +1200,7 @@ std::cout << " --csa-asl print decoded SIEMENS CSA MR_ASL (base64)." << std::endl; std::cout << " --csa-diffusion print decoded SIEMENS CSA MRDiffusion (base64)." << std::endl; std::cout << " --mrprotocol print SIEMENS CSA MrProtocol only (within ASCCONV BEGIN/END)." << std::endl; + std::cout << " or Phoenix Meta Protocol (0021,19,SIEMENS MR SDS 01)." << std::endl; std::cout << " -P --pdb print GEMS Protocol Data Block (0025,1b,GEMS_SERS_01)." << std::endl; std::cout << " --elscint print ELSCINT Protocol Information (01f7,26,ELSCINT1)." << std::endl; std::cout << " --vepro print VEPRO Protocol Information (0055,20,VEPRO VIF 3.0 DATA)." << std::endl; @@ -1164,7 +1208,9 @@ std::cout << " --sds print Philips MR Series Data Storage (1.3.46.670589.11.0.0.12.2) Information (2005,32,Philips MR Imaging DD 002)." << std::endl; std::cout << " --ct3 print CT Private Data 2 (7005,10,TOSHIBA_MEC_CT3)." << std::endl; std::cout << " --pmtf print PMTF INFORMATION DATA sub-sequences (0029,01,PMTF INFORMATION DATA)." << std::endl; - std::cout << " --mecmr3 print TOSHIBA_MEC_MR3 sub-sequences (0029,01,TOSHIBA_MEC_MR3)." << std::endl; + std::cout << " or TOSHIBA_MEC_MR3 sub-sequences (0029,01,TOSHIBA_MEC_MR3)." << std::endl; + std::cout << " or CANON_MEC_MR3 sub-sequences (0029,01,CANON_MEC_MR3)." << std::endl; + std::cout << " --medcom print MedCom History Information as UTF-8 (0029,20,SIEMENS MEDCOM HEADER)." << std::endl; std::cout << " -A --asn1 print encapsulated ASN1 structure >(0400,0520)." << std::endl; std::cout << " --map-uid-names map UID to names." << std::endl; std::cout << "General Options:" << std::endl; @@ -1190,6 +1236,7 @@ int printcsa = 0; int printmrprotocol = 0; int printcsabase64 = 0; + int printmedcom = 0; // MedCom History Information int printcsaasl = 0; int printcsadiffusion = 0; int printpdb = 0; @@ -1197,8 +1244,7 @@ int printvepro = 0; int printsds = 0; // MR Series Data Storage int printct3 = 0; // TOSHIBA_MEC_CT3 - int printpmtf = 0; // TOSHIBA / PMTF INFORMATION DATA - int printmecmr3 = 0; // TOSHIBA / TOSHIBA_MEC_MR3 + int printpmtf = 0; // TOSHIBA / PMTF INFORMATION DATA & TOSHIBA / TOSHIBA_MEC_MR3 & CANON_MEC_MR3 int verbose = 0; int warning = 0; int debug = 0; @@ -1245,7 +1291,8 @@ {"csa-diffusion", 0, &printcsadiffusion, 1}, {"mrprotocol", 0, &printmrprotocol, 1}, {"pmtf", 0, &printpmtf, 1}, - {"mecmr3", 0, &printmecmr3, 1}, + {"mecmr3", 0, &printpmtf, 1}, + {"medcom", 0, &printmedcom, 1}, {nullptr, 0, nullptr, 0} // required }; static const char short_options[] = "i:xrpdcCPAVWDEhvI"; @@ -1467,9 +1514,9 @@ { res += PrintPMTF(*it, verbose!= 0); } - else if( printmecmr3 ) + else if( printmedcom ) { - res += PrintMECMR3(*it, verbose!= 0); + res += PrintMedComHistory(*it, csaname); } else if( printelscint ) { @@ -1530,9 +1577,9 @@ { res += PrintPMTF(filename, verbose!= 0); } - else if( printmecmr3 ) + else if( printmedcom ) { - res += PrintMECMR3(filename, verbose!= 0); + res += PrintMedComHistory(filename, verbose!= 0); } else if( printelscint ) { diff -Nru gdcm-3.0.10/Applications/Cxx/gdcmimg.cxx gdcm-3.0.14/Applications/Cxx/gdcmimg.cxx --- gdcm-3.0.10/Applications/Cxx/gdcmimg.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcmimg.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -1183,9 +1183,9 @@ if ( region[0] > region[1] || region[2] > region[3] || region[4] > region[5] - || region[1] > dims[0] - || region[3] > dims[1] - || (imageori.GetNumberOfDimensions() > 2 && region[5] > dims[2]) ) + || region[1] >= dims[0] + || region[3] >= dims[1] + || (imageori.GetNumberOfDimensions() > 2 && region[5] >= dims[2]) ) { if( imageori.GetNumberOfDimensions() == 2 ) { diff -Nru gdcm-3.0.10/Applications/Cxx/gdcminfo.cxx gdcm-3.0.14/Applications/Cxx/gdcminfo.cxx --- gdcm-3.0.10/Applications/Cxx/gdcminfo.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcminfo.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -201,7 +201,10 @@ if (infoDict->lookup((char*)key, &obj)->isString()) #endif { - const GooString* gs = obj.getString(); +#ifndef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING + const +#endif + GooString* gs = obj.getString(); #ifdef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING s = gs->getCString(); #else @@ -497,9 +500,13 @@ #else bv->GetLength(), &appearDict); #endif +#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL + std::optional ownerPW, userPW; +#else GooString *ownerPW, *userPW; ownerPW = NULL; userPW = NULL; +#endif PDFDoc *doc; doc = new PDFDoc(appearStream, ownerPW, userPW); diff -Nru gdcm-3.0.10/Applications/Cxx/gdcmpdf.cxx gdcm-3.0.14/Applications/Cxx/gdcmpdf.cxx --- gdcm-3.0.10/Applications/Cxx/gdcmpdf.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcmpdf.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -25,6 +25,9 @@ #include #include #include +#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL +#include +#endif #endif #include @@ -49,7 +52,10 @@ if (infoDict->lookup((char*)key, &obj)->isString()) #endif { - const GooString* gs = obj.getString(); +#ifndef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING + const +#endif + GooString* gs = obj.getString(); #ifdef LIBPOPPLER_GOOSTRING_HAS_GETCSTRING s = gs->getCString(); #else @@ -333,17 +339,27 @@ return 0; } +#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL + std::optional ownerPW, userPW; +#else GooString *ownerPW, *userPW; +#endif GooString *fileName; +#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL + std::unique_ptr doc; +#else PDFDoc *doc; +#endif Object info; #ifdef LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE const UnicodeMap *uMap; #else UnicodeMap *uMap; #endif +#ifndef LIBPOPPLER_PDFDOC_HAS_OPTIONAL ownerPW = NULL; userPW = NULL; +#endif #ifdef LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM globalParams = new GlobalParams(0); #else @@ -376,7 +392,11 @@ #ifndef LIBPOPPLER_NEW_OBJECT_API obj.initNull(); #endif +#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL + doc = PDFDocFactory().createPDFDoc(*fileName, ownerPW, userPW); +#else doc = new PDFDoc(fileName, ownerPW, userPW); +#endif if (doc->isEncrypted()) { @@ -405,8 +425,13 @@ http://msdn.microsoft.com/en-us/library/078sfkak(VS.80).aspx } */ +#ifdef LIBPOPPLER_PDFDOC_HAS_OPTIONAL + ownerPW = GooString( password.c_str() ); + doc = PDFDocFactory().createPDFDoc(*fileName, ownerPW, userPW); +#else ownerPW = new GooString( password.c_str() ); doc = new PDFDoc(fileName, ownerPW, userPW); +#endif } std::string title; diff -Nru gdcm-3.0.10/Applications/Cxx/gdcmscanner.cxx gdcm-3.0.14/Applications/Cxx/gdcmscanner.cxx --- gdcm-3.0.10/Applications/Cxx/gdcmscanner.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Applications/Cxx/gdcmscanner.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -27,8 +27,8 @@ * --bench... */ -#include "gdcmScanner.h" -#include "gdcmStrictScanner.h" +#include "gdcmScanner2.h" +#include "gdcmStrictScanner2.h" #include "gdcmTrace.h" #include "gdcmVersion.h" #include "gdcmSimpleSubjectWatcher.h" @@ -84,18 +84,26 @@ gdcm::Directory const & d, bool const & print , int table, VectorTags const & tags, - VectorPrivateTags const & privatetags) + VectorPrivateTags const & privatetags, bool header) { gdcm::SmartPointer ps = new TScanner; TScanner &s = *ps; //gdcm::SimpleSubjectWatcher watcher(ps, "Scanner"); for( VectorTags::const_iterator it = tags.begin(); it != tags.end(); ++it) { - s.AddTag( *it ); + if(!s.AddPublicTag( *it )) + { + std::cerr << "Failure to add public tag: " << *it << std::endl; + return 1; + } } for( VectorPrivateTags::const_iterator it = privatetags.begin(); it != privatetags.end(); ++it) { - s.AddPrivateTag( *it ); + if(!s.AddPrivateTag( *it )) + { + std::cerr << "Failure to add private tag: " << *it << std::endl; + return 1; + } } bool b = s.Scan( d.GetFilenames() ); if( !b ) @@ -106,7 +114,7 @@ if (print) { if(table) - s.PrintTable( std::cout ); + s.PrintTable( std::cout, header ); else s.Print( std::cout ); } @@ -133,6 +141,7 @@ int strict = 0; int table = 0; + int header = 0; int verbose = 0; int warning = 0; int debug = 0; @@ -152,6 +161,7 @@ {"keyword", required_argument, nullptr, 'k'}, {"strict", no_argument, &strict, 1}, {"table", no_argument, &table, 1}, + {"header", no_argument, &header, 1}, // General options ! {"verbose", no_argument, nullptr, 'V'}, @@ -325,6 +335,6 @@ std::cout << "done retrieving file list " << nfiles << " files found." << std::endl; if( strict ) - return DoIt(d,print,table,tags,privatetags); - return DoIt(d,print,table,tags,privatetags); + return DoIt(d,print,table,tags,privatetags,header>0); + return DoIt(d,print,table,tags,privatetags,header > 0); } diff -Nru gdcm-3.0.10/appveyor.yml gdcm-3.0.14/appveyor.yml --- gdcm-3.0.10/appveyor.yml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/appveyor.yml 2022-06-24 07:37:44.000000000 +0000 @@ -171,7 +171,7 @@ artifact: nuget_package - provider: GitHub auth_token: - secure: 7HmfZp9O7bVdQo2hRk6FjOUs7jJosftv2rZ6JPBNzjPcAOMXDTvLqv3lvzdAzBfy + secure: Fn2cUcuBMVpvBXDzTQiUm2kqZ4AA39z4iyFUS3BsaPWjJEbJgFpmJYoJm2twjVpk release: $(appveyor_repo_tag_name) description: 'Release of GDCM $(appveyor_repo_tag_name)' # github automatically does source zip/tarball for us diff -Nru gdcm-3.0.10/CMakeLists.txt gdcm-3.0.14/CMakeLists.txt --- gdcm-3.0.10/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -17,7 +17,7 @@ #---------------------------------------------------------------------------- project(GDCM - VERSION 3.0.10 + VERSION 3.0.14 LANGUAGES CXX C ) ## NOTE: the "DESCRIPTION" feature of project() was introduced in cmake 3.10.0 @@ -180,23 +180,12 @@ endif() endmacro() -CHECK_INCLUDE_FILE("stdint.h" GDCM_HAVE_STDINT_H) -if(UNIX) #Avoid polluting Win32 cmakecache - CHECK_INCLUDE_FILE("inttypes.h" GDCM_HAVE_INTTYPES_H) -endif() - #include(${GDCM_SOURCE_DIR}/CMake/gdcmPlatformCxxTests.cmake) # #GDCM_PLATFORM_CXX_TEST(GDCM_CXX_HAS_FUNCTION # "Checking whether compiler has __FUNCTION__" DIRECT) -#----------------------------------------------------------------------------- -# Build the main lib... -if(NOT GDCM_HAVE_STDINT_H) - message(FATAL_ERROR "You system does not have stdint.h") -endif() - # -------------------------------------------------------------------------- # Configure the export configuration diff -Nru gdcm-3.0.10/debian/changelog gdcm-3.0.14/debian/changelog --- gdcm-3.0.10/debian/changelog 2022-04-10 23:38:22.000000000 +0000 +++ gdcm-3.0.14/debian/changelog 2022-09-24 16:31:05.000000000 +0000 @@ -1,9 +1,79 @@ -gdcm (3.0.10-1~20.04.sav0) focal; urgency=medium +gdcm (3.0.14-1~20.04.sav0) focal; urgency=medium * Backport to Focal * debian/control{.in}: Set debhelper-compat (= 12) BD + * Due FTBFS using C++ standard < 17 when building with recent Poppler: + - debian/rules: Add CMAKE_CXX_STANDARD:STRING=17 config to force required + C++17 for Poppler >= 21 (building with backported Poppler 22.02.0) - -- Rob Savoury Sun, 10 Apr 2022 16:38:22 -0700 + -- Rob Savoury Sat, 24 Sep 2022 09:31:05 -0700 + +gdcm (3.0.14-1) unstable; urgency=medium + + * Team upload. + * d/watch: Point to latest release + * Deal with new build target locations created by cmake + Closes: #1017027 + * lintian-brush: Avoid explicitly specifying -Wl,--as-needed linker flag. + + -- Andreas Tille Fri, 12 Aug 2022 09:22:00 +0200 + +gdcm (3.0.13-3) unstable; urgency=medium + + [ Mohammed Bilal ] + * change test data + * Fix autopkgtest for s390 (Closes: #1016450) + + [ Mathieu Malaterre ] + * Team upload. + * d/patches: Fix doxygen/pdf generation. Closes: #1016331 + + -- Mathieu Malaterre Thu, 04 Aug 2022 08:29:13 +0200 + +gdcm (3.0.13-2) unstable; urgency=medium + + [ Mohammed Bilal ] + * Add autopkgtests + * Install example data + * add example data to d/s/include-binaries + * Add copyright for test data + + [ Mathieu Malaterre ] + * Team upload. + * d/control: Bump Std-Vers to 4.6.1, no changes needed + * d/t/run-unit-test: Fix up the unit test + + -- Mathieu Malaterre Wed, 06 Jul 2022 11:32:54 +0200 + +gdcm (3.0.13-1) unstable; urgency=medium + + * Team upload. + * New upstream version 3.0.13 + * d/control: Run wrap-and-sort + * d/control: Ship new CLI gdcmclean + + -- Mathieu Malaterre Mon, 20 Jun 2022 10:27:49 +0200 + +gdcm (3.0.12-1) unstable; urgency=medium + + * Team upload. + * d/patches: Fix compilation on big-endian arch + * New upstream version 3.0.12 + * d/patches: Remove patch applied upstream + + -- Mathieu Malaterre Mon, 04 Apr 2022 08:32:57 +0200 + +gdcm (3.0.11-1) unstable; urgency=medium + + [ Andreas Tille ] + * Bump versioned Build-Depends: libcharls-dev (>= 2.0) + * Make sure debhelper level 13 will not be overridden by recreating d/control + + [ Mathieu Malaterre ] + * Team upload. + * New upstream version 3.0.11 + + -- Mathieu Malaterre Tue, 29 Mar 2022 11:50:17 +0200 gdcm (3.0.10-1) unstable; urgency=medium @@ -48,7 +118,7 @@ [ Gert Wollny ] * New upstream version 3.0.8 - [ Alexander Volkov ] + [ Alexander Volkov ] * debian/{rules, control}: Don't build CLI bindings when the "nocil" build profile is enabled diff -Nru gdcm-3.0.10/debian/control gdcm-3.0.14/debian/control --- gdcm-3.0.10/debian/control 2022-04-10 23:38:22.000000000 +0000 +++ gdcm-3.0.14/debian/control 2022-09-24 02:22:33.000000000 +0000 @@ -5,42 +5,38 @@ Gert Wollny Section: libs Priority: optional -Build-Depends: cmake, +Build-Depends: castxml, + cli-common-dev [amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64] , + cmake, debhelper-compat (= 12), default-jdk [!hppa !hurd-any !kfreebsd-any], - dh-strip-nondeterminism, dh-python, - python3-dev, - pvrg-jpeg, - uuid-dev, - libz-dev, - libexpat-dev, - swig, + dh-strip-nondeterminism, + docbook-xsl-ns, javahelper, - libvtk7-dev, - libcharls-dev (>= 1.1.0), - libopenjp2-7-dev, - libvtk7-java [!hppa !hurd-any !kfreebsd-any], - libxml2-dev, + libcharls-dev (>= 2.0), + libexpat-dev, libjson-c-dev, + libopenjp2-7-dev, + libpapyrus3-dev, libpoppler-private-dev, + libsocket++-dev, libssl-dev, + libvtk7-dev, + libvtk7-java [!hppa !hurd-any !kfreebsd-any], + libxml2-dev, + libz-dev, + mono-devel [amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64] , ninja-build, + pvrg-jpeg, + python3-dev, python3-vtk7, - castxml, - libsocket++-dev, - libpapyrus3-dev, - cli-common-dev [amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64] , - mono-devel [amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64] , - xsltproc, - docbook-xsl-ns -Build-Depends-Indep: vtk7-doc, - doxygen, - doxygen-latex, - ghostscript, - graphviz + swig, + uuid-dev, + xsltproc +Build-Depends-Indep: doxygen, doxygen-latex, ghostscript, graphviz, vtk7-doc Build-Conflicts: libopenjpeg-dev -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Vcs-Browser: https://salsa.debian.org/med-team/gdcm Vcs-Git: https://salsa.debian.org/med-team/gdcm.git Homepage: http://gdcm.sourceforge.net/ @@ -48,8 +44,7 @@ Package: libgdcm3.0 Architecture: any Multi-Arch: same -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Grassroots DICOM runtime libraries Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -63,25 +58,22 @@ Architecture: any Multi-Arch: foreign Section: utils -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Recommends: pvrg-jpeg -Suggests: dcmtk, - dicom3tools +Suggests: dcmtk, dicom3tools Description: Grassroots DICOM tools and utilities Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports RAW,JPEG (lossy/lossless),J2K,JPEG-LS, RLE and deflated. . - Install this package for the gdcmanon, gdcmconv, gdcmdiff, gdcmdump, gdcmpap3, - gdcmgendir, gdcmimg, gdcminfo, gdcmpdf, gdcmraw, gdcmscanner, gdcmscu, gdcmtar, - gdcmxml programs. + Install this package for the gdcmanon, gdcmclean, gdcmconv, gdcmdiff, + gdcmdump, gdcmpap3, gdcmgendir, gdcmimg, gdcminfo, gdcmpdf, gdcmraw, + gdcmscanner, gdcmscu, gdcmtar, gdcmxml programs. Package: libgdcm-dev Architecture: any Section: libdevel -Depends: libgdcm3.0 (= ${binary:Version}), - ${misc:Depends} +Depends: libgdcm3.0 (= ${binary:Version}), ${misc:Depends} Breaks: libgdcm2-dev Replaces: libgdcm2-dev Description: Grassroots DICOM development libraries and headers @@ -95,11 +87,9 @@ Package: libgdcm-cil Build-Profiles: -Architecture: amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64 +Architecture: amd64 arm64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 mipsel powerpc ppc64 ppc64el s390x Section: cli-mono -Depends: ${shlibs:Depends}, - ${misc:Depends}, - ${cli:Depends} +Depends: ${cli:Depends}, ${misc:Depends}, ${shlibs:Depends} Description: Grassroots DICOM CLI bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports @@ -111,10 +101,10 @@ Package: python3-gdcm Architecture: any Section: python -Depends: ${shlibs:Depends}, +Depends: libgdcm3.0 (= ${binary:Version}), ${misc:Depends}, ${python3:Depends}, - libgdcm3.0 (= ${binary:Version}) + ${shlibs:Depends} Provides: ${python:Provides} Description: Grassroots DICOM Python bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -126,8 +116,7 @@ Package: libvtkgdcm3.0 Architecture: any Multi-Arch: same -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Grassroots DICOM VTK runtime libraries Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -140,9 +129,7 @@ Package: libvtkgdcm-dev Architecture: any Section: libdevel -Depends: libvtkgdcm3.0 (= ${binary:Version}), - libgdcm-dev, - ${misc:Depends} +Depends: libgdcm-dev, libvtkgdcm3.0 (= ${binary:Version}), ${misc:Depends} Breaks: libvtkgdcm2-dev Replaces: libvtkgdcm2-dev Description: Grassroots DICOM VTK development libraries and headers @@ -158,10 +145,10 @@ Build-Profiles: Architecture: amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64 Section: cli-mono -Depends: ${shlibs:Depends}, - ${misc:Depends}, +Depends: libgdcm3.0 (= ${binary:Version}), ${cli:Depends}, - libgdcm3.0 (= ${binary:Version}) + ${misc:Depends}, + ${shlibs:Depends} Suggests: libgdcm-cil Description: Grassroots DICOM VTK CLI bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -173,10 +160,10 @@ Package: python3-vtkgdcm Architecture: any Section: python -Depends: ${shlibs:Depends}, +Depends: libvtkgdcm3.0 (= ${binary:Version}), ${misc:Depends}, ${python3:Depends}, - libvtkgdcm3.0 (= ${binary:Version}) + ${shlibs:Depends} Suggests: python3-gdcm Provides: ${python:Provides} Description: Grassroots DICOM VTK/Python bindings @@ -190,8 +177,7 @@ Architecture: any Multi-Arch: foreign Section: utils -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Suggests: libgdcm-tools Description: Grassroots DICOM VTK tools and utilities Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -205,9 +191,7 @@ Package: gdcm-doc Architecture: all Section: doc -Depends: ${misc:Depends}, - vtk7-doc, - doc-base +Depends: doc-base, vtk7-doc, ${misc:Depends} Description: Grassroots DICOM documentation Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports @@ -216,11 +200,9 @@ This is the documentation for gdcm and vtkgdcm Package: libgdcm-java -Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32 +Architecture: alpha amd64 arm64 armel armhf i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64 x32 Section: java -Depends: ${shlibs:Depends}, - ${misc:Depends}, - ${java:Depends} +Depends: ${java:Depends}, ${misc:Depends}, ${shlibs:Depends} Suggests: java-virtual-machine Description: Grassroots DICOM Java bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -231,12 +213,12 @@ GDCM from Java environment. Package: libvtkgdcm-java -Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32 +Architecture: alpha amd64 arm64 armel armhf i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64 x32 Section: java -Depends: ${shlibs:Depends}, - ${misc:Depends}, +Depends: libgdcm3.0 (= ${binary:Version}), ${java:Depends}, - libgdcm3.0 (= ${binary:Version}) + ${misc:Depends}, + ${shlibs:Depends} Suggests: libgdcm-java Description: Grassroots DICOM VTK Java bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is diff -Nru gdcm-3.0.10/debian/control.in gdcm-3.0.14/debian/control.in --- gdcm-3.0.10/debian/control.in 2022-04-10 23:38:22.000000000 +0000 +++ gdcm-3.0.14/debian/control.in 2022-09-24 02:22:37.000000000 +0000 @@ -5,42 +5,38 @@ Gert Wollny Section: libs Priority: optional -Build-Depends: cmake, +Build-Depends: castxml, + cli-common-dev [@DEB_MONO_ARCHS@] , + cmake, debhelper-compat (= 12), default-jdk [!hppa !hurd-any !kfreebsd-any], - dh-strip-nondeterminism, dh-python, - python3-dev, - pvrg-jpeg, - uuid-dev, - libz-dev, - libexpat-dev, - swig, + dh-strip-nondeterminism, + docbook-xsl-ns, javahelper, - libvtk7-dev, - libcharls-dev (>= 1.1.0), - libopenjp2-7-dev, - libvtk7-java [!hppa !hurd-any !kfreebsd-any], - libxml2-dev, + libcharls-dev (>= 2.0), + libexpat-dev, libjson-c-dev, + libopenjp2-7-dev, + libpapyrus3-dev, libpoppler-private-dev, + libsocket++-dev, libssl-dev, + libvtk7-dev, + libvtk7-java [!hppa !hurd-any !kfreebsd-any], + libxml2-dev, + libz-dev, + mono-devel [@DEB_MONO_ARCHS@] , ninja-build, + pvrg-jpeg, + python3-dev, python3-vtk7, - castxml, - libsocket++-dev, - libpapyrus3-dev, - cli-common-dev [@DEB_MONO_ARCHS@] , - mono-devel [@DEB_MONO_ARCHS@] , - xsltproc, - docbook-xsl-ns -Build-Depends-Indep: vtk7-doc, - doxygen, - doxygen-latex, - ghostscript, - graphviz + swig, + uuid-dev, + xsltproc +Build-Depends-Indep: doxygen, doxygen-latex, ghostscript, graphviz, vtk7-doc Build-Conflicts: libopenjpeg-dev -Standards-Version: 4.5.1 +Standards-Version: 4.6.1 Vcs-Browser: https://salsa.debian.org/med-team/gdcm Vcs-Git: https://salsa.debian.org/med-team/gdcm.git Homepage: http://gdcm.sourceforge.net/ @@ -48,8 +44,7 @@ Package: libgdcm3.0 Architecture: any Multi-Arch: same -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Grassroots DICOM runtime libraries Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -63,25 +58,22 @@ Architecture: any Multi-Arch: foreign Section: utils -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Recommends: pvrg-jpeg -Suggests: dcmtk, - dicom3tools +Suggests: dcmtk, dicom3tools Description: Grassroots DICOM tools and utilities Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports RAW,JPEG (lossy/lossless),J2K,JPEG-LS, RLE and deflated. . - Install this package for the gdcmanon, gdcmconv, gdcmdiff, gdcmdump, gdcmpap3, - gdcmgendir, gdcmimg, gdcminfo, gdcmpdf, gdcmraw, gdcmscanner, gdcmscu, gdcmtar, - gdcmxml programs. + Install this package for the gdcmanon, gdcmclean, gdcmconv, gdcmdiff, + gdcmdump, gdcmpap3, gdcmgendir, gdcmimg, gdcminfo, gdcmpdf, gdcmraw, + gdcmscanner, gdcmscu, gdcmtar, gdcmxml programs. Package: libgdcm-dev Architecture: any Section: libdevel -Depends: libgdcm3.0 (= ${binary:Version}), - ${misc:Depends} +Depends: libgdcm3.0 (= ${binary:Version}), ${misc:Depends} Breaks: libgdcm2-dev Replaces: libgdcm2-dev Description: Grassroots DICOM development libraries and headers @@ -95,11 +87,9 @@ Package: libgdcm-cil Build-Profiles: -Architecture: amd64 armel armhf i386 mipsel kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 ppc64el s390x arm64 +Architecture: amd64 arm64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 mipsel powerpc ppc64 ppc64el s390x Section: cli-mono -Depends: ${shlibs:Depends}, - ${misc:Depends}, - ${cli:Depends} +Depends: ${cli:Depends}, ${misc:Depends}, ${shlibs:Depends} Description: Grassroots DICOM CLI bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports @@ -111,10 +101,10 @@ Package: python3-gdcm Architecture: any Section: python -Depends: ${shlibs:Depends}, +Depends: libgdcm3.0 (= ${binary:Version}), ${misc:Depends}, ${python3:Depends}, - libgdcm3.0 (= ${binary:Version}) + ${shlibs:Depends} Provides: ${python:Provides} Description: Grassroots DICOM Python bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -126,8 +116,7 @@ Package: libvtkgdcm3.0 Architecture: any Multi-Arch: same -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Pre-Depends: ${misc:Pre-Depends} Description: Grassroots DICOM VTK runtime libraries Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -140,9 +129,7 @@ Package: libvtkgdcm-dev Architecture: any Section: libdevel -Depends: libvtkgdcm3.0 (= ${binary:Version}), - libgdcm-dev, - ${misc:Depends} +Depends: libgdcm-dev, libvtkgdcm3.0 (= ${binary:Version}), ${misc:Depends} Breaks: libvtkgdcm2-dev Replaces: libvtkgdcm2-dev Description: Grassroots DICOM VTK development libraries and headers @@ -158,10 +145,10 @@ Build-Profiles: Architecture: @DEB_MONO_ARCHS@ Section: cli-mono -Depends: ${shlibs:Depends}, - ${misc:Depends}, +Depends: libgdcm3.0 (= ${binary:Version}), ${cli:Depends}, - libgdcm3.0 (= ${binary:Version}) + ${misc:Depends}, + ${shlibs:Depends} Suggests: libgdcm-cil Description: Grassroots DICOM VTK CLI bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -173,10 +160,10 @@ Package: python3-vtkgdcm Architecture: any Section: python -Depends: ${shlibs:Depends}, +Depends: libvtkgdcm3.0 (= ${binary:Version}), ${misc:Depends}, ${python3:Depends}, - libvtkgdcm3.0 (= ${binary:Version}) + ${shlibs:Depends} Suggests: python3-gdcm Provides: ${python:Provides} Description: Grassroots DICOM VTK/Python bindings @@ -190,8 +177,7 @@ Architecture: any Multi-Arch: foreign Section: utils -Depends: ${shlibs:Depends}, - ${misc:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends} Suggests: libgdcm-tools Description: Grassroots DICOM VTK tools and utilities Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -205,9 +191,7 @@ Package: gdcm-doc Architecture: all Section: doc -Depends: ${misc:Depends}, - vtk7-doc, - doc-base +Depends: doc-base, vtk7-doc, ${misc:Depends} Description: Grassroots DICOM documentation Grassroots DiCoM is a C++ library for DICOM medical files. It is automatically wrapped to python/C#/Java (using swig). It supports @@ -216,11 +200,9 @@ This is the documentation for gdcm and vtkgdcm Package: libgdcm-java -Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32 +Architecture: alpha amd64 arm64 armel armhf i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64 x32 Section: java -Depends: ${shlibs:Depends}, - ${misc:Depends}, - ${java:Depends} +Depends: ${java:Depends}, ${misc:Depends}, ${shlibs:Depends} Suggests: java-virtual-machine Description: Grassroots DICOM Java bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is @@ -231,12 +213,12 @@ GDCM from Java environment. Package: libvtkgdcm-java -Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x alpha ia64 m68k powerpc ppc64 riscv64 sh4 sparc64 x32 +Architecture: alpha amd64 arm64 armel armhf i386 ia64 m68k mips64el mipsel powerpc ppc64 ppc64el riscv64 s390x sh4 sparc64 x32 Section: java -Depends: ${shlibs:Depends}, - ${misc:Depends}, +Depends: libgdcm3.0 (= ${binary:Version}), ${java:Depends}, - libgdcm3.0 (= ${binary:Version}) + ${misc:Depends}, + ${shlibs:Depends} Suggests: libgdcm-java Description: Grassroots DICOM VTK Java bindings Grassroots DiCoM is a C++ library for DICOM medical files. It is diff -Nru gdcm-3.0.10/debian/copyright gdcm-3.0.14/debian/copyright --- gdcm-3.0.10/debian/copyright 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/copyright 2022-08-12 07:22:00.000000000 +0000 @@ -428,6 +428,10 @@ paragraph are preserved on all copies. This software is provided "as is" with no express or implied warranty +Files: debian/tests/data/00191113.dcm +Copyright: 2006-2011 Mathieu Malaterre +License: Apache-2.0 + License: Apache-2.0 On Debian GNU/Linux system you can find the complete text of the Apache 2.0 license in '/usr/share/common-licenses/Apache-2.0'. diff -Nru gdcm-3.0.10/debian/examples gdcm-3.0.14/debian/examples --- gdcm-3.0.10/debian/examples 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/debian/examples 2022-08-12 07:22:00.000000000 +0000 @@ -0,0 +1 @@ +debian/tests/data/00191113.dcm diff -Nru gdcm-3.0.10/debian/gdcm-doc.docs gdcm-3.0.14/debian/gdcm-doc.docs --- gdcm-3.0.10/debian/gdcm-doc.docs 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/gdcm-doc.docs 2022-08-12 07:22:00.000000000 +0000 @@ -1,2 +1,2 @@ -usr/share/doc/gdcm-*/html/ usr/share/doc/gdcm-*/gdcm-*.pdf +usr/share/doc/gdcm-*/html/ diff -Nru gdcm-3.0.10/debian/gdcm-doc.install gdcm-3.0.14/debian/gdcm-doc.install --- gdcm-3.0.10/debian/gdcm-doc.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/gdcm-doc.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,3 +1,2 @@ -usr/share/doc/gdcm-*/html/ usr/share/doc/gdcm-*/gdcm-*.pdf usr/share/doc/gdcm-doc/ - +usr/share/doc/gdcm-*/html/ diff -Nru gdcm-3.0.10/debian/libgdcm-cil.install gdcm-3.0.14/debian/libgdcm-cil.install --- gdcm-3.0.10/debian/libgdcm-cil.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libgdcm-cil.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,3 +1,3 @@ usr/lib/*/gdcm-sharp.dll usr/lib/cli/gdcm-sharp-3.0/ -usr/lib/*/libgdcmsharpglue.so usr/lib/cli/gdcm-sharp-3.0/ usr/lib/*/gdcm-sharp.dll.xml usr/lib/cli/gdcm-sharp-3.0/ +usr/lib/*/libgdcmsharpglue.so usr/lib/cli/gdcm-sharp-3.0/ diff -Nru gdcm-3.0.10/debian/libgdcm-dev.install gdcm-3.0.14/debian/libgdcm-dev.install --- gdcm-3.0.10/debian/libgdcm-dev.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libgdcm-dev.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,16 +1,16 @@ +usr/include/gdcm-3.*/gdcm* +usr/include/gdcm-3.*/gdcmjpeg/12/* +usr/include/gdcm-3.*/gdcmjpeg/16/* +usr/include/gdcm-3.*/gdcmjpeg/8/* +usr/include/gdcm-3.*/gdcmjpeg/j*.h +usr/include/gdcm-3.*/zip* +usr/lib/*/gdcm-3.*/*.cmake usr/lib/*/libgdcmCommon.so usr/lib/*/libgdcmDICT.so usr/lib/*/libgdcmDSED.so usr/lib/*/libgdcmIOD.so +usr/lib/*/libgdcmMEXD.so usr/lib/*/libgdcmMSFF.so usr/lib/*/libgdcmjpeg12.so usr/lib/*/libgdcmjpeg16.so usr/lib/*/libgdcmjpeg8.so -usr/lib/*/libgdcmMEXD.so -usr/lib/*/gdcm-3.*/*.cmake -usr/include/gdcm-3.*/gdcm* -usr/include/gdcm-3.*/zip* -usr/include/gdcm-3.*/gdcmjpeg/12/* -usr/include/gdcm-3.*/gdcmjpeg/16/* -usr/include/gdcm-3.*/gdcmjpeg/8/* -usr/include/gdcm-3.*/gdcmjpeg/j*.h diff -Nru gdcm-3.0.10/debian/libgdcm-tools.install gdcm-3.0.14/debian/libgdcm-tools.install --- gdcm-3.0.10/debian/libgdcm-tools.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libgdcm-tools.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,29 +1,30 @@ usr/bin/gdcmanon +usr/bin/gdcmclean usr/bin/gdcmconv +usr/bin/gdcmdiff usr/bin/gdcmdump usr/bin/gdcmgendir usr/bin/gdcmimg usr/bin/gdcminfo +usr/bin/gdcmpap3 usr/bin/gdcmpdf usr/bin/gdcmraw usr/bin/gdcmscanner -usr/bin/gdcmtar usr/bin/gdcmscu -#usr/bin/gdcmstream +usr/bin/gdcmtar usr/bin/gdcmxml -usr/bin/gdcmpap3 -usr/bin/gdcmdiff usr/share/man/man1/gdcmanon.1 +usr/share/man/man1/gdcmclean.1 usr/share/man/man1/gdcmconv.1 +usr/share/man/man1/gdcmdiff.1 usr/share/man/man1/gdcmdump.1 usr/share/man/man1/gdcmgendir.1 usr/share/man/man1/gdcmimg.1 usr/share/man/man1/gdcminfo.1 +usr/share/man/man1/gdcmpap3.1 usr/share/man/man1/gdcmpdf.1 usr/share/man/man1/gdcmraw.1 usr/share/man/man1/gdcmscanner.1 +usr/share/man/man1/gdcmscu.1 usr/share/man/man1/gdcmtar.1 -usr/share/man/man1/gdcmdiff.1 usr/share/man/man1/gdcmxml.1 -usr/share/man/man1/gdcmpap3.1 -usr/share/man/man1/gdcmscu.1 diff -Nru gdcm-3.0.10/debian/libvtkgdcm-cil.install gdcm-3.0.14/debian/libvtkgdcm-cil.install --- gdcm-3.0.10/debian/libvtkgdcm-cil.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libvtkgdcm-cil.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/*/vtkgdcm-sharp.dll usr/lib/cli/vtkgdcm-sharp-3.0 usr/lib/*/libvtkgdcmsharpglue.so usr/lib/cli/vtkgdcm-sharp-3.0 +usr/lib/*/vtkgdcm-sharp.dll usr/lib/cli/vtkgdcm-sharp-3.0 diff -Nru gdcm-3.0.10/debian/libvtkgdcm-dev.install gdcm-3.0.14/debian/libvtkgdcm-dev.install --- gdcm-3.0.10/debian/libvtkgdcm-dev.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libvtkgdcm-dev.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/*/libvtkgdcm.so usr/include/gdcm-3.*/vtk* +usr/lib/*/libvtkgdcm.so diff -Nru gdcm-3.0.10/debian/libvtkgdcm-java.install gdcm-3.0.14/debian/libvtkgdcm-java.install --- gdcm-3.0.10/debian/libvtkgdcm-java.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libvtkgdcm-java.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/*/vtkgdcm.jar usr/share/java usr/lib/*/jni/libvtkgdcmJava.so +usr/lib/*/vtkgdcm.jar usr/share/java diff -Nru gdcm-3.0.10/debian/libvtkgdcm-tools.install gdcm-3.0.14/debian/libvtkgdcm-tools.install --- gdcm-3.0.10/debian/libvtkgdcm-tools.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/libvtkgdcm-tools.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,6 +1,6 @@ -usr/bin/gdcmviewer -usr/bin/gdcm2vtk usr/bin/gdcm2pnm -usr/share/man/man1/gdcmviewer.1 -usr/share/man/man1/gdcm2vtk.1 +usr/bin/gdcm2vtk +usr/bin/gdcmviewer usr/share/man/man1/gdcm2pnm.1 +usr/share/man/man1/gdcm2vtk.1 +usr/share/man/man1/gdcmviewer.1 diff -Nru gdcm-3.0.10/debian/patches/bug1016331.patch gdcm-3.0.14/debian/patches/bug1016331.patch --- gdcm-3.0.10/debian/patches/bug1016331.patch 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/debian/patches/bug1016331.patch 2022-08-12 07:22:00.000000000 +0000 @@ -0,0 +1,21 @@ +Description: Remove non-unicode from header file + It breaks doxygen/pdf generation +Author: Mathieu Malaterre +Bug-Debian: https://bugs.debian.org/1016331 +Forwarded: no +Last-Update: 2022-08-04 + +--- gdcm-3.0.13.orig/Source/MessageExchangeDefinition/gdcmDIMSE.h ++++ gdcm-3.0.13/Source/MessageExchangeDefinition/gdcmDIMSE.h +@@ -76,9 +76,9 @@ class CEchoRSP + public: + /* + Message ID M U +-Message ID Being Responded To  M ++Message ID Being Responded To M + Affected SOP Class UID M U(=) +-Status  M ++Status M + */ + }; + diff -Nru gdcm-3.0.10/debian/patches/series gdcm-3.0.14/debian/patches/series --- gdcm-3.0.10/debian/patches/series 2021-11-23 09:19:38.000000000 +0000 +++ gdcm-3.0.14/debian/patches/series 2022-08-12 07:22:00.000000000 +0000 @@ -7,3 +7,4 @@ #use_swig_add_library_for_csharp.patch #fix_charls_2.patch #fix_swig4.patch +bug1016331.patch diff -Nru gdcm-3.0.10/debian/python3-gdcm.install gdcm-3.0.14/debian/python3-gdcm.install --- gdcm-3.0.10/debian/python3-gdcm.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/python3-gdcm.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,3 +1,3 @@ +usr/lib/python3*/dist-packages/_gdcmswig.so* usr/lib/python3*/dist-packages/gdcm.py usr/lib/python3*/dist-packages/gdcmswig.py -usr/lib/python3*/dist-packages/_gdcmswig.so* diff -Nru gdcm-3.0.10/debian/python3-vtkgdcm.install gdcm-3.0.14/debian/python3-vtkgdcm.install --- gdcm-3.0.10/debian/python3-vtkgdcm.install 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/python3-vtkgdcm.install 2022-08-12 07:22:00.000000000 +0000 @@ -1,2 +1,2 @@ -usr/lib/python3*/dist-packages/vtkgdcm* usr/lib/*/libvtkgdcmPythonD.so* +usr/lib/python3*/dist-packages/vtkgdcm* diff -Nru gdcm-3.0.10/debian/python3-vtkgdcm.lintian-overrides gdcm-3.0.14/debian/python3-vtkgdcm.lintian-overrides --- gdcm-3.0.10/debian/python3-vtkgdcm.lintian-overrides 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/python3-vtkgdcm.lintian-overrides 2022-08-12 07:22:00.000000000 +0000 @@ -8,4 +8,4 @@ python3-vtkgdcm: package-name-doesnt-match-sonames # This seems to be needed for the python module -python3-vtkgdcm: non-dev-pkg-with-shlib-symlink +python3-vtkgdcm: link-to-shared-library-in-wrong-package diff -Nru gdcm-3.0.10/debian/rules gdcm-3.0.14/debian/rules --- gdcm-3.0.10/debian/rules 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/rules 2022-09-24 16:31:05.000000000 +0000 @@ -5,7 +5,6 @@ # results in linking error export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) @@ -62,6 +61,7 @@ # Need to make sure to build using the same vtk/python version: CMAKE_EXTRA_FLAGS += -DCMAKE_SKIP_RPATH=ON \ -DCMAKE_BUILD_TYPE:STRING=None \ + -DCMAKE_CXX_STANDARD:STRING=17 \ -DGDCM_DOXYGEN_NO_FOOTER:BOOL=ON \ -DGDCM_BUILD_APPLICATIONS:BOOL=ON \ -DGDCM_DOCUMENTATION:BOOL=$(BUILDDOC) \ @@ -111,15 +111,13 @@ dh_auto_build override_dh_auto_install-arch: - # See #664188 - sed -i -e "s/FATAL_ERROR/STATUS/g" obj-*/CMake/ExportConfiguration/CMakeFiles/Export/lib/$(DEB_HOST_MULTIARCH)/gdcm-*/GDCMTargets-*.cmake - # See #711214 - sed -i -e "s/FATAL_ERROR/STATUS/g" obj-*/CMake/ExportConfiguration/CMakeFiles/Export/lib/$(DEB_HOST_MULTIARCH)/gdcm-*/GDCMTargets.cmake + # See #664188 and #711214 + find obj-* -name "GDCMTargets*.cmake" -exec sed -i -e "s/FATAL_ERROR/STATUS/g" \{\} \; # See #989296 - sed -i -e 's@/lib/\(.\+\)/libvtkgdcmsharpglue.so@/lib/cli/vtkgdcm-sharp-3.0/libvtkgdcmsharpglue.so@' \ - obj-*/CMake/ExportConfiguration/CMakeFiles/Export/lib/$(DEB_HOST_MULTIARCH)/gdcm-*/GDCMTargets-*.cmake - sed -i -e 's@/lib/python/dist-packages/vtkgdcmPython.so@/lib/python3/dist-packages/vtkgdcmPython.cpython-$(PV)-$(DEB_HOST_MULTIARCH).so@' \ - obj-*/CMake/ExportConfiguration/CMakeFiles/Export/lib/$(DEB_HOST_MULTIARCH)/gdcm-*/GDCMTargets-*.cmake + find obj-* -name "GDCMTargets*.cmake" -exec \ + sed -i -e 's@/lib/\(.\+\)/libvtkgdcmsharpglue.so@/lib/cli/vtkgdcm-sharp-3.0/libvtkgdcmsharpglue.so@' \ + -e 's@/lib/python/dist-packages/vtkgdcmPython.so@/lib/python3/dist-packages/vtkgdcmPython.cpython-$(PV)-$(DEB_HOST_MULTIARCH).so@' \ + \{\} \; dh_auto_install # PHP diff -Nru gdcm-3.0.10/debian/source/include-binaries gdcm-3.0.14/debian/source/include-binaries --- gdcm-3.0.10/debian/source/include-binaries 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/debian/source/include-binaries 2022-08-12 07:22:00.000000000 +0000 @@ -0,0 +1 @@ +debian/tests/data/00191113.dcm diff -Nru gdcm-3.0.10/debian/tests/control gdcm-3.0.14/debian/tests/control --- gdcm-3.0.10/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/debian/tests/control 2022-08-12 07:22:00.000000000 +0000 @@ -0,0 +1,3 @@ +Tests: run-unit-test +Depends: @ +Restrictions: allow-stderr Binary files /tmp/tmpm74dnry_/7Ppm9vjw5V/gdcm-3.0.10/debian/tests/data/00191113.dcm and /tmp/tmpm74dnry_/J_yfV6tPQt/gdcm-3.0.14/debian/tests/data/00191113.dcm differ diff -Nru gdcm-3.0.10/debian/tests/README gdcm-3.0.14/debian/tests/README --- gdcm-3.0.10/debian/tests/README 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/debian/tests/README 2022-08-12 07:22:00.000000000 +0000 @@ -0,0 +1,5 @@ +Tests for gdcm +================= + +The data for tests has been referenced from: + https://sourceforge.net/p/gdcm/gdcmdata/ci/master/tree/gdcm-US-ALOKA-16.dcm diff -Nru gdcm-3.0.10/debian/tests/run-unit-test gdcm-3.0.14/debian/tests/run-unit-test --- gdcm-3.0.10/debian/tests/run-unit-test 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/debian/tests/run-unit-test 2022-08-12 07:22:00.000000000 +0000 @@ -0,0 +1,47 @@ +#!/bin/bash +set -e + +pkg=libgdcm3.0 + +export LC_ALL=C.UTF-8 +if [ "${AUTOPKGTEST_TMP}" = "" ] ; then + AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX) + trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM +fi + +cp -a /usr/share/doc/${pkg}/examples/* "${AUTOPKGTEST_TMP}" + +cd "${AUTOPKGTEST_TMP}" + +echo "6234a50361f02cb9a739755d63cdd673 output.dcm" >> checksums +echo "ca2df89fe6e206514079597eb8ab070f pixeldata.raw" >> checksums + +echo -e "\e[93m\e[1mRunning Tests\e[0m" + +gdcmanon --password password -e 00191113.dcm anon.dcm + +echo -e "\e[92m\e[1mPASS\e[0m" + +gdcminfo 00191113.dcm + +echo -e "\e[92m\e[1mPASS\e[0m" + +gdcmimg --fill 0 --region 0,100,0,100 -i 00191113.dcm -o output_black.dcm + +gdcmconv 00191113.dcm output.dcm + +gdcmraw -i 00191113.dcm -o pixeldata.raw + +md5sum --check checksums + +#check for output file since md5hash varies in s390 +if [ -f "output_black.dcm" ]; then + echo -e "\e[92m\e[1mPASS\e[0m" +else + echo -e "\e[1;31FAILED!" +fi + +gdcmdump output.dcm + +echo -e "\e[92m\e[1mPASS\e[0m" + diff -Nru gdcm-3.0.10/debian/watch gdcm-3.0.14/debian/watch --- gdcm-3.0.10/debian/watch 2021-11-23 09:07:39.000000000 +0000 +++ gdcm-3.0.14/debian/watch 2022-08-12 07:22:00.000000000 +0000 @@ -1,3 +1,3 @@ version=4 opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE@-$1.tar.gz%" \ - https://github.com/malaterre/GDCM/releases .*/v?@ANY_VERSION@\.tar\.gz + https://github.com/malaterre/GDCM/releases/latest .*/v?@ANY_VERSION@\.tar\.gz diff -Nru gdcm-3.0.10/Examples/Csharp/Cleaner.cs gdcm-3.0.14/Examples/Csharp/Cleaner.cs --- gdcm-3.0.10/Examples/Csharp/Cleaner.cs 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Examples/Csharp/Cleaner.cs 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,124 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +/** + */ +/* + * Usage: + * $ export LD_LIBRARY_PATH=$HOME/Projects/gdcm/debug-gcc/bin + * $ mono bin/Cleaner.exe gdcmData/012345.002.050.dcm out.dcm + */ +using System; +using gdcm; + +public class MyWatcher : SimpleSubjectWatcher +{ + public MyWatcher(Subject s):base(s,"Override String"){} + protected override void StartFilter() { + System.Console.WriteLine( "This is my start" ); + } + protected override void EndFilter(){ + System.Console.WriteLine( "This is my end" ); + } + protected override void ShowProgress(Subject caller, Event evt){ + ProgressEvent pe = ProgressEvent.Cast(evt); + System.Console.WriteLine( "This is my progress: " + pe.GetProgress() ); + } + protected override void ShowIteration(){ + System.Console.WriteLine( "This is my iteration" ); + } + protected override void ShowAnonymization(Subject caller, Event evt){ +/* + * A couple of explanation are necessary here to understand how SWIG work + * http://www.swig.org/Doc1.3/Java.html#adding_downcasts + * + * System.Console.WriteLine( "This is my Anonymization. Type: " + evt.GetEventName() ); + * System.Type type = evt.GetType(); + * System.Console.WriteLine( "This is my Anonymization. System.Type: " + type.ToString() ); + * System.Console.WriteLine( "This is my Anonymization. CheckEvent: " + ae.CheckEvent( evt ) ); + * System.Console.WriteLine( "This is my Anonymization. Processing Tag #" + ae.GetTag().toString() ); + */ + AnonymizeEvent ae = AnonymizeEvent.Cast(evt); + if( ae != null ) + { + Tag t = ae.GetTag(); + System.Console.WriteLine( "This is my Anonymization. Processing Tag #" + t.toString() ); + } + else + { + System.Console.WriteLine( "This is my Anonymization. Unhandled Event type: " + evt.GetEventName() ); + } + } + protected override void ShowAbort(){ + System.Console.WriteLine( "This is my abort" ); + } +} + +public class Cleaner +{ + public static int Main(string[] args) + { + gdcm.Global global = gdcm.Global.GetInstance(); + if( !global.LoadResourcesFiles() ) + { + System.Console.WriteLine( "Could not LoadResourcesFiles" ); + return 1; + } + + string file1 = args[0]; + string file2 = args[1]; + Reader reader = new Reader(); + reader.SetFileName( file1 ); + bool ret = reader.Read(); + if( !ret ) + { + return 1; + } + + SmartPtrCleaner scleaner = gdcm.Cleaner.New(); + gdcm.Cleaner cleaner = scleaner.__ref__(); + + //SimpleSubjectWatcher watcher = new SimpleSubjectWatcher(cleaner, "Anonymizer"); + MyWatcher watcher = new MyWatcher(cleaner); + + cleaner.SetFile( reader.GetFile() ); + cleaner.Empty( new gdcm.VR(gdcm.VR.VRType.PN) ); + gdcm.DPath dpath = new gdcm.DPath(); + dpath.ConstructFromString( "/0010,0010" ); + cleaner.Preserve( dpath ); + gdcm.Tag t1 = new gdcm.Tag(0x10, 0x30); + cleaner.Empty( t1 ); + gdcm.PrivateTag pt0 = new gdcm.PrivateTag( new gdcm.Tag(0x29,0x60), "SIEMENS MEDCOM HEADER2" ); + cleaner.Remove( pt0 ); + gdcm.PrivateTag pt1 = new gdcm.PrivateTag( new gdcm.Tag(0x29,0x10), "SIEMENS CSA HEADER" ); + gdcm.PrivateTag pt2 = new gdcm.PrivateTag( new gdcm.Tag(0x29,0x20), "SIEMENS CSA HEADER" ); + cleaner.Scrub( pt1 ); + cleaner.Scrub( pt2 ); + if( !cleaner.Clean() ) + { + return 1; + } + + Writer writer = new Writer(); + writer.SetFileName( file2 ); + writer.SetFile( cleaner.GetFile() ); + ret = writer.Write(); + if( !ret ) + { + return 1; + } + + return 0; + } +} diff -Nru gdcm-3.0.10/Examples/Csharp/CMakeLists.txt gdcm-3.0.14/Examples/Csharp/CMakeLists.txt --- gdcm-3.0.10/Examples/Csharp/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Examples/Csharp/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -32,6 +32,7 @@ if(BUILD_TESTING) list(APPEND CSHARP_EXAMPLES BasicAnonymizer + Cleaner ClinicalTrialIdentificationWorkflow ) endif() diff -Nru gdcm-3.0.10/.gitattributes gdcm-3.0.14/.gitattributes --- gdcm-3.0.10/.gitattributes 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/.gitattributes 2022-06-24 07:37:44.000000000 +0000 @@ -1,5 +1,9 @@ appveyor.yml merge=ours * -whitespace -/Source/DataDictionary/gdcmDefaultDicts.cxx hooks.MaxObjectKiB=2048 -/Source/InformationObjectDefinition/Part3.xml hooks.MaxObjectKiB=4096 +/Source/DataDictionary/gdcmDefaultDicts.cxx hooks-max-size=1500000 +/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx hooks-max-size=1500000 +/Source/DataDictionary/gdcmTagToType.h hooks-max-size=1500000 +/Source/InformationObjectDefinition/Part3.xml hooks-max-size=3000000 +/Source/DataDictionary/privatedicts.xml hooks-max-size=1500000 +/Utilities/gdcmopenjpeg/src/lib/openjp2/j2k.c hooks-max-size=750000 diff -Nru gdcm-3.0.10/.github/workflows/c-cpp.yml gdcm-3.0.14/.github/workflows/c-cpp.yml --- gdcm-3.0.10/.github/workflows/c-cpp.yml 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/.github/workflows/c-cpp.yml 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,26 @@ +name: C/C++ CI + +on: + push: + branches: [ "release" ] + pull_request: + branches: [ "release" ] + +jobs: + example_matrix: + strategy: + matrix: + os: [windows-latest, ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - name: checkout source + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 2 + - name: configure + run: cmake -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=None -B build + - name: make + run: cmake --build build + - name: make check + run: ctest --test-dir build --parallel 2 --output-on-failure || true diff -Nru gdcm-3.0.10/Source/Common/CMakeLists.txt gdcm-3.0.14/Source/Common/CMakeLists.txt --- gdcm-3.0.10/Source/Common/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -64,6 +64,9 @@ CHECK_CXX_SOURCE_COMPILES( "\#include \nint main() { const wchar_t fn[10] = {}; std::ifstream is( fn ); return 0;}" GDCM_HAVE_WCHAR_IFSTREAM) +CHECK_CXX_SOURCE_COMPILES( + "\#include \n#include \n#include \nint main() { std::u16string u16; std::string utf8 = std::wstring_convert, char16_t>{}.to_bytes(u16); }" + GDCM_HAVE_CODECVT) if(GDCM_USE_SYSTEM_OPENSSL) set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} @@ -74,6 +77,9 @@ #HAVE_CMS_RECIPIENT_KEY) "\#include \nint main() { CMS_add0_recipient_password(0,0,0,0,0,0,0); return 0;}" GDCM_HAVE_CMS_RECIPIENT_PASSWORD) +CHECK_CXX_SOURCE_COMPILES( + "\#include \nint main() { const void*mem; int len; BIO_new_mem_buf(mem, len); }" + OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF) endif() #----------------------------------------------------------------------------- @@ -164,6 +170,11 @@ gdcmOpenSSLP7CryptoFactory.cxx gdcmOpenSSLP7CryptographicMessageSyntax.cxx ) +if(OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF) +set_source_files_properties( + gdcmOpenSSLP7CryptographicMessageSyntax.cxx + PROPERTIES COMPILE_FLAGS "-DOPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF") +endif() endif() if(GDCM_USE_SYSTEM_OPENSSL AND GDCM_HAVE_CMS_RECIPIENT_PASSWORD) @@ -171,6 +182,11 @@ gdcmOpenSSLCryptoFactory.cxx gdcmOpenSSLCryptographicMessageSyntax.cxx ) +if(OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF) +set_source_files_properties( + gdcmOpenSSLCryptographicMessageSyntax.cxx + PROPERTIES COMPILE_FLAGS "-DOPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF") +endif() endif() if(GDCM_BUILD_TESTING) diff -Nru gdcm-3.0.10/Source/Common/gdcmBase64.cxx gdcm-3.0.14/Source/Common/gdcmBase64.cxx --- gdcm-3.0.10/Source/Common/gdcmBase64.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmBase64.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -59,7 +59,6 @@ { std::string ret; size_t i = 0; - size_t j = 0; unsigned char char_array_3[3]; unsigned char char_array_4[4]; @@ -79,7 +78,7 @@ if (i) { - for(j = i; j < 3; j++) + for(size_t j = i; j < 3; j++) char_array_3[j] = '\0'; char_array_4[0] = (unsigned char)((char_array_3[0] & 0xfc) >> 2); @@ -87,7 +86,7 @@ char_array_4[2] = (unsigned char)(((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6)); char_array_4[3] = (unsigned char)(char_array_3[2] & 0x3f); - for (j = 0; j < i + 1; j++) + for (size_t j = 0; j < i + 1; j++) ret += base64_chars[char_array_4[j]]; while((i++ < 3)) @@ -102,7 +101,6 @@ { size_t in_len = encoded_string.size(); size_t i = 0; - size_t j = 0; size_t in_ = 0; unsigned char char_array_4[4], char_array_3[3]; std::string ret; @@ -124,17 +122,18 @@ } if (i) { - for (j = i; j <4; j++) + for (size_t j = i; j <4; j++) char_array_4[j] = 0; - for (j = 0; j <4; j++) + for (size_t j = 0; j <4; j++) char_array_4[j] = (unsigned char)base64_chars.find(char_array_4[j]); char_array_3[0] = (unsigned char)((char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4)); char_array_3[1] = (unsigned char)(((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2)); char_array_3[2] = (unsigned char)(((char_array_4[2] & 0x3) << 6) + char_array_4[3]); - for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; + for (size_t j = 0; (j < i - 1); j++) + ret += char_array_3[j]; } return ret; diff -Nru gdcm-3.0.10/Source/Common/gdcmByteSwap.txx gdcm-3.0.14/Source/Common/gdcmByteSwap.txx --- gdcm-3.0.10/Source/Common/gdcmByteSwap.txx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmByteSwap.txx 2022-06-24 07:37:44.000000000 +0000 @@ -105,10 +105,10 @@ void Swap4(T &a, SwapCode const &swapcode) { #ifndef GDCM_WORDS_BIGENDIAN - if ( swapcode == 4321 || swapcode == 2143 ) - a = (T)(( a << 8 ) | ( a >> 8 )); + if ( swapcode == gdcm::SwapCode::BigEndian || swapcode == gdcm::SwapCode::BadBigEndian ) + a = ( a << 8 ) | ( a >> 8 ); #else - if ( swapcode == 1234 || swapcode == 3412 ) + if ( swapcode == gdcm::SwapCode::LittleEndian || swapcode == gdcm::SwapCode::BadLittleEndian ) a = ( a << 8 ) | ( a >> 8 ); // On big endian as long as the SwapCode is Unknown let's pretend we were // on a LittleEndian system (might introduce overhead on those system). @@ -129,20 +129,20 @@ a= (( a<<24) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | (a>>24) ); #endif break; - case 1234 : + case gdcm::SwapCode::LittleEndian : #ifdef GDCM_WORDS_BIGENDIAN a= (( a<<24) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | (a>>24) ); #endif break; - case 4321 : + case gdcm::SwapCode::BigEndian : #ifndef GDCM_WORDS_BIGENDIAN a= (( a<<24) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | (a>>24) ); #endif break; - case 3412 : + case gdcm::SwapCode::BadLittleEndian : a= ((a<<16) | (a>>16) ); break; - case 2143 : + case gdcm::SwapCode::BadBigEndian : a= (((a<< 8) & 0xff00ff00) | ((a>>8) & 0x00ff00ff) ); break; default : @@ -160,21 +160,21 @@ a= (( a<<24) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | (a>>24) ); #endif break; - case 1234 : + case gdcm::SwapCode::LittleEndian : #ifdef GDCM_WORDS_BIGENDIAN a= (( a<<24) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | (a>>24) ); #endif break; - case 4321 : + case gdcm::SwapCode::BigEndian : #ifndef GDCM_WORDS_BIGENDIAN // probably not really useful since the lowest 0x0000 are what's used in unsigned shorts // a= (( a<<24) | ((a<<8) & 0x00ff0000) | ((a>>8) & 0x0000ff00) | (a>>24) ); #endif break; - case 3412 : + case gdcm::SwapCode::BadLittleEndian : //a= ((a<<16) | (a>>16) );//do nothing, a = a break; - case 2143 : + case gdcm::SwapCode::BadBigEndian : a= (uint16_t)(((a<< 8) & 0xff00) | ((a>>8) & 0x00ff) ); break; default : diff -Nru gdcm-3.0.10/Source/Common/gdcmConfigure.h.in gdcm-3.0.14/Source/Common/gdcmConfigure.h.in --- gdcm-3.0.10/Source/Common/gdcmConfigure.h.in 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmConfigure.h.in 2022-06-24 07:37:44.000000000 +0000 @@ -32,9 +32,6 @@ # define GDCM_WORDS_BIGENDIAN #endif -/* Allow access to UINT32_MAX , cf gdcmCommon.h */ -#define __STDC_LIMIT_MACROS - /* Hard code the path to the public dictionary */ #define PUB_DICT_PATH "@GDCM_PUB_DICT_PATH@" @@ -78,10 +75,6 @@ #cmakedefine GDCM_AUTOLOAD_GDCMJNI -/* I guess something important */ -#cmakedefine GDCM_HAVE_STDINT_H -#cmakedefine GDCM_HAVE_INTTYPES_H - /* This variable allows you to have helpful debug statement */ /* That are in between #ifdef / endif in the gdcm code */ /* That means if GDCM_DEBUG is OFF there shouldn't be any 'cout' at all ! */ @@ -124,6 +117,10 @@ // UTF-8 #cmakedefine GDCM_HAVE_WCHAR_IFSTREAM +// https://stackoverflow.com/questions/15615136/is-codecvt-not-a-std-header +// https://stackoverflow.com/questions/50867257/c-use-of-wstring-convert-on-linux +#cmakedefine GDCM_HAVE_CODECVT + #cmakedefine GDCM_FORCE_BIGENDIAN_EMULATION #ifndef GDCM_OVERRIDE_BROKEN_IMPLEMENTATION diff -Nru gdcm-3.0.10/Source/Common/gdcmMD5.cxx gdcm-3.0.14/Source/Common/gdcmMD5.cxx --- gdcm-3.0.10/Source/Common/gdcmMD5.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmMD5.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -21,6 +21,10 @@ #endif #include #include +#include +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif // http://stackoverflow.com/questions/13256446/compute-md5-hash-value-by-c-winapi namespace gdcm @@ -39,17 +43,17 @@ MD5_Update(&ctx, buffer, buf_len); MD5_Final(digest, &ctx); for (int di = 0; di < 16; ++di) - sprintf(digest_str+2*di, "%02x", digest[di]); + snprintf(digest_str+2*di, 3, "%02x", digest[di]); digest_str[2*16] = '\0'; return true; #elif defined(GDCM_BUILD_TESTING) md5_byte_t digest[16]; md5_state_t state; md5_init(&state); - md5_append(&state, (const md5_byte_t *)buffer, (int)buf_len); + md5_append(&state, (const md5_byte_t *)buffer, buf_len); md5_finish(&state, digest); for (int di = 0; di < 16; ++di) - sprintf(digest_str+2*di, "%02x", digest[di]); + snprintf(digest_str+2*di, 3, "%02x", digest[di]); digest_str[2*16] = '\0'; return true; #else @@ -95,7 +99,7 @@ md5_state_t state; md5_init(&state); - md5_append(&state, (const md5_byte_t *)buffer, (int)file_size); + md5_append(&state, (const md5_byte_t *)buffer, file_size); md5_finish(&state, digest); return true; @@ -124,7 +128,7 @@ for (int di = 0; di < 16; ++di) { - sprintf(digest_str+2*di, "%02x", digest[di]); + snprintf(digest_str+2*di, 3, "%02x", digest[di]); } digest_str[2*16] = '\0'; return true; diff -Nru gdcm-3.0.10/Source/Common/gdcmOpenSSLCryptographicMessageSyntax.cxx gdcm-3.0.14/Source/Common/gdcmOpenSSLCryptographicMessageSyntax.cxx --- gdcm-3.0.10/Source/Common/gdcmOpenSSLCryptographicMessageSyntax.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmOpenSSLCryptographicMessageSyntax.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -97,7 +97,11 @@ goto err; } +#ifdef OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF in = BIO_new_mem_buf((const void*)array, (int)len); +#else + in = BIO_new_mem_buf((void*)array, (int)len); +#endif if(!in) { gdcmErrorMacro( "Error at creating the input memory buffer." ); @@ -183,7 +187,11 @@ goto err; } +#ifdef OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF in = BIO_new_mem_buf((const void*)array, (int)len); +#else + in = BIO_new_mem_buf((void*)array, (int)len); +#endif if (!in) { gdcmErrorMacro( "Error at creating the input memory buffer." ); diff -Nru gdcm-3.0.10/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx gdcm-3.0.14/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx --- gdcm-3.0.10/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -153,7 +153,11 @@ gdcmErrorMacro( "len is too big: " << len ); return false; } +#ifdef OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF BIO *data = BIO_new_mem_buf((const void*)array, (int)len); +#else + BIO *data = BIO_new_mem_buf((void*)array, (int)len); +#endif if(!data) { gdcmErrorMacro( "BIO_new_mem_buf" ); @@ -308,7 +312,11 @@ gdcmErrorMacro( "len is too big: " << len ); return false; } +#ifdef OPENSSL_HAS_CONST_VOID_BIO_NEW_MEM_BUF data = BIO_new_mem_buf((const void*)array, (int)len); +#else + data = BIO_new_mem_buf((void*)array, (int)len); +#endif if(!data) goto err; diff -Nru gdcm-3.0.10/Source/Common/gdcmSHA1.cxx gdcm-3.0.14/Source/Common/gdcmSHA1.cxx --- gdcm-3.0.10/Source/Common/gdcmSHA1.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmSHA1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -20,7 +20,7 @@ #include // memcmp #include // malloc -#include // sprintf +#include // snprintf /* */ @@ -62,7 +62,7 @@ for (int di = 0; di < 20; ++di) { - sprintf(digest+2*di, "%02x", output[di]); + snprintf(digest+2*di, 3, "%02x", output[di]); } digest[2*20] = '\0'; @@ -131,7 +131,7 @@ for (int di = 0; di < 20; ++di) { - sprintf(digest_str+2*di, "%02x", digest[di]); + snprintf(digest_str+2*di, 3, "%02x", digest[di]); } digest_str[2*20] = '\0'; return true; diff -Nru gdcm-3.0.10/Source/Common/gdcmSwapper.h gdcm-3.0.14/Source/Common/gdcmSwapper.h --- gdcm-3.0.10/Source/Common/gdcmSwapper.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmSwapper.h 2022-06-24 07:37:44.000000000 +0000 @@ -25,7 +25,7 @@ { public: template static T Swap(T val) {return val;} - template static void SwapArray(T *, unsigned int ) {} + template static void SwapArray(T *, size_t ) {} }; class SwapperNoOp @@ -33,10 +33,10 @@ public: template static T Swap(T val); template - static void SwapArray(T *array, unsigned int n) + static void SwapArray(T *array, size_t n) { // TODO: need to unroll loop: - for(unsigned int i = 0; i < n; ++i) + for(size_t i = 0; i < n; ++i) { array[i] = Swap(array[i]); } diff -Nru gdcm-3.0.10/Source/Common/gdcmSwapper.txx gdcm-3.0.14/Source/Common/gdcmSwapper.txx --- gdcm-3.0.10/Source/Common/gdcmSwapper.txx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmSwapper.txx 2022-06-24 07:37:44.000000000 +0000 @@ -14,6 +14,8 @@ #ifndef GDCMSWAPPER_TXX #define GDCMSWAPPER_TXX +#include + #if defined(_MSC_VER) // http://msdn.microsoft.com/en-us/library/a3140177 @@ -106,7 +108,12 @@ } template <> inline float SwapperNoOp::Swap(float val) { - return Swap((uint32_t)val); + uint32_t tempI; + memcpy(&tempI, &val, sizeof(uint32_t)); + tempI = Swap(tempI); + float tempF; + memcpy(&tempF, &tempI, sizeof(uint32_t)); + return tempF; } template <> inline uint64_t SwapperNoOp::Swap(uint64_t val) { @@ -118,7 +125,12 @@ } template <> inline double SwapperNoOp::Swap(double val) { - return Swap((uint64_t)val); + uint64_t tempI; + memcpy(&tempI, &val, sizeof(uint64_t)); + tempI = Swap(tempI); + double tempF; + memcpy(&tempF, &tempI, sizeof(uint64_t)); + return tempF; } template <> inline Tag SwapperNoOp::Swap(Tag val) @@ -126,9 +138,9 @@ return Tag( Swap(val.GetGroup()), Swap(val.GetElement()) ); } - template <> inline void SwapperNoOp::SwapArray(uint8_t *, unsigned int ) {} + template <> inline void SwapperNoOp::SwapArray(uint8_t *, size_t ) {} - template <> inline void SwapperNoOp::SwapArray(float *array, unsigned int n) + template <> inline void SwapperNoOp::SwapArray(float *array, size_t n) { switch( sizeof(float) ) { @@ -140,7 +152,7 @@ } } - template <> inline void SwapperNoOp::SwapArray(double *array, unsigned int n) + template <> inline void SwapperNoOp::SwapArray(double *array, size_t n) { switch( sizeof(double) ) { @@ -172,7 +184,12 @@ } template <> inline float SwapperDoOp::Swap(float val) { - return static_cast(Swap((uint32_t)val)); + uint32_t tempI; + memcpy(&tempI, &val, sizeof(uint32_t)); + tempI = Swap(tempI); + float tempF; + memcpy(&tempF, &tempI, sizeof(uint32_t)); + return tempF; } template <> inline uint64_t SwapperDoOp::Swap(uint64_t val) { @@ -184,7 +201,12 @@ } template <> inline double SwapperDoOp::Swap(double val) { - return static_cast(Swap((uint64_t)val)); + uint64_t tempI; + memcpy(&tempI, &val, sizeof(uint64_t)); + tempI = Swap(tempI); + double tempF; + memcpy(&tempF, &tempI, sizeof(uint64_t)); + return tempF; } template <> inline Tag SwapperDoOp::Swap(Tag val) diff -Nru gdcm-3.0.10/Source/Common/gdcmSystem.cxx gdcm-3.0.14/Source/Common/gdcmSystem.cxx --- gdcm-3.0.10/Source/Common/gdcmSystem.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmSystem.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -1100,8 +1100,8 @@ const char *codeset2; codeset1 = buf1; codeset2 = buf2; - sprintf(buf1, "CP%d", GetConsoleCP()); - sprintf(buf2, "CP%d", GetConsoleOutputCP()); + snprintf(buf1, sizeof(buf1), "CP%d", GetConsoleCP()); + snprintf(buf2, sizeof(buf2), "CP%d", GetConsoleOutputCP()); // BUG: both returns 'CP437' on debian + mingw32... // instead prefer GetACP() call: @@ -1109,7 +1109,7 @@ static char buf[2+10+1]; // 2 char, 10 bytes + 0 // GetACP: Retrieves the current Windows ANSI code page identifier for the // operating system. - sprintf (buf, "CP%u", GetACP ()); + snprintf (buf, sizeof(buf), "CP%u", GetACP ()); codeset = CharsetAliasToName(buf); #endif diff -Nru gdcm-3.0.10/Source/Common/gdcmTerminal.cxx gdcm-3.0.14/Source/Common/gdcmTerminal.cxx --- gdcm-3.0.10/Source/Common/gdcmTerminal.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmTerminal.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -16,6 +16,10 @@ #include #include #include +#include +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -75,12 +79,12 @@ void setbgcolor(int col) { bgcolor = col; } //std::string resettextcolor() const { // char command[13]; - // sprintf(command, "%c[%d;%d;%dm", 0x1B, 0, 0, 0); + // snprintf(command, sizeof(command), "%c[%d;%d;%dm", 0x1B, 0, 0, 0); // return command; //} std::string textcolor() const { char command[16]; - int n = sprintf(command, "%c[%d;%d;%dm", 0x1B, attribute, fgcolor + 30, bgcolor + 40); + int n = snprintf(command, sizeof(command), "%c[%d;%d;%dm", 0x1B, attribute, fgcolor + 30, bgcolor + 40); assert( n < 16 ); (void)n; return command; } diff -Nru gdcm-3.0.10/Source/Common/gdcmTesting.cxx gdcm-3.0.14/Source/Common/gdcmTesting.cxx --- gdcm-3.0.10/Source/Common/gdcmTesting.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmTesting.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -451,6 +451,7 @@ { 0,"Bug_Siemens_PrivateIconNoItem.dcm" }, { 0,"HardcopyColor_YBR_RCT_J2K_PC1.dcm" }, { 0,"PET-GE-dicomwrite-PixelDataSQUNv2.dcm" }, +{ 0,"MEDILABValidCP246_EVRLESQasOB.dcm" }, { 0, nullptr } }; diff -Nru gdcm-3.0.10/Source/Common/gdcmTypes.h gdcm-3.0.14/Source/Common/gdcmTypes.h --- gdcm-3.0.10/Source/Common/gdcmTypes.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/Common/gdcmTypes.h 2022-06-24 07:37:44.000000000 +0000 @@ -19,39 +19,7 @@ #include "gdcmLegacyMacro.h" //----------------------------------------------------------------------------- -#ifdef GDCM_HAVE_STDINT_H -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS -#endif // __STDC_LIMIT_MACROS -#include -//#undef __STDC_LIMIT_MACROS -#else -#ifdef GDCM_HAVE_INTTYPES_H -// Old system only have this -#include // For uint8_t uint16_t and uint32_t -#else -// Broken plateforms do not respect C99 and do not provide those typedef -// Special case for recent Borland compiler, comes with stdint.h -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x0560) || defined(__MINGW32__) -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned __int64 uint64_t; -#elif defined(_MSC_VER) -#include "stdint.h" -#else -#error "Sorry, your platform is not supported" -#endif // defined(_MSC_VER) || defined(__BORLANDC__) && (__BORLANDC__ < 0x0560) || defined(__MINGW32__) -#endif // GDCM_HAVE_INTTYPES_H -#endif // GDCM_HAVE_STDINT_H - -// Basically for VS6 and bcc 5.5.1: -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif +#include //----------------------------------------------------------------------------- #endif //GDCMTYPES_H diff -Nru gdcm-3.0.10/Source/DataDictionary/DefaultPrivateDicts.xsl gdcm-3.0.14/Source/DataDictionary/DefaultPrivateDicts.xsl --- gdcm-3.0.10/Source/DataDictionary/DefaultPrivateDicts.xsl 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataDictionary/DefaultPrivateDicts.xsl 2022-06-24 07:37:44.000000000 +0000 @@ -36,8 +36,8 @@ =========================================================================*/ -#ifndef GDCMDEFAULTDICTS_CXX -#define GDCMDEFAULTDICTS_CXX +#ifndef GDCMPRIVATEDEFAULTDICTS_CXX +#define GDCMPRIVATEDEFAULTDICTS_CXX #include "gdcmDicts.h" #include "gdcmVR.h" @@ -191,7 +191,7 @@ } } // end namespace gdcm -#endif // GDCMDEFAULTDICTS_CXX +#endif // GDCMPRIVATEDEFAULTDICTS_CXX diff -Nru gdcm-3.0.10/Source/DataDictionary/gdcmDictConverter.cxx gdcm-3.0.14/Source/DataDictionary/gdcmDictConverter.cxx --- gdcm-3.0.10/Source/DataDictionary/gdcmDictConverter.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataDictionary/gdcmDictConverter.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -226,7 +226,7 @@ int r = sscanf(raw, "%04x", &v); assert( r == 1 && "Wrong Value read for uint16"); char sv[4+1]; - r = sprintf(sv, "%04x", v); + r = snprintf(sv, sizeof(sv), "%04x", v); assert( r == 4 && "Wrong Value printed for uint16"); assert( strncmp(raw, sv, 4) == 0 ); ov = v; diff -Nru gdcm-3.0.10/Source/DataDictionary/gdcmDicts.cxx gdcm-3.0.14/Source/DataDictionary/gdcmDicts.cxx --- gdcm-3.0.10/Source/DataDictionary/gdcmDicts.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataDictionary/gdcmDicts.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -87,18 +87,9 @@ } else { - if( owner && *owner ) - { - static const DictEntry Dummy("Private Element Without Private Creator", - "PrivateElementWithoutPrivateCreator", VR::INVALID, VM::VM0); - return Dummy; - } - else - { - static const DictEntry Dummy("Private Element With Empty Private Creator", - "PrivateElementWithEmptyPrivateCreator", VR::INVALID, VM::VM0); - return Dummy; - } + static const DictEntry Dummy("Private Element With Empty Private Creator", + "PrivateElementWithEmptyPrivateCreator", VR::INVALID, VM::VM0); + return Dummy; } } } diff -Nru gdcm-3.0.10/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx gdcm-3.0.14/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx --- gdcm-3.0.10/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataDictionary/gdcmPrivateDefaultDicts.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -1,6 +1,6 @@ // GENERATED FILE DO NOT EDIT -// $ xsltproc DefaultDicts.xsl DICOMV3.xml > gdcmDefaultDicts.cxx +// $ xsltproc DefaultPrivateDicts.xsl privatedicts.xml > gdcmPrivateDefaultDicts.cxx /*========================================================================= @@ -38,6 +38,34 @@ }; static const DICT_ENTRY DICOMV3DataDict [] = { + {0x6001,0x0003,"Merge eFilm Fusion",VR::CS,VM::VM1,"?",false }, + {0x6001,0x0030,"Merge eFilm Fusion",VR::US,VM::VM1,"?",false }, + {0x6001,0x0032,"Merge eFilm Fusion",VR::US,VM::VM1,"?",false }, + {0x0031,0x0000,"GEMS_MRPT_01",VR::SH,VM::VM1,"?",false }, + {0x0027,0x0001,"SIEMENS SYNGO ENHANCED IDATASET API",VR::CS,VM::VM1,"Business Unit Code",false }, + {0x0027,0x0002,"SIEMENS SYNGO ENHANCED IDATASET API",VR::LO,VM::VM1,"Application Type",false }, + {0x0027,0x0003,"SIEMENS SYNGO ENHANCED IDATASET API",VR::SQ,VM::VM1,"Application Attributes Sequence",false }, + {0x0021,0x0001,"SIEMENS MR IMA",VR::SQ,VM::VM1,"?",false }, + {0x0071,0x0002,"SIEMENS MED PT MU MAP",VR::UI,VM::VM1,"?",false }, + {0x0071,0x0021,"Visage",VR::UT,VM::VM1,"?",false }, + {0x0071,0x0022,"Visage",VR::DT,VM::VM1,"?",false }, + {0x0009,0x008c,"SIEMENS SYNGO INDEX SERVICE",VR::LO,VM::VM1,"?",false }, + {0x0009,0x0000,"MORPHING REPLAY INFO",VR::UN,VM::VM1,"?",false }, // wtf: VR is SQ but contains non-SQ nested sub-elements... + {0x0029,0x0031,"FujiFILM TM",VR::SQ,VM::VM1,"? PHI found ?",false }, // + {0x7fd9,0x0060,"agfa/studyUpdate",VR::DT,VM::VM1,"?",false }, + {0x7fdd,0x0013,"agfa/originalStudyUID",VR::UI,VM::VM1,"?",false }, // most likely UI ?? + {0x7fdb,0x0012,"agfa/seriesHeader",VR::UN,VM::VM1,"?",false }, + {0x7fdb,0x0053,"agfa/seriesHeader",VR::UN,VM::VM1,"?",false }, + {0x7fdb,0x0054,"agfa/seriesHeader",VR::UN,VM::VM1,"?",false }, + {0x7fdb,0x0055,"agfa/seriesHeader",VR::UN,VM::VM1,"?",false }, + {0x7fdd,0x0042,"Thinking Systems Private Creator",VR::UL,VM::VM1,"?",false }, + {0x7fdd,0x0093,"Thinking Systems Private Creator",VR::LO,VM::VM1,"?",false }, + {0x7fdd,0x0094,"Thinking Systems Private Creator",VR::LO,VM::VM1,"?",false }, + {0x7fdd,0x0097,"Thinking Systems Private Creator",VR::LO,VM::VM1,"?",false }, + {0x0025,0x0001,"SIEMENS MR EXTRACTED CSA HEADER",VR::SQ,VM::VM1,"?",false }, + {0x0025,0x0002,"SIEMENS MR EXTRACTED CSA HEADER",VR::LO,VM::VM1,"?",false }, + {0x0025,0x0003,"SIEMENS MR EXTRACTED CSA HEADER",VR::AT,VM::VM1,"?",false }, + {0x0025,0x0004,"SIEMENS MR EXTRACTED CSA HEADER",VR::SS,VM::VM1,"?",false }, {0x0009,0x0002,"TOSHIBA_MEC_MR3^10",VR::SH,VM::VM1,"?",false }, {0x0011,0x0003,"TOSHIBA_MEC_MR3^10",VR::US,VM::VM1,"?",false }, {0x0011,0x0004,"TOSHIBA_MEC_MR3^10",VR::SQ,VM::VM1,"?",false }, @@ -571,12 +599,13 @@ {0x0071,0x0024,"SIEMENS MED PT",VR::CS,VM::VM1,"Table Motion",false}, {0x0021,0x0001,"SIEMENS MR SDR 01",VR::LO,VM::VM1,"??",false}, {0x0021,0x0001,"SIEMENS MR SDS 01",VR::IS,VM::VM1,"??",false}, - {0x0021,0x0002,"SIEMENS MR SDR 01",VR::LO,VM::VM1,"??",false}, + {0x0021,0x0002,"SIEMENS MR SDR 01",VR::LO,VM::VM1_n,"??",false}, + {0x0021,0x0003,"SIEMENS MR SDR 01",VR::LO,VM::VM1,"?",false}, {0x0021,0x0003,"SIEMENS MR SDI 02",VR::DS,VM::VM1,"FrameAcquisitionDuration",false}, {0x0021,0x0004,"SIEMENS MR SDI 02",VR::DS,VM::VM1,"??",false}, {0x0021,0x0004,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, - {0x0021,0x0005,"SIEMENS MR SDS 01",VR::IS,VM::VM3,"??",false}, {0x0021,0x0005,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"ICE_Dims",false}, + {0x0021,0x0005,"SIEMENS MR SDS 01",VR::IS,VM::VM3,"??",false}, {0x0021,0x0006,"SIEMENS MR SDI 02",VR::LO,VM::VM1,"ICE_Dims",false}, {0x0021,0x0006,"SIEMENS MR SDS 01",VR::LO,VM::VM1,"CoilForGradient",false}, {0x0021,0x0007,"SIEMENS MR SDS 01",VR::LO,VM::VM1,"LongModelName",false}, @@ -594,16 +623,17 @@ {0x0021,0x0016,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x0017,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x0018,"SIEMENS MR SDS 01",VR::SH,VM::VM1,"?RFSWDMostCriticalAspect?",false}, - {0x0021,0x0019,"SIEMENS MR SDS 01",VR::OW,VM::VM1,"PhoenixMetaProtocol",false}, - {0x0021,0x001a,"SIEMENS MR SDS 01",VR::LO,VM::VM1,"??",false}, + {0x0021,0x0019,"SIEMENS MR SDS 01",VR::OB,VM::VM1,"PhoenixMetaProtocol",false}, {0x0021,0x001a,"SIEMENS MR SDI 02",VR::SH,VM::VM1,"?RFSWDDataType?",false}, + {0x0021,0x001a,"SIEMENS MR SDS 01",VR::LO,VM::VM1,"??",false}, {0x0021,0x001b,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x001c,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, {0x0021,0x001c,"SIEMENS MR SDS 01",VR::DS,VM::VM3,"??",false}, {0x0021,0x001d,"SIEMENS MR SDS 01",VR::IS,VM::VM1,"??",false}, + {0x0021,0x0021,"SIEMENS MR SDI 02",VR::CS,VM::VM1,"?DiffusionDirectionality?",false}, {0x0021,0x0022,"SIEMENS MR SDS 01",VR::SH,VM::VM1,"Manufacturer",false}, + {0x0021,0x0023,"SIEMENS MR SDI 02",VR::FD,VM::VM6,"?",false }, {0x0021,0x0023,"SIEMENS MR SDS 01",VR::IS,VM::VM1,"??",false}, - {0x0021,0x0021,"SIEMENS MR SDI 02",VR::CS,VM::VM1,"?DiffusionDirectionality?",false}, {0x0021,0x0024,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, {0x0021,0x0025,"SIEMENS MR SDS 01",VR::SL,VM::VM3,"?ImaAbsTablePosition?",false}, {0x0021,0x0026,"SIEMENS MR SDS 01",VR::IS,VM::VM1_n,"?MiscSequenceParam?",false}, @@ -618,54 +648,69 @@ {0x0021,0x0031,"SIEMENS MR SDS 01",VR::IS,VM::VM1,"PtabAbsStartPosZ",false}, {0x0021,0x0032,"SIEMENS MR SDS 01",VR::SS,VM::VM1,"??",false}, {0x0021,0x0033,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"?CoilForGradient2?",false}, - {0x0021,0x0035,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, {0x0021,0x0033,"SIEMENS MR SDS 01",VR::SH,VM::VM1,"??",false}, {0x0021,0x0034,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, + {0x0021,0x0035,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, {0x0021,0x0035,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x0036,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x0037,"SIEMENS MR SDS 01",VR::SH,VM::VM1,"??",false}, {0x0021,0x0038,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x003b,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x003d,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"?Image Acquisition Param?",false}, + {0x0021,0x003f,"SIEMENS MR SDS 01",VR::UT,VM::VM1,"?",false }, {0x0021,0x0041,"SIEMENS MR SDI 02",VR::SH,VM::VM1,"?GSWDDataType?",false}, {0x0021,0x0042,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"?RealDwellTime?",false}, {0x0021,0x0044,"SIEMENS MR SDS 01",VR::DS,VM::VM2,"??",false}, {0x0021,0x0045,"SIEMENS MR SDI 02",VR::SL,VM::VM3,"?Table Position?",false}, {0x0021,0x0045,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, + {0x0021,0x0046,"SIEMENS MR SDI 02",VR::FD,VM::VM3,"?",false }, {0x0021,0x0046,"SIEMENS MR SDS 01",VR::DS,VM::VM1,"??",false}, {0x0021,0x0047,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, - {0x0021,0x0048,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, - {0x0021,0x0049,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, {0x0021,0x0048,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, + {0x0021,0x0048,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, {0x0021,0x0049,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, + {0x0021,0x0049,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, {0x0021,0x004e,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"??",false}, {0x0021,0x004f,"SIEMENS MR SDI 02",VR::LO,VM::VM1,"ImaCoilString",false}, {0x0021,0x0050,"SIEMENS MR SDS 01",VR::US,VM::VM1,"??",false}, {0x0021,0x0051,"SIEMENS MR SDI 02",VR::UL,VM::VM1,"?SequenceMask?",false}, + {0x0021,0x0051,"SIEMENS MR SDS 01",VR::US,VM::VM1,"??",false}, {0x0021,0x0053,"SIEMENS MR SDI 02",VR::FD,VM::VM1,"?BandwidthPerPixelPhaseEncode?",false}, + {0x0021,0x0053,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, {0x0021,0x0054,"SIEMENS MR SDI 02",VR::US,VM::VM1,"??",false}, {0x0021,0x0056,"SIEMENS MR SDI 02",VR::LO,VM::VM1,"?PAT Mode?",false}, - {0x0021,0x0051,"SIEMENS MR SDS 01",VR::US,VM::VM1,"??",false}, - {0x0021,0x0053,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"??",false}, {0x0021,0x0058,"SIEMENS MR SDI 02",VR::SH,VM::VM1,"AcquisitionMatrixText",false}, {0x0021,0x0059,"SIEMENS MR SDI 02",VR::IS,VM::VM3,"?ImaRelTablePosition?",false}, {0x0021,0x005a,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"?Sequence Variant 1?",false}, {0x0021,0x005b,"SIEMENS MR SDI 02",VR::FD,VM::VM3,"Image Position (Patient)",false}, - {0x0021,0x005b,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"?Sequence Variant 2?",false}, + {0x0021,0x005b,"SIEMENS MR SDS 01",VR::CS,VM::VM1_n,"?Sequence Variant 2?",false}, {0x0021,0x005c,"SIEMENS MR SDS 01",VR::CS,VM::VM1,"MTR flag. MT => ON",false}, {0x0021,0x005d,"SIEMENS MR SDS 01",VR::SL,VM::VM1,"??",false}, {0x0021,0x005e,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"?FrameIndex?",false}, + {0x0021,0x005e,"SIEMENS MR SDS 01",VR::LO,VM::VM1,"?",false}, + {0x0021,0x005f,"SIEMENS MR SDS 01",VR::SH,VM::VM1,"?FrameIndex?",false}, + {0x0021,0x0060,"SIEMENS MR SDS 01",VR::DT,VM::VM1,"?",false}, + {0x0021,0x0061,"SIEMENS MR SDS 01",VR::SH,VM::VM1,"?",false}, + {0x0021,0x0062,"SIEMENS MR SDS 01",VR::FL,VM::VM1,"?",false}, {0x0021,0x0063,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"?Acquisition Number?",false}, + {0x0021,0x0067,"SIEMENS MR SDI 02",VR::ST,VM::VM1,"?DataRole XML?",false }, + {0x0021,0x0068,"SIEMENS MR SDI 02",VR::OB,VM::VM1,"?MRDiffusionSequence as base64 encoded?",false }, {0x0021,0x0071,"SIEMENS MR SDI 02",VR::UT,VM::VM1,"?may contain PHI?",false}, {0x0021,0x0075,"SIEMENS MR SDI 02",VR::CS,VM::VM1_n,"Image Type",false}, {0x0021,0x0076,"SIEMENS MR SDI 02",VR::LO,VM::VM1_n,"Acquisition Info",false}, {0x0021,0x0077,"SIEMENS MR SDI 02",VR::LO,VM::VM1,"Sequence Name",false}, {0x0021,0x0078,"SIEMENS MR SDI 02",VR::CS,VM::VM1,"Acquisition Type 1",false}, {0x0021,0x0079,"SIEMENS MR SDI 02",VR::CS,VM::VM1,"Acquisition Type 2",false}, + {0x0021,0x0081,"SIEMENS MR SDI 02",VR::LO,VM::VM1,"?",false}, {0x0021,0x0088,"SIEMENS MR SDI 02",VR::DS,VM::VM1,"Slice Location",false}, + {0x0021,0x0089,"SIEMENS MR SDI 02",VR::SH,VM::VM1,"?",false }, {0x0021,0x008a,"SIEMENS MR SDI 02",VR::IS,VM::VM1,"Instance/Frame Number",false}, + {0x0021,0x008b,"SIEMENS MR SDI 02",VR::SH,VM::VM1,"?",false}, + {0x0021,0x008c,"SIEMENS MR SDI 02",VR::FD,VM::VM1,"?",false}, + {0x0021,0x008d,"SIEMENS MR SDI 02",VR::FD,VM::VM1,"?",false}, + {0x0021,0x008e,"SIEMENS MR SDI 02",VR::ST,VM::VM1,"?",false}, {0x0021,0x00fe,"SIEMENS MR SDI 02",VR::SQ,VM::VM1,"??",false}, - {0x0021,0x00fe,"SIEMENS MR SDS 01",VR::SQ,VM::VM1,"??",false}, + {0x0021,0x00fe,"SIEMENS MR SDS 01",VR::SQ,VM::VM1,"Series Data Sequence",false}, {0x0089,0x0054,"SYNGO_IMAGING",VR::OW,VM::VM1,"??",false}, {0x0095,0x00fa,"SIENET",VR::PN,VM::VM1,"?Some kind of Patient Name?",false}, {0x8ff1,0x0010,"SSI Image enhancement Group",VR::LO,VM::VM1,"SSI Image enhancement Group Version",false }, @@ -806,7 +851,7 @@ {0x0019,0x0038,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x0039,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, {0x0019,0x003a,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, - {0x0019,0x003a,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"?",false }, + {0x0019,0x003a,"PMTF INFORMATION DATA^11",VR::FL,VM::VM1,"Repetition Time (/100)",false }, {0x0019,0x003b,"PMTF INFORMATION DATA^10",VR::SL,VM::VM2,"?",false }, {0x0019,0x003c,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x003c,"PMTF INFORMATION DATA^11",VR::FL,VM::VM3,"?",false }, @@ -975,7 +1020,7 @@ {0x0019,0x00a6,"PMTF INFORMATION DATA^11",VR::US,VM::VM1,"?",false }, {0x0019,0x00a6,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1_n,"?",false }, {0x0019,0x00a7,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, - {0x0019,0x00a8,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, + {0x0019,0x00a8,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?Repetition Time (/100)",false }, {0x0019,0x00a8,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x00a8,"PMTF INFORMATION DATA^12",VR::FL,VM::VM1,"?",false }, {0x0019,0x00a9,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, @@ -1096,7 +1141,7 @@ {0x0019,0x00f1,"PMTF INFORMATION DATA^11",VR::SL,VM::VM3,"Diffusion b-value x Toshiba Orientation",false }, {0x0019,0x00f1,"PMTF INFORMATION DATA^12",VR::LO,VM::VM1,"?",false }, {0x0019,0x00f2,"PMTF INFORMATION DATA^10",VR::FL,VM::VM1,"?",false }, - {0x0019,0x00f2,"PMTF INFORMATION DATA^11",VR::FL,VM::VM3,"?",false }, + {0x0019,0x00f2,"PMTF INFORMATION DATA^11",VR::FL,VM::VM3,"Specific Absorption Rate Values",false }, {0x0019,0x00f3,"PMTF INFORMATION DATA^10",VR::SL,VM::VM1,"?",false }, {0x0019,0x00f3,"PMTF INFORMATION DATA^11",VR::SL,VM::VM1,"?",false }, {0x0019,0x00f4,"PMTF INFORMATION DATA^10",VR::FD,VM::VM1,"?",false }, @@ -1588,6 +1633,9 @@ {0x0023,0x0008,"AMICAS0",VR::US,VM::VM1,"?",false }, {0x0023,0x0010,"AMICAS0",VR::US,VM::VM1,"?",false }, {0x0023,0x0016,"AMICAS0",VR::SL,VM::VM1,"?",false }, + {0x0023,0x0021,"AMICAS0",VR::US,VM::VM1,"?",false }, + {0x0023,0x0022,"AMICAS0",VR::UL,VM::VM1,"?",false }, + {0x0023,0x0040,"AMICAS0",VR::US,VM::VM1,"?",false }, {0x0023,0x0043,"AMICAS0",VR::US,VM::VM1,"?",false }, {0x0023,0x0045,"AMICAS0",VR::US,VM::VM1,"?",false }, {0x0023,0x0054,"AMICAS0",VR::ST,VM::VM1,"?Performed Station AE Title?",false }, @@ -2044,6 +2092,13 @@ {0x4453,0x0005,"DR Systems, Inc.",VR::LO,VM::VM1,"DR File Suffix",false }, {0x4453,0x000a,"DR Systems, Inc.",VR::UN,VM::VM1,"DR Annotation Type",false }, {0x4453,0x000c,"DR Systems, Inc.",VR::SQ,VM::VM1,"DR Original Instance UID Sequence",false }, + {0x4453,0x000d,"DR Systems, Inc.",VR::PN,VM::VM1,"?",false }, + {0x4453,0x000e,"DR Systems, Inc.",VR::DA,VM::VM1,"?",false }, + {0x4453,0x000f,"DR Systems, Inc.",VR::CS,VM::VM1,"?",false }, + {0x4453,0x0010,"DR Systems, Inc.",VR::LO,VM::VM1,"?",false }, + {0x4453,0x0011,"DR Systems, Inc.",VR::DA,VM::VM1,"?",false }, + {0x4453,0x0012,"DR Systems, Inc.",VR::TM,VM::VM1,"?",false }, + {0x4453,0x0013,"DR Systems, Inc.",VR::LO,VM::VM1,"?",false }, {0x7fa1,0x0000,"ELGEMS_XPERT",VR::OB,VM::VM1,"XPert Composite Report Item buffer",false }, {0x7fa1,0x0010,"ELGEMS_XPERT",VR::OB,VM::VM1,"Xpert Composite Report Item Identificator",false }, {0x0003,0x0001,"ELSCINT1",VR::OW,VM::VM1,"Offset List Structure",false }, @@ -2080,6 +2135,7 @@ {0x00e1,0x0042,"ELSCINT1",VR::LO,VM::VM1,"?",false }, {0x00e1,0x0043,"ELSCINT1",VR::IS,VM::VM1,"?",false }, {0x00e1,0x0045,"ELSCINT1",VR::SL,VM::VM1,"?",false }, + {0x00e1,0x0046,"ELSCINT1",VR::OB,VM::VM1,"?",false }, {0x00e1,0x0050,"ELSCINT1",VR::DS,VM::VM1,"Acquisition Duration",false }, {0x00e1,0x0051,"ELSCINT1",VR::SH,VM::VM1,"?",false }, {0x00e1,0x0060,"ELSCINT1",VR::CS,VM::VM1,"?",false }, @@ -2093,6 +2149,9 @@ {0x00e1,0x00a0,"ELSCINT1",VR::LO,VM::VM1,"?",false }, {0x00e1,0x00c2,"ELSCINT1",VR::UI,VM::VM1,"PET-CT Multi Modality Name",false }, {0x00e1,0x00c4,"ELSCINT1",VR::DS,VM::VM1,"Private (00E1,10C4)",false }, + {0x00e1,0x00e1,"ELSCINT1",VR::US,VM::VM1,"?",false }, + {0x00e1,0x00e3,"ELSCINT1",VR::US,VM::VM1,"?",false }, + {0x00e1,0x00ec,"ELSCINT1",VR::US,VM::VM1,"?",false }, {0x00e3,0x0000,"ELSCINT1",VR::OB,VM::VM1,"?",false }, {0x00e3,0x0018,"ELSCINT1",VR::OB,VM::VM1,"?",false }, {0x00e3,0x001a,"ELSCINT1",VR::OB,VM::VM1,"?",false }, @@ -2104,6 +2163,7 @@ {0x01e1,0x0023,"ELSCINT1",VR::SH,VM::VM1,"?",false }, {0x01e1,0x0026,"ELSCINT1",VR::CS,VM::VM1,"PhantomType (private)",false }, {0x01e1,0x0034,"ELSCINT1",VR::IS,VM::VM1,"?",false }, + {0x01e1,0x0040,"ELSCINT1",VR::UI,VM::VM1,"?",false }, {0x01e1,0x0041,"ELSCINT1",VR::OW,VM::VM1,"?",false }, {0x01f1,0x0001,"ELSCINT1",VR::CS,VM::VM1,"Acquisition Type",false }, {0x01f1,0x0002,"ELSCINT1",VR::CS,VM::VM1,"Focal Spot Resolution",false }, @@ -2118,6 +2178,7 @@ {0x01f1,0x000c,"ELSCINT1",VR::DS,VM::VM2,"Scanner Relative Center",false }, {0x01f1,0x000d,"ELSCINT1",VR::DS,VM::VM1,"Rotation Angle",false }, {0x01f1,0x000e,"ELSCINT1",VR::FL,VM::VM1,"Private (01F1,100E)",false }, + {0x01f1,0x000f,"ELSCINT1",VR::CS,VM::VM1,"?",false }, {0x01f1,0x0026,"ELSCINT1",VR::DS,VM::VM1,"Pitch",false }, {0x01f1,0x0027,"ELSCINT1",VR::DS,VM::VM1,"Rotation Time",false }, {0x01f1,0x0028,"ELSCINT1",VR::DS,VM::VM1,"Table Increment",false }, @@ -2194,6 +2255,9 @@ {0x01f7,0x008b,"ELSCINT1",VR::OW,VM::VM1,"?",false }, {0x01f7,0x0091,"ELSCINT1",VR::OW,VM::VM1,"?",false }, {0x01f7,0x0095,"ELSCINT1",VR::OW,VM::VM1,"?",false }, + {0x01f7,0x0097,"ELSCINT1",VR::UN,VM::VM1,"?",false }, + {0x01f7,0x0099,"ELSCINT1",VR::UN,VM::VM1,"?",false }, + {0x01f7,0x009b,"ELSCINT1",VR::IS,VM::VM1,"iDose Level",false }, {0x01f9,0x0001,"ELSCINT1",VR::LO,VM::VM1,"SP Filter (private)",false }, {0x01f9,0x0004,"ELSCINT1",VR::IS,VM::VM1,"Adaptive Filter (private)",false }, {0x01f9,0x0005,"ELSCINT1",VR::IS,VM::VM1,"Recon Increatment (private)",false }, @@ -2313,6 +2377,7 @@ {0x07a1,0x0042,"ELSCINT1",VR::SH,VM::VM1,"?",false }, {0x07a1,0x0043,"ELSCINT1",VR::IS,VM::VM1,"?",false }, {0x07a1,0x0047,"ELSCINT1",VR::CS,VM::VM1,"?orientation?",false }, + {0x07a1,0x004a,"ELSCINT1",VR::SH,VM::VM1,"?name?",false }, {0x07a1,0x0050,"ELSCINT1",VR::US,VM::VM1,"Tamar Site Id",false }, {0x07a1,0x0056,"ELSCINT1",VR::US,VM::VM1,"?",false }, {0x07a1,0x0058,"ELSCINT1",VR::CS,VM::VM1,"?",false }, @@ -2325,7 +2390,13 @@ {0x07a1,0x0088,"ELSCINT1",VR::CS,VM::VM1,"?Y/N?",false }, {0x07a1,0x0098,"ELSCINT1",VR::CS,VM::VM1,"?Y/N?",false }, {0x07a1,0x009f,"ELSCINT1",VR::CS,VM::VM1,"?",false }, + {0x07a1,0x00a7,"ELSCINT1",VR::CS,VM::VM1,"?",false }, + {0x07a1,0x00c0,"ELSCINT1",VR::ST,VM::VM1,"?",false }, + {0x07a1,0x00c1,"ELSCINT1",VR::ST,VM::VM1,"?",false }, {0x07a1,0x00c2,"ELSCINT1",VR::ST,VM::VM1,"?status sent?",false }, + {0x07a1,0x00c8,"ELSCINT1",VR::ST,VM::VM1,"?",false }, + {0x07a1,0x00c9,"ELSCINT1",VR::ST,VM::VM1,"?",false }, + {0x07a1,0x00ca,"ELSCINT1",VR::ST,VM::VM1,"?",false }, {0x07a1,0x00d0,"ELSCINT1",VR::LO,VM::VM1,"?",false }, {0x07a3,0x0001,"ELSCINT1",VR::LO,VM::VM1,"Tamar Exe Software Version",false }, {0x07a3,0x0003,"ELSCINT1",VR::CS,VM::VM1,"Tamar Study Has Sticky Note",false }, @@ -2336,16 +2407,21 @@ {0x07a3,0x0014,"ELSCINT1",VR::ST,VM::VM1,"?num?",false }, {0x07a3,0x0015,"ELSCINT1",VR::ST,VM::VM1,"?hosp. service name?",false }, {0x07a3,0x0017,"ELSCINT1",VR::SH,VM::VM1,"?num?",false }, + {0x07a3,0x0019,"ELSCINT1",VR::ST,VM::VM1,"?",false }, + {0x07a3,0x001a,"ELSCINT1",VR::ST,VM::VM1,"?",false }, {0x07a3,0x001b,"ELSCINT1",VR::ST,VM::VM1,"?num?",false }, {0x07a3,0x001c,"ELSCINT1",VR::ST,VM::VM1,"?patient name?",false }, {0x07a3,0x001d,"ELSCINT1",VR::ST,VM::VM1,"?radiologist name?",false }, {0x07a3,0x001e,"ELSCINT1",VR::ST,VM::VM1,"?num?",false }, {0x07a3,0x001f,"ELSCINT1",VR::ST,VM::VM1,"?",false }, + {0x07a3,0x0020,"ELSCINT1",VR::DA,VM::VM1,"?",false }, {0x07a3,0x0022,"ELSCINT1",VR::ST,VM::VM1,"?",false }, {0x07a3,0x0023,"ELSCINT1",VR::ST,VM::VM1,"?+sign?",false }, {0x07a3,0x0024,"ELSCINT1",VR::ST,VM::VM1,"?",false }, {0x07a3,0x0034,"ELSCINT1",VR::SH,VM::VM1,"Tamar Study Age",false }, + {0x07a3,0x0039,"ELSCINT1",VR::UL,VM::VM1,"?",false }, {0x07a3,0x0043,"ELSCINT1",VR::DS,VM::VM1_n,"?",false }, + {0x07a3,0x004c,"ELSCINT1",VR::ST,VM::VM1,"?",false }, {0x07a3,0x0052,"ELSCINT1",VR::LO,VM::VM1,"?",false }, {0x07a3,0x0055,"ELSCINT1",VR::SH,VM::VM1,"?",false }, {0x07a3,0x005c,"ELSCINT1",VR::ST,VM::VM1,"?",false }, @@ -2355,6 +2431,7 @@ {0x07a3,0x0064,"ELSCINT1",VR::IS,VM::VM1_n,"?",false }, {0x07a3,0x0065,"ELSCINT1",VR::CS,VM::VM1_n,"?yes/no bool?",false }, {0x07a3,0x0066,"ELSCINT1",VR::IS,VM::VM1,"?",false }, + {0x07a3,0x008c,"ELSCINT1",VR::CS,VM::VM1,"?",false }, {0x07a3,0x008f,"ELSCINT1",VR::CS,VM::VM1,"?",false }, {0x07a3,0x0099,"ELSCINT1",VR::CS,VM::VM1,"?yes/no bool?",false }, {0x07a3,0x009c,"ELSCINT1",VR::CS,VM::VM1,"?yes/no bool?",false }, @@ -2374,16 +2451,24 @@ {0x07a3,0x00ca,"ELSCINT1",VR::SQ,VM::VM1,"?network seq10?",false }, {0x07a3,0x00cb,"ELSCINT1",VR::SQ,VM::VM1,"?network seq11?",false }, {0x07a3,0x00cc,"ELSCINT1",VR::LO,VM::VM1,"Tamar Grid Token Version",false }, + {0x07a3,0x00ce,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, {0x07a3,0x00e3,"ELSCINT1",VR::LO,VM::VM1,"?name?",false }, {0x07a3,0x00f2,"ELSCINT1",VR::CS,VM::VM1,"?",false }, {0x07a3,0x00fb,"ELSCINT1",VR::DT,VM::VM1,"?",false }, {0x07a5,0x0000,"ELSCINT1",VR::LO,VM::VM1,"?name?",false }, + {0x07a5,0x0010,"ELSCINT1",VR::UL,VM::VM1,"?",false }, {0x07a5,0x0054,"ELSCINT1",VR::DT,VM::VM1,"?",false }, {0x07a5,0x0056,"ELSCINT1",VR::CS,VM::VM1,"?",false }, + {0x07a5,0x0059,"ELSCINT1",VR::IS,VM::VM1,"?",false }, {0x07a5,0x0063,"ELSCINT1",VR::CS,VM::VM1_n,"?",false }, - {0x07a5,0x0069,"ELSCINT1",VR::LO,VM::VM1,"?",false }, + {0x07a5,0x0069,"ELSCINT1",VR::LO,VM::VM1,"?",false }, // AE sometimes ?? + {0x07a5,0x0072,"ELSCINT1",VR::DT,VM::VM1,"?",false }, {0x07a5,0x00ae,"ELSCINT1",VR::IS,VM::VM1,"?",false }, {0x07a5,0x00c8,"ELSCINT1",VR::CS,VM::VM1,"?",false }, + {0x07a5,0x00dc,"ELSCINT1",VR::UL,VM::VM1,"?",false }, + {0x07a5,0x00dd,"ELSCINT1",VR::FL,VM::VM1,"?",false }, + {0x07a5,0x00de,"ELSCINT1",VR::LO,VM::VM1,"?",false }, + {0x07a5,0x00e8,"ELSCINT1",VR::IS,VM::VM1,"?",false }, {0x5001,0x0070,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, {0x5001,0x0071,"ELSCINT1",VR::SH,VM::VM1,"?",false }, {0x5001,0x0080,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, @@ -2620,6 +2705,8 @@ {0x0053,0x0068,"GEHC_CT_ADVAPP_001",VR::IS,VM::VM1,"Row Number Anotation Flag",false }, {0x0053,0x006a,"GEHC_CT_ADVAPP_001",VR::IS,VM::VM1,"ODMFlag",false }, {0x0053,0x006b,"GEHC_CT_ADVAPP_001",VR::IS,VM::VM1,"ODMReductionPercent",false }, + {0x0053,0x006c,"GEHC_CT_ADVAPP_001",VR::DS,VM::VM1,"?",false }, + {0x0053,0x006d,"GEHC_CT_ADVAPP_001",VR::DS,VM::VM1,"?",false }, {0x0053,0x006f,"GEHC_CT_ADVAPP_001",VR::IS,VM::VM1,"ASiR Auto Guidance Dose Reduction Percent",false }, {0x0053,0x009d,"GEHC_CT_ADVAPP_001",VR::LO,VM::VM1,"MARsAnnotation",false }, {0x0009,0x0010,"GEIIS",VR::SQ,VM::VM1,"GE IIS Thumbnail Sequence",false }, @@ -3336,6 +3423,7 @@ {0x0051,0x000a,"GEMS_FUNCTOOL_01",VR::SL,VM::VM1,"Store level of Functional Image",false }, {0x0051,0x000b,"GEMS_FUNCTOOL_01",VR::FL,VM::VM1,"Store B-Value with Functional Image",false }, {0x0051,0x000c,"GEMS_FUNCTOOL_01",VR::LO,VM::VM1,"Analysis Package",false }, + {0x0051,0x000e,"GEMS_FUNCTOOL_01",VR::SL,VM::VM1,"?",false }, {0x7fdf,0x0010,"GEMS_GDXE_ATHENAV2_INTERNAL_USE",VR::LT,VM::VM1,"PPS Stream",false }, {0x7fdf,0x0011,"GEMS_GDXE_ATHENAV2_INTERNAL_USE",VR::LT,VM::VM1,"Pixel Data References (temporary)",false }, {0x7fdf,0x0020,"GEMS_GDXE_ATHENAV2_INTERNAL_USE",VR::SS,VM::VM1,"Auto Push Tag",false }, @@ -3413,6 +3501,7 @@ {0x0009,0x0043,"GEMS_GENIE_1",VR::TM,VM::VM1,"Patient Creation Time",false }, {0x0009,0x0044,"GEMS_GENIE_1",VR::SL,VM::VM1,"Num Views Acquired (retired)",false }, {0x0009,0x0045,"GEMS_GENIE_1",VR::LT,VM::VM1,"Dataset UID List",false }, + {0x0009,0x0046,"GEMS_GENIE_1",VR::UI,VM::VM1,"?DataSet UID?",false }, {0x0011,0x000a,"GEMS_GENIE_1",VR::SL,VM::VM1,"Series Type",false }, {0x0011,0x000b,"GEMS_GENIE_1",VR::SL,VM::VM1,"Effective Series Duration",false }, {0x0011,0x000c,"GEMS_GENIE_1",VR::SL,VM::VM1,"Num Beats",false }, @@ -3953,6 +4042,7 @@ {0x0043,0x00a4,"GEMS_PARM_01",VR::LO,VM::VM1,"Detailed text for ASL labeling technique",false }, {0x0043,0x00a5,"GEMS_PARM_01",VR::IS,VM::VM1,"Duration of the label or control pulse",false }, {0x0043,0x00a8,"GEMS_PARM_01",VR::DS,VM::VM3,"Dual Drive Mode, Amplitude Attenuation and Phase Offset ",false }, + {0x0043,0x00a9,"GEMS_PARM_01",VR::LO,VM::VM1,"?",false }, {0x0043,0x00aa,"GEMS_PARM_01",VR::LO,VM::VM1_n,"Additional Filtering Parameters",false }, {0x0043,0x00ab,"GEMS_PARM_01",VR::DS,VM::VM1_n,"Silenz Data",false }, {0x0043,0x00ac,"GEMS_PARM_01",VR::DS,VM::VM1_n,"QMAP Delay Data (RESERVED for FUTURE USE)",false }, @@ -3963,6 +4053,7 @@ {0x0043,0x00b1,"GEMS_PARM_01",VR::SS,VM::VM1,"Excitation Mode",false }, {0x0043,0x00b2,"GEMS_PARM_01",VR::LO,VM::VM1_n,"MR Table Position Information",false }, {0x0043,0x00b3,"GEMS_PARM_01",VR::DS,VM::VM1_n,"Advanced Eddy Correction",false }, + {0x0043,0x00b5,"GEMS_PARM_01",VR::LO,VM::VM1,"?",false }, {0x0043,0x00b6,"GEMS_PARM_01",VR::LO,VM::VM1_n,"Multiband Parameters",false }, {0x0043,0x00b7,"GEMS_PARM_01",VR::LO,VM::VM4,"Compressed Sensing Parameters",false }, {0x0043,0x00b8,"GEMS_PARM_01",VR::DS,VM::VM1_n,"Grad Comp Parameters",false }, @@ -3970,6 +4061,18 @@ {0x0043,0x00ba,"GEMS_PARM_01",VR::DS,VM::VM1,"Echo Spacing",false }, {0x0043,0x00bb,"GEMS_PARM_01",VR::LO,VM::VM1_n,"Pixel Information",false }, {0x0043,0x00bc,"GEMS_PARM_01",VR::IS,VM::VM1,"Heart Beats pattern",false }, + {0x0043,0x00c0,"GEMS_PARM_01",VR::DS,VM::VM1_n,"?",false }, + {0x0043,0x00c1,"GEMS_PARM_01",VR::LO,VM::VM1,"?",false }, + {0x0043,0x00c2,"GEMS_PARM_01",VR::LO,VM::VM1,"?",false }, + {0x0043,0x00c3,"GEMS_PARM_01",VR::LO,VM::VM1,"?some kind of xml?",false }, + {0x0043,0x00c4,"GEMS_PARM_01",VR::LO,VM::VM1,"?some kind of xml?",false }, + {0x0043,0x00c5,"GEMS_PARM_01",VR::LO,VM::VM1,"?",false }, + {0x0043,0x00c6,"GEMS_PARM_01",VR::DS,VM::VM1_n,"?",false }, + {0x0043,0x00c7,"GEMS_PARM_01",VR::DS,VM::VM1_n,"?",false }, + {0x0043,0x00c8,"GEMS_PARM_01",VR::UL,VM::VM1,"?",false }, + {0x0043,0x00c9,"GEMS_PARM_01",VR::IS,VM::VM1,"?",false }, + {0x0043,0x00cc,"GEMS_PARM_01",VR::DS,VM::VM1,"?",false }, + {0x0043,0x00cd,"GEMS_PARM_01",VR::FL,VM::VM1,"?",false }, {0x0051,0x000a,"GEMS_PARM_01",VR::SL,VM::VM1,"Store level of Functional Image",false }, {0x0051,0x000b,"GEMS_PARM_01",VR::FL,VM::VM1,"Store B-Value with Functional Image",false }, {0x2001,0x0010,"GEMS_PARM_01",VR::UI,VM::VM1,"DICOM Implementation UID",false }, @@ -4004,6 +4107,7 @@ {0x2001,0x00b0,"GEMS_PARM_01",VR::OB,VM::VM1,"DTI Parameters",false }, {0x2001,0x00c0,"GEMS_PARM_01",VR::OB,VM::VM1,"Paradigm Info",false }, {0x0011,0x0010,"GEMS_PATI_01",VR::SS,VM::VM1,"Patient Status",false }, + {0x0011,0x0030,"GEMS_PATI_01",VR::DS,VM::VM1,"?",false }, {0x0009,0x0001,"GEMS_PETD_01",VR::LO,VM::VM2,"GE Discovery PET Implementation Version Name",false }, {0x0009,0x0002,"GEMS_PETD_01",VR::LO,VM::VM1,"PET patient_id",false }, {0x0009,0x0003,"GEMS_PETD_01",VR::SH,VM::VM1,"PET compatible_version",false }, @@ -4130,7 +4234,7 @@ {0x0009,0x007c,"GEMS_PETD_01",VR::SL,VM::VM1,"PET is_source",false }, {0x0009,0x007d,"GEMS_PETD_01",VR::SL,VM::VM1,"PET is_contents",false }, {0x0009,0x007e,"GEMS_PETD_01",VR::SL,VM::VM1,"PET is_type",false }, - {0x0009,0x007f,"GEMS_PETD_01",VR::DS,VM::VM3,"PET is_reference",false }, + {0x0009,0x007f,"GEMS_PETD_01",VR::DS,VM::VM1_n,"PET is_reference",false }, {0x0009,0x0080,"GEMS_PETD_01",VR::SL,VM::VM1,"PET multi_patient",false }, {0x0009,0x0081,"GEMS_PETD_01",VR::SL,VM::VM1,"PET number_of_normals",false }, {0x0009,0x0082,"GEMS_PETD_01",VR::UI,VM::VM1,"PET color_map_id",false }, @@ -4178,6 +4282,7 @@ {0x0009,0x00ac,"GEMS_PETD_01",VR::FL,VM::VM1,"PET bp_center_y",false }, {0x0009,0x00ad,"GEMS_PETD_01",VR::UI,VM::VM1,"PET trans_frame_id",false }, {0x0009,0x00ae,"GEMS_PETD_01",VR::UI,VM::VM1,"PET tpluse_frame_id",false }, + {0x0009,0x00b0,"GEMS_PETD_01",VR::US,VM::VM1,"?",false }, {0x0009,0x00b1,"GEMS_PETD_01",VR::FL,VM::VM1,"PET profile_spacing",false }, {0x0009,0x00b2,"GEMS_PETD_01",VR::SS,VM::VM1,"PET ir_num_iterations",false }, {0x0009,0x00b3,"GEMS_PETD_01",VR::SS,VM::VM1,"PET ir_num_subsets",false }, @@ -4248,6 +4353,9 @@ {0x0009,0x00f5,"GEMS_PETD_01",VR::DA,VM::VM1,"Date of Last Treatment",false }, {0x0009,0x00f8,"GEMS_PETD_01",VR::FL,VM::VM1,"Regularized Recon Beta",false }, {0x0009,0x00f9,"GEMS_PETD_01",VR::FL,VM::VM1,"Regularized Recon Gamma",false }, + {0x0009,0x00fa,"GEMS_PETD_01",VR::SL,VM::VM1,"?",false }, + {0x0009,0x00fb,"GEMS_PETD_01",VR::SL,VM::VM1,"?",false }, + {0x0009,0x00fc,"GEMS_PETD_01",VR::SL,VM::VM1,"?",false }, {0x0011,0x0001,"GEMS_PETD_01",VR::SQ,VM::VM1,"GE Advance ROI Sequence",false }, {0x0011,0x0002,"GEMS_PETD_01",VR::UI,VM::VM1,"GE Advance ROI.roi_id",false }, {0x0011,0x0003,"GEMS_PETD_01",VR::UI,VM::VM1,"GE Advance ROI.image_id",false }, @@ -4364,6 +4472,23 @@ {0x0021,0x0002,"GEMS_PETD_01",VR::UL,VM::VM1,"PET raw_data_size",false }, {0x0023,0x0001,"GEMS_PETD_01",VR::OB,VM::VM1,"raw_data_blob",false }, {0x0023,0x0002,"GEMS_PETD_01",VR::OB,VM::VM1,"PET raw_data_blob",false }, + {0x0023,0x0017,"GEMS_PETD_01",VR::SQ,VM::VM1,"?",false }, + {0x0023,0x0019,"GEMS_PETD_01",VR::FL,VM::VM1,"?",false }, + {0x0023,0x001a,"GEMS_PETD_01",VR::FL,VM::VM1,"?",false }, + {0x0023,0x001b,"GEMS_PETD_01",VR::SL,VM::VM1,"?",false }, + {0x0023,0x001c,"GEMS_PETD_01",VR::SQ,VM::VM1,"?",false }, + {0x0023,0x001d,"GEMS_PETD_01",VR::SL,VM::VM1,"?",false }, + {0x0023,0x001e,"GEMS_PETD_01",VR::FL,VM::VM1,"?",false }, + {0x0023,0x002c,"GEMS_PETD_01",VR::UL,VM::VM1,"?",false }, + {0x0023,0x002d,"GEMS_PETD_01",VR::LO,VM::VM1,"?",false }, + {0x0023,0x002e,"GEMS_PETD_01",VR::LO,VM::VM1,"?",false }, + {0x0023,0x0031,"GEMS_PETD_01",VR::CS,VM::VM1,"?",false }, + {0x0023,0x0040,"GEMS_PETD_01",VR::SQ,VM::VM1,"?",false }, + {0x0023,0x0041,"GEMS_PETD_01",VR::LO,VM::VM1,"?",false }, + {0x0023,0x0042,"GEMS_PETD_01",VR::LO,VM::VM1,"?",false }, + {0x0023,0x0058,"GEMS_PETD_01",VR::SQ,VM::VM1,"?",false }, + {0x0023,0x0059,"GEMS_PETD_01",VR::LO,VM::VM1,"?",false }, + {0x0023,0x005a,"GEMS_PETD_01",VR::LO,VM::VM1,"?",false }, {0x5001,0x0001,"GEMS_PETD_01",VR::UI,VM::VM1,"GE Advance Curve.curve_id",false }, {0x5001,0x0002,"GEMS_PETD_01",VR::SH,VM::VM1,"GE Advance Curve.compatible_version",false }, {0x5001,0x0003,"GEMS_PETD_01",VR::SH,VM::VM1,"GE Advance Curve.software_version",false }, @@ -4992,6 +5117,9 @@ {0x3f01,0x0010,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"ImsPostFix to AccessionNumber",false }, {0x3f01,0x0011,"INTELERAD MEDICAL SYSTEMS",VR::US,VM::VM1,"Count of tags present when CTN wrote the file",false }, {0x3f01,0x0012,"INTELERAD MEDICAL SYSTEMS",VR::UL,VM::VM1,"Association Epoch In Seconds",false }, + {0x3f01,0x0013,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false }, + {0x3f01,0x0014,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false }, + {0x3f01,0x001d,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"?",false }, {0x3f03,0x0001,"INTELERAD MEDICAL SYSTEMS",VR::SQ,VM::VM1,"Attribute History",false }, {0x3f03,0x0002,"INTELERAD MEDICAL SYSTEMS",VR::DT,VM::VM1,"Change Timestamp",false }, {0x3f03,0x0003,"INTELERAD MEDICAL SYSTEMS",VR::LO,VM::VM1,"Change initiator",false }, @@ -5140,7 +5268,7 @@ {0x0003,0x0022,"MEDIS_IS&C 1.0",VR::UL,VM::VM1,"?",false }, {0x0003,0x0030,"MEDIS_IS&C 1.0",VR::US,VM::VM1,"?",false }, {0x0009,0x0000,"MERGE TECHNOLOGIES, INC.",VR::OB,VM::VM1,"?",false }, - {0x0031,0x0020,"MITRA LINKED ATTRIBUTES 1.0",VR::IS,VM::VM1,"?",false }, + {0x0031,0x0020,"MITRA LINKED ATTRIBUTES 1.0",VR::LO,VM::VM1,"Global Patient ID",false }, /* {0x0029,0x0000,"MITRA MARKUP 1.0",VR::LO,VM::VM1_n,"?",false }, {0x0029,0x0001,"MITRA MARKUP 1.0",VR::LO,VM::VM1_n,"?",false },*/ {0x0033,0x0002,"MITRA OBJECT ATTRIBUTES 1.0",VR::LO,VM::VM1,"?",false }, @@ -5149,24 +5277,35 @@ {0x0033,0x0008,"MITRA OBJECT ATTRIBUTES 1.0",VR::LO,VM::VM1,"?",false }, {0x0033,0x000a,"MITRA OBJECT ATTRIBUTES 1.0",VR::LO,VM::VM1,"?",false }, // {0x0029,0x0000,"MITRA OBJECT DOCUMENT 1.0",VR::OB,VM::VM1,"?",false }, - {0x0033,0x0002,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::OB,VM::VM1,"Patient Name (UTF8 Encoded)",false }, - {0x0033,0x0004,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::CS,VM::VM1,"Study Description (UTF8 Encoded)",false }, - {0x0033,0x0006,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician Name (UTF8 Encoded)",false }, - {0x0033,0x0008,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::OB,VM::VM1,"Requesting Physician Name (UTF8 Encoded)",false }, - {0x0033,0x000a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician Name (UTF8 Encoded)",false }, - {0x0033,0x000c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::LO,VM::VM1,"Reason for Study (UTF8 Encoded)",false }, - {0x0033,0x000e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::LT,VM::VM1,"Study Comments (UTF8 Encoded)",false }, - {0x0033,0x0013,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name",false }, - {0x0033,0x0014,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::OB,VM::VM1,"?",false }, - {0x0033,0x0015,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::OB,VM::VM1,"?",false }, - {0x0033,0x0016,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::CS,VM::VM1,"?",false }, - {0x0033,0x0019,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::CS,VM::VM1,"?",false }, - {0x0033,0x001c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name",false }, -/* {0x0029,0x0000,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"?",false }, - {0x0029,0x0001,"MITRA PRESENTATION 1.0",VR::UN,VM::VM1,"?",false }, - {0x0029,0x0002,"MITRA PRESENTATION 1.0",VR::UN,VM::VM1,"?",false }, - {0x0029,0x0003,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"?",false },*/ -/* {0x0029,0x0010,"MITRA PRESENTATION 1.0",VR::US,VM::VM1,"?",false },*/ + {0x0033,0x0002,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name",false }, + {0x0033,0x0004,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::CS,VM::VM1,"Study Description",false }, + {0x0033,0x0006,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name",false }, + {0x0033,0x0008,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name",false }, + {0x0033,0x000a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name",false }, + {0x0033,0x000c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::LO,VM::VM1,"Reason for Study",false }, + {0x0033,0x000e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::LT,VM::VM1,"Study Comments",false }, + {0x0033,0x0013,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name Single Byte",false }, + {0x0033,0x0014,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name Ideographic",false }, + {0x0033,0x0015,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Patient's Name Phonetic",false }, + {0x0033,0x0016,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name Single Byte",false }, + {0x0033,0x0017,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name Ideographic",false }, + {0x0033,0x0018,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Referring Physician's Name Phonetic",false }, + {0x0033,0x0019,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name Single Byte",false }, + {0x0033,0x001a,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name Ideographic",false }, + {0x0033,0x001b,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Requesting Physician's Name Phonetic",false }, + {0x0033,0x001c,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name Single Byte",false }, + {0x0033,0x001d,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name Ideographic",false }, + {0x0033,0x001e,"MITRA OBJECT UTF8 ATTRIBUTES 1.0",VR::PN,VM::VM1,"Performing Physician's Name Phonetic",false }, + {0x0029,0x0000,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Mitra Rotation",false }, + {0x0029,0x0001,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"Mitra Window Width",false }, + {0x0029,0x0002,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"Mitra Window Centre",false }, + {0x0029,0x0003,"MITRA PRESENTATION 1.0",VR::IS,VM::VM1,"Mitra Invert",false }, + {0x0029,0x0004,"MITRA PRESENTATION 1.0",VR::IS,VM::VM1,"Mitra Has Tabstop",false }, + {0x0029,0x0005,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Smooth Rotation",false }, + {0x0029,0x0010,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Breast Box x0",false }, + {0x0029,0x0011,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Breast Box y0",false }, + {0x0029,0x0012,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Breast Box x1",false }, + {0x0029,0x0013,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Breast Box y1",false }, {0x0009,0x0048,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0009,0x004e,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0009,0x004f,"MMCPrivate",VR::LO,VM::VM1,"?",false }, @@ -5213,6 +5352,7 @@ {0x0029,0x0017,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0018,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x001c,"MMCPrivate",VR::LO,VM::VM1,"?",false }, + {0x0029,0x001e,"MMCPrivate",VR::LO,VM::VM1,"?",false }, {0x0029,0x0020,"MMCPrivate",VR::IS,VM::VM1,"?",false }, {0x0029,0x0021,"MMCPrivate",VR::DS,VM::VM1,"?",false }, {0x0029,0x0022,"MMCPrivate",VR::ST,VM::VM1,"?",false }, @@ -5347,16 +5487,6 @@ {0x0029,0x0014,"Mitra Markup 1.0",VR::OB,VM::VM1,"Markup15",false }, {0x0029,0x0000,"Mitra Object Document 1.0",VR::OB,VM::VM1,"IMPAX object document",false }, {0x0029,0x0010,"Mitra Object Document 1.0",VR::OB,VM::VM1,"IMPAX markup XML stored",false }, - {0x0029,0x0000,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Mitra Rotation",false }, - {0x0029,0x0001,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"Mitra Window Width",false }, - {0x0029,0x0002,"MITRA PRESENTATION 1.0",VR::LO,VM::VM1,"Mitra Window Centre",false }, - {0x0029,0x0003,"MITRA PRESENTATION 1.0",VR::IS,VM::VM1,"Mitra Invert",false }, - {0x0029,0x0004,"MITRA PRESENTATION 1.0",VR::IS,VM::VM1,"Mitra Has Tabstop",false }, - {0x0029,0x0005,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"Smooth Rotation",false }, - {0x0029,0x0010,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"??",false }, - {0x0029,0x0011,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"??",false }, - {0x0029,0x0012,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"??",false }, - {0x0029,0x0013,"MITRA PRESENTATION 1.0",VR::CS,VM::VM1,"??",false }, {0x1455,0x0000,"Mortara_Inc",VR::OW,VM::VM1,"ELI Interpretation Vector",false }, {0x1455,0x0001,"Mortara_Inc",VR::UN,VM::VM1,"Custom ID",false }, {0x1455,0x0002,"Mortara_Inc",VR::UT,VM::VM1,"Race",false }, @@ -6066,6 +6196,7 @@ {0x2001,0x00c8,"Philips Imaging DD 001",VR::LO,VM::VM1,"?ExamCardName?",false }, {0x2001,0x00cc,"Philips Imaging DD 001",VR::ST,VM::VM1,"?SeriesDerivationDescription",false }, {0x2001,0x00da,"Philips Imaging DD 001",VR::CS,VM::VM1,"?",false }, + {0x2001,0x00de,"Philips Imaging DD 001",VR::UN,VM::VM1,"?",false }, {0x2001,0x00f1,"Philips Imaging DD 001",VR::FL,VM::VM1_n,"Prospective Motion Correction",false }, {0x2001,0x00f2,"Philips Imaging DD 001",VR::FL,VM::VM1_n,"Retrospective Motion Correction",false }, {0x2001,0x00f3,"Philips Imaging DD 001",VR::CS,VM::VM1,"Unknown Tag & Data",false }, @@ -6625,6 +6756,8 @@ {0x2005,0x004e,"Philips MR Imaging DD 005",VR::CS,VM::VM1,"IsB1Series", false }, {0x2005,0x004f,"Philips MR Imaging DD 005",VR::CS,VM::VM1,"VolumeSelect", false }, {0x2005,0x0050,"Philips MR Imaging DD 005",VR::SS,VM::VM1,"MRNrOfPatientOtherIDs", false }, + {0x2005,0x0051,"Philips MR Imaging DD 005",VR::IS,VM::VM1,"?", false }, + {0x2005,0x0052,"Philips MR Imaging DD 005",VR::UI,VM::VM1,"?", false }, {0x2005,0x0055,"Philips MR Imaging DD 005",VR::FD,VM::VM3,"ImageVelocityEncodingDirection", false }, {0x2005,0x0092,"Philips MR Imaging DD 005",VR::FL,VM::VM1,"Specific Energy Dose",false }, {0x2005,0x0053,"Philips MR Imaging DD 006",VR::FL,VM::VM1,"MRE Frequency",false }, @@ -6657,6 +6790,14 @@ {0x2005,0x0085,"Philips MR Imaging DD 006",VR::DS,VM::VM1,"PIIM_GRADIENT_SLEW_RATE",false }, {0x2005,0x0086,"Philips MR Imaging DD 006",VR::LT,VM::VM1,"?",false }, {0x2005,0x0087,"Philips MR Imaging DD 006",VR::DS,VM::VM1,"PIIM_MR_STUDY_B1RMS",false }, + {0x2005,0x0095,"Philips MR Imaging DD 006",VR::CS,VM::VM1,"?",false }, + {0x2005,0x0096,"Philips MR Imaging DD 006",VR::IS,VM::VM1,"?",false }, + {0x2005,0x0097,"Philips MR Imaging DD 006",VR::CS,VM::VM1,"?",false }, + {0x2005,0x0099,"Philips MR Imaging DD 006",VR::SL,VM::VM1,"?",false }, + {0x2005,0x0000,"Philips MR Imaging DD 007",VR::CS,VM::VM1,"?",false }, + {0x2005,0x0001,"Philips MR Imaging DD 007",VR::FL,VM::VM1,"?",false }, + {0x2005,0x0002,"Philips MR Imaging DD 007",VR::FL,VM::VM1,"?",false }, + {0x2005,0x0003,"Philips MR Imaging DD 007",VR::FL,VM::VM1,"?",false }, /* new group */ {0x7043,0x0000,"Philips NM Private Group",VR::SH,VM::VM1,"?",false }, {0x0511,0x0000,"Philips PET Private Group",VR::US,VM::VM1,"?",false }, @@ -6675,6 +6816,10 @@ {0x7053,0x0007,"Philips PET Private Group",VR::SQ,VM::VM1,"Acquisition File Sequence",false }, {0x7053,0x0008,"Philips PET Private Group",VR::SQ,VM::VM1,"?",false }, {0x7053,0x0009,"Philips PET Private Group",VR::DS,VM::VM1,"Activity Concentration Scale Factor",false }, + {0x7053,0x000b,"Philips PET Private Group",VR::DS,VM::VM1,"?",false }, + {0x7053,0x000c,"Philips PET Private Group",VR::DS,VM::VM1,"?",false }, + {0x7053,0x000d,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x000e,"Philips PET Private Group",VR::DS,VM::VM1,"?",false }, {0x7053,0x000f,"Philips PET Private Group",VR::UL,VM::VM1,"Segment Size",false }, {0x7053,0x0010,"Philips PET Private Group",VR::US,VM::VM1,"Segment Number",false }, {0x7053,0x0011,"Philips PET Private Group",VR::US,VM::VM1,"Number of Segments",false }, @@ -6685,7 +6830,57 @@ {0x7053,0x0016,"Philips PET Private Group",VR::SS,VM::VM1,"Private",false }, {0x7053,0x0017,"Philips PET Private Group",VR::SS,VM::VM1,"Private",false }, {0x7053,0x0018,"Philips PET Private Group",VR::SS,VM::VM1,"Private",false }, + {0x7053,0x0050,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0051,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0052,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0053,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0054,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0055,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0056,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0057,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0058,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0059,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x005a,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x005b,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x005c,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x005d,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x005e,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x005f,"Philips PET Private Group",VR::LO,VM::VM1,"?",false }, + {0x7053,0x0060,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0061,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0062,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0063,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0064,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0065,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0066,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0067,"Philips PET Private Group",VR::LO,VM::VM1,"?",false }, + {0x7053,0x0068,"Philips PET Private Group",VR::LO,VM::VM1,"?",false }, + {0x7053,0x0069,"Philips PET Private Group",VR::LO,VM::VM1,"?",false }, + {0x7053,0x006a,"Philips PET Private Group",VR::LT,VM::VM1,"?",false }, + {0x7053,0x006b,"Philips PET Private Group",VR::SH,VM::VM1,"?",false }, + {0x7053,0x006c,"Philips PET Private Group",VR::LO,VM::VM1,"?",false }, + {0x7053,0x006d,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x006e,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x006f,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x0070,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0071,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0072,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x0073,"Philips PET Private Group",VR::SH,VM::VM1,"?",false }, + {0x7053,0x0074,"Philips PET Private Group",VR::SH,VM::VM1,"?",false }, + {0x7053,0x0075,"Philips PET Private Group",VR::SH,VM::VM1,"?",false }, + {0x7053,0x0076,"Philips PET Private Group",VR::SH,VM::VM1,"?",false }, + {0x7053,0x0077,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x0078,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, {0x7053,0x00c2,"Philips PET Private Group",VR::UI,VM::VM1,"PET-CT Multi Modality Name",false }, + {0x7053,0x00d0,"Philips PET Private Group",VR::SS,VM::VM1,"?",false }, + {0x7053,0x00d1,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x00d2,"Philips PET Private Group",VR::DT,VM::VM1,"?",false }, + {0x7053,0x00d3,"Philips PET Private Group",VR::DT,VM::VM1,"?",false }, + {0x7053,0x00d5,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x00d6,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x00d7,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x00d8,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, + {0x7053,0x00d9,"Philips PET Private Group",VR::FL,VM::VM1,"?",false }, {0x200b,0x0000,"Philips RAD Imaging DD 001",VR::PN,VM::VM1,"?",false }, {0x200b,0x0001,"Philips RAD Imaging DD 001",VR::US,VM::VM1,"?",false }, {0x200b,0x0002,"Philips RAD Imaging DD 001",VR::US,VM::VM1,"?",false }, @@ -6753,9 +6948,11 @@ {0x0031,0x0031,"Philips US Imaging 60",VR::UL,VM::VM1,"Private data",false }, {0x0031,0x0032,"Philips US Imaging 60",VR::UL,VM::VM1,"Private data",false }, {0x200d,0x0005,"Philips US Imaging DD 017",VR::LO,VM::VM1,"?",false }, + {0x200d,0x0007,"Philips US Imaging DD 021",VR::LO,VM::VM1,"?CUSTOM_SELECTION_13?",false }, {0x200d,0x0037,"Philips US Imaging DD 023",VR::DA,VM::VM1,"?",false }, {0x200d,0x0038,"Philips US Imaging DD 023",VR::TM,VM::VM1,"?",false }, {0x200d,0x0045,"Philips US Imaging DD 023",VR::IS,VM::VM1,"?",false }, + {0x200d,0x0059,"Philips US Imaging DD 023",VR::IS,VM::VM1,"?",false }, {0x200d,0x0000,"Philips US Imaging DD 033",VR::OB,VM::VM1,"Philips Confidential v.1",false }, {0x200d,0x0001,"Philips US Imaging DD 033",VR::LO,VM::VM1,"?",false }, {0x200d,0x0002,"Philips US Imaging DD 033",VR::LO,VM::VM1,"?",false }, @@ -6774,6 +6971,7 @@ {0x200d,0x0011,"Philips US Imaging DD 033",VR::IS,VM::VM1,"Max Alloc Buffer (Zlib)",false }, {0x200d,0x0014,"Philips US Imaging DD 033",VR::IS,VM::VM1,"?",false }, {0x200d,0x0021,"Philips US Imaging DD 033",VR::IS,VM::VM1,"?Zero?",false }, + {0x200d,0x0022,"Philips US Imaging DD 033",VR::IS,VM::VM1,"?Zero?",false }, {0x200d,0x0001,"Philips US Imaging DD 034",VR::LO,VM::VM1,"?",false }, {0x200d,0x0002,"Philips US Imaging DD 034",VR::LO,VM::VM1,"?",false }, {0x200d,0x0003,"Philips US Imaging DD 034",VR::LO,VM::VM1,"?",false }, @@ -6859,6 +7057,7 @@ {0x200d,0x0076,"Philips US Imaging DD 042",VR::LO,VM::VM1,"?",false }, {0x200d,0x0077,"Philips US Imaging DD 042",VR::LO,VM::VM1,"?",false }, {0x200d,0x0005,"Philips US Imaging DD 043",VR::SH,VM::VM1,"?",false }, + {0x200d,0x0006,"Philips US Imaging DD 043",VR::IS,VM::VM1,"?",false }, {0x200d,0x00f1,"Philips US Imaging DD 045",VR::SQ,VM::VM1,"Private DataType Image Sequence",false }, {0x200d,0x00f3,"Philips US Imaging DD 045",VR::OB,VM::VM1,"image buffer (Zlib/none compressed)",false }, {0x200d,0x00f8,"Philips US Imaging DD 045",VR::SQ,VM::VM1,"Private DataType Image Groups Sequence",false }, @@ -7177,6 +7376,7 @@ {0x0029,0x0002,"SECTRA_ImageInfo_01",VR::CS,VM::VM1,"Marking",false }, {0x0029,0x0003,"SECTRA_ImageInfo_01",VR::LO,VM::VM1,"No Decompression",false }, {0x0029,0x0004,"SECTRA_ImageInfo_01",VR::OB,VM::VM1,"Image Info new",false }, + {0x0029,0x0005,"SECTRA_ImageInfo_01",VR::SS,VM::VM1,"?",false }, {0x6001,0x0001,"SECTRA_OverlayInfo_01",VR::LO,VM::VM1,"Sectra Overlay",false }, {0x0031,0x0098,"SEGAMI MIML",VR::OW,VM::VM1,"?",false }, {0x0035,0x0097,"SEGAMI__MEMO",VR::SH,VM::VM1,"?",false }, @@ -7348,6 +7548,7 @@ {0x0019,0x00ae,"SIEMENS CT VA0 COAD",VR::IS,VM::VM1,"Number of Readings per Rotation",false }, {0x0019,0x00af,"SIEMENS CT VA0 COAD",VR::DS,VM::VM1,"Correction Table Reference Time",false }, {0x0019,0x00b0,"SIEMENS CT VA0 COAD",VR::DS,VM::VM1,"Feed per Rotation",false }, + {0x0019,0x00b1,"SIEMENS CT VA0 COAD",VR::SH,VM::VM1,"Admin Data Version",true}, {0x0019,0x00bd,"SIEMENS CT VA0 COAD",VR::IS,VM::VM1,"Pulmo Trigger Level",false }, {0x0019,0x00be,"SIEMENS CT VA0 COAD",VR::DS,VM::VM1,"Expiratoric Reserve",false }, {0x0019,0x00bf,"SIEMENS CT VA0 COAD",VR::DS,VM::VM1,"Vital Capacity",false }, @@ -8743,6 +8944,7 @@ {0x0019,0x0017,"SIEMENS MR HEADER",VR::DS,VM::VM1,"SliceResolution",false }, {0x0019,0x0018,"SIEMENS MR HEADER",VR::IS,VM::VM1,"RealDwellTime",false }, {0x0019,0x0023,"SIEMENS MR HEADER",VR::IS,VM::VM1,"FMRIStimulInfo",false }, + {0x0019,0x0024,"SIEMENS MR HEADER",VR::FD,VM::VM2,"?",false }, {0x0019,0x0025,"SIEMENS MR HEADER",VR::FD,VM::VM3,"RBMoCoTrans",false }, {0x0019,0x0026,"SIEMENS MR HEADER",VR::FD,VM::VM3,"RBMoCoRot",false }, {0x0019,0x0027,"SIEMENS MR HEADER",VR::FD,VM::VM6,"B_matrix",false }, @@ -8750,14 +8952,14 @@ {0x0019,0x0029,"SIEMENS MR HEADER",VR::FD,VM::VM1_n,"MosaicRefAcqTimes",false }, {0x0051,0x0008,"SIEMENS MR HEADER",VR::CS,VM::VM1,"CSA Image Header Type",false }, {0x0051,0x0009,"SIEMENS MR HEADER",VR::LO,VM::VM1,"CSA Image Header Version ??",false }, - {0x0051,0x000a,"SIEMENS MR HEADER",VR::SH,VM::VM1,"TimeOfAcquisition",false }, - {0x0051,0x000b,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Acquisition Matrix",false }, - {0x0051,0x000c,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Field of View",false }, + {0x0051,0x000a,"SIEMENS MR HEADER",VR::LO,VM::VM1,"Meas Duration",false }, + {0x0051,0x000b,"SIEMENS MR HEADER",VR::LO,VM::VM1,"Acquisition Matrix",false }, + {0x0051,0x000c,"SIEMENS MR HEADER",VR::LO,VM::VM1,"Field of View",false }, {0x0051,0x000d,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Slice Position",false }, - {0x0051,0x000e,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Slice Orientation",false }, + {0x0051,0x000e,"SIEMENS MR HEADER",VR::LO,VM::VM1,"Slice Orientation",false }, {0x0051,0x000f,"SIEMENS MR HEADER",VR::LO,VM::VM1,"Coil String",false }, {0x0051,0x0011,"SIEMENS MR HEADER",VR::LO,VM::VM1,"PAT Mode (Ima PAT Mode)",false }, - {0x0051,0x0012,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?Table Position?",false }, + {0x0051,0x0012,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Rel Table Position",false }, {0x0051,0x0013,"SIEMENS MR HEADER",VR::SH,VM::VM1,"Positive PCS Directions",false }, {0x0051,0x0014,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?v150_through?",false }, {0x0051,0x0015,"SIEMENS MR HEADER",VR::SH,VM::VM1,"?Data Filter?",false }, @@ -10561,6 +10763,9 @@ {0x700d,0x0090,"TOSHIBA_MEC_MR3",VR::OF,VM::VM1,"MRS Ref Raw Data",false }, {0x700d,0x0091,"TOSHIBA_MEC_MR3",VR::FL,VM::VM1,"Receiver gain of prescan",false }, {0x0009,0x0000,"TOSHIBA_MEC_OT3",VR::LO,VM::VM1,"HIS/RIS Study ID",false }, + {0x7019,0x0045,"TOSHIBA_MEC_OT3",VR::SQ,VM::VM1,"?",false }, + {0x7019,0x0046,"TOSHIBA_MEC_OT3",VR::DA,VM::VM1,"?",false }, + {0x7019,0x0047,"TOSHIBA_MEC_OT3",VR::TM,VM::VM1,"?",false }, {0x7019,0x0071,"TOSHIBA_MEC_OT3",VR::CS,VM::VM1,"Indicator of creator",false }, {0x7019,0x0072,"TOSHIBA_MEC_OT3",VR::LO,VM::VM1,"ID of quality assurance reviewer",false }, {0x7019,0x0073,"TOSHIBA_MEC_OT3",VR::PN,VM::VM1,"Name of quality assurance reviewer",false }, diff -Nru gdcm-3.0.10/Source/DataDictionary/privatedicts.xml gdcm-3.0.14/Source/DataDictionary/privatedicts.xml --- gdcm-3.0.10/Source/DataDictionary/privatedicts.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataDictionary/privatedicts.xml 2022-06-24 07:37:44.000000000 +0000 @@ -11,6 +11,23 @@ PURPOSE. See the above copyright notice for more information. --> + + + + + + + + + + + + + + + + + @@ -1730,6 +1747,7 @@ + @@ -1741,12 +1759,15 @@ + + + @@ -1760,6 +1781,7 @@ + @@ -1830,6 +1852,9 @@ + + + @@ -2823,6 +2848,7 @@ + @@ -4282,8 +4308,8 @@ - - + + @@ -4463,31 +4489,46 @@ - + + - + - - - + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -5520,6 +5561,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5537,6 +5616,10 @@ + + + + @@ -5547,7 +5630,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6175,6 +6308,7 @@ + diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmByteValue.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmByteValue.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmByteValue.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmByteValue.h 2022-06-24 07:37:44.000000000 +0000 @@ -41,7 +41,7 @@ { gdcmDebugMacro( "Odd length" ); Internal.resize(vl+1); - Length++; + ++Length; } } diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmCSAHeader.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -1194,7 +1194,7 @@ for(; it != InternalCSADataSet.end(); ++it) { - std::cout << *it << std::endl; + os << *it << std::endl; } } diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmDataElement.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmDataElement.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmDataElement.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmDataElement.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -159,6 +159,28 @@ } return sqi; } + else if ( GetVR() & VR::OB_OW ) // pre-dicom 1993 ? + { + const ByteValue *bv = GetByteValue(); + assert( bv ); + SequenceOfItems *sqi = new SequenceOfItems; + sqi->SetLength( bv->GetLength() ); + std::string s( bv->GetPointer(), bv->GetLength() ); + try + { + std::stringstream ss; + ss.str( s ); + sqi->Read( ss, true ); + } + catch ( Exception &ex0 ) + { + gdcmErrorMacro( "Could not read SQ as OB. Giving up" ); + gdcmErrorMacro(ex0.what()); (void)ex0; + delete sqi; + return nullptr; + } + return sqi; + } else { assert( GetVR().IsVRFile() ); diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmDataSet.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -25,10 +25,10 @@ std::string DataSet::GetPrivateCreator(const Tag &t) const { - if( t.IsPrivate() && !t.IsPrivateCreator() ) + if( t.IsPrivate() && !t.IsGroupLength() && !t.IsPrivateCreator() && !t.IsIllegal() ) { Tag pc = t.GetPrivateCreator(); - if( pc.GetElement() ) + assert( pc.GetElement() ); { const DataElement r(pc); ConstIterator it = DES.find(r); @@ -41,7 +41,7 @@ if( de.IsEmpty() ) return ""; const ByteValue *bv = de.GetByteValue(); assert( bv ); - std::string owner = std::string(bv->GetPointer(),bv->GetLength()); + std::string owner = std::string(bv->GetPointer(),bv->GetLength()).c_str(); // There should not be any trailing space character... // TODO: tmp.erase(tmp.find_last_not_of(' ') + 1); while( !owner.empty() && owner[owner.size()-1] == ' ' ) @@ -56,9 +56,17 @@ return ""; } +PrivateTag DataSet::GetPrivateTag(const Tag &t) const +{ + const std::string str = this->GetPrivateCreator(t); + PrivateTag pt(t); + pt.SetOwner(str.c_str()); + return pt; +} + Tag DataSet::ComputeDataElement(const PrivateTag & t) const { - gdcmDebugMacro( "Entering ComputeDataElement" ); + //gdcmDebugMacro( "Entering ComputeDataElement" ); //assert( t.IsPrivateCreator() ); // No this is wrong to do the assert: eg. (0x07a1,0x000a,"ELSCINT1") // is valid because we have not yet done the mapping, so 0xa < 0x10 fails but might not later on const Tag start(t.GetGroup(), 0x0010 ); // First possible private creator (0x0 -> 0x9 are reserved...) @@ -87,7 +95,7 @@ } ++it; } - gdcmDebugMacro( "In compute found is:" << found ); + //gdcmDebugMacro( "In compute found is:" << found ); if (!found) return GetDEEnd().GetTag(); // else // ok we found the Private Creator Data Element, let's construct the proper data element diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmDataSet.h 2022-06-24 07:37:44.000000000 +0000 @@ -196,8 +196,12 @@ const DataElement& operator() (uint16_t group, uint16_t element) const { return GetDataElement( Tag(group,element) ); } /// Return the private creator of the private tag 't': + /// or an empty string when not found std::string GetPrivateCreator(const Tag &t) const; + /// Return the private tag of the private tag 't', private creator will be set to empty if not found + PrivateTag GetPrivateTag(const Tag &t) const; + /// Look up if private tag 't' is present in the dataset: bool FindDataElement(const PrivateTag &t) const; /// Return the dataelement @@ -230,19 +234,6 @@ DataSet& operator=(DataSet const &) = default; -/* - template - void ExecuteOperation(TOperation & operation) { - assert( !DES.empty() ); - DataElementSet::iterator it = Begin(); - for( ; it != End(); ++it) - { - DataElement &de = (DataElement&)*it; - operation( de ); - } - } -*/ - template std::istream &ReadNested(std::istream &is); diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmElement.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmElement.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmElement.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmElement.h 2022-06-24 07:37:44.000000000 +0000 @@ -314,7 +314,11 @@ return 0; } -static int roundat(char *buf, unsigned int i, int iexp) { +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif + +static int roundat(char *buf, size_t bufLen, unsigned int i, int iexp) { if (doround(buf, i) != 0) { iexp += 1; switch(iexp) { @@ -334,7 +338,7 @@ strcpy(buf, "100"); break; default: - sprintf(buf, "1e%d", iexp); + snprintf(buf, bufLen, "1e%d", iexp); } return 1; } @@ -353,20 +357,20 @@ size -= 1; *buf++ = '-'; } - sprintf(line, "%1.16e", f); + snprintf(line, sizeof(line), "%1.16e", f); if (line[0] == '-') { f = -f; size -= 1; *buf++ = '-'; - sprintf(line, "%1.16e", f); + snprintf(line, sizeof(line), "%1.16e", f); } *mant = line[0]; i = (int)strcspn(mant, "eE"); mant[i] = '\0'; iexp = (int)strtol(mant + i + 1, nullptr, 10); - lexp = sprintf(exp, "e%d", iexp); + lexp = snprintf(exp, sizeof(exp), "e%d", iexp); if ((iexp >= size) || (iexp < -3)) { - i = roundat(mant, size - 1 -lexp, iexp); + i = roundat(mant, sizeof(line) - 1, size - 1 -lexp, iexp); if(i == 1) { strcpy(buf, mant); return; @@ -379,11 +383,11 @@ strcat(buf, exp); } else if (iexp >= size - 2) { - roundat(mant, iexp + 1, iexp); + roundat(mant, sizeof(line) - 1, iexp + 1, iexp); strcpy(buf, mant); } else if (iexp >= 0) { - i = roundat(mant, size - 1, iexp); + i = roundat(mant, sizeof(line) - 1, size - 1, iexp); if (i == 1) { strcpy(buf, mant); return; @@ -396,7 +400,7 @@ } else { int j; - i = roundat(mant, size + 1 + iexp, iexp); + i = roundat(mant, sizeof(line) - 1, size + 1 + iexp, iexp); if (i == 1) { strcpy(buf, mant); return; @@ -405,15 +409,15 @@ for(j=0; j< -1 - iexp; j++) { buf[j+1] = '0'; } - if ((i == 1) && (iexp != -1)) { - buf[-iexp] = '1'; - buf++; - } strncpy(buf - iexp, mant, size + 1 + iexp); buf[size] = 0; clean(buf); } } +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#undef snprintf +#endif + #endif template<> inline void EncodingImplementation::Write(const double* data, unsigned long length, std::ostream &_os) { diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmExplicitDataElement.txx 2022-06-24 07:37:44.000000000 +0000 @@ -405,20 +405,31 @@ } return os; } - bool vr16bitsimpossible = (VRField & VR::VL16) && (ValueLengthField > (uint32_t)VL::GetVL16Max()); - if( VRField == VR::INVALID || vr16bitsimpossible ) + const bool vr16bitsimpossible = (VRField & VR::VL16) && (ValueLengthField > (uint32_t)VL::GetVL16Max()); + const bool vrOWpixeldata = (VRField == VR::OW) && ValueLengthField.IsUndefined(); + const bool vrUNbutSpecial = (VRField == VR::UN && (TagField.IsPrivateCreator() || TagField.IsGroupLength())); + if( VRField == VR::INVALID || vr16bitsimpossible || vrOWpixeldata || vrUNbutSpecial) { if ( TagField.IsPrivateCreator() ) { gdcmAssertAlwaysMacro( !vr16bitsimpossible ); VR lo = VR::LO; - if( TagField.IsGroupLength() ) - { - lo = VR::UL; - } lo.Write(os); ValueLengthField.Write16(os); } + else if ( TagField.IsGroupLength() ) + { + gdcmAssertAlwaysMacro( !vr16bitsimpossible ); + VR ul = VR::UL; + ul.Write(os); + ValueLengthField.Write16(os); + } + else if ( TagField == Tag(0x7fe0,0x0010) ) + { + const VR ob = VR::OB; + ob.Write(os); + ValueLengthField.Write(os); + } else { const VR un = VR::UN; diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmFileMetaInformation.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -71,9 +71,10 @@ { if( imp ) { - ImplementationClassUID = GetGDCMImplementationClassUID(); - ImplementationClassUID += "."; - ImplementationClassUID += imp; + std::string tmp = GetGDCMImplementationClassUID(); + tmp += "."; + tmp += imp; + if( tmp.size() <= 64 ) { ImplementationClassUID = tmp; } } } diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmFragment.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmFragment.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmFragment.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmFragment.h 2022-06-24 07:37:44.000000000 +0000 @@ -70,7 +70,6 @@ { // BogusItemStartItemEnd.dcm throw Exception( "Problem #1" ); - return is; } if( !ValueLengthField.Read(is) ) { @@ -78,7 +77,6 @@ // JPEG fragment is declared to have 61902, but in fact really is only 61901 // so we end up reading 0xddff,0x00e0, and VL = 0x0 (1 byte) throw Exception( "Problem #2" ); - return is; } #ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION if( TagField != itemStart && TagField != seqDelItem ) @@ -107,7 +105,6 @@ ParseException pe; pe.SetLastElement( *this ); throw pe; - return is; } ValueField = bv; return is; @@ -136,7 +133,6 @@ { gdcmErrorMacro( "Giving up" ); throw "Impossible to backtrack"; - return is; } } else @@ -162,7 +158,6 @@ ParseException pe; pe.SetLastElement( *this ); throw pe; - return is; } ValueField = bv; return is; diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmItem.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmItem.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmItem.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmItem.h 2022-06-24 07:37:44.000000000 +0000 @@ -251,7 +251,7 @@ // Not sure how this happen if( TagField == Tag(0xfffe, 0xe0dd) ) { - gdcmWarningMacro( "SegDelItem found in defined length Sequence" ); + gdcmWarningMacro( "SeqDelItem found in defined length Sequence" ); assert( ValueLengthField == 0 ); assert( NestedDataSet.Size() == 0 ); } diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmMrProtocol.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmMrProtocol.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmMrProtocol.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmMrProtocol.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -16,6 +16,11 @@ #include #include +#if defined(_MSC_VER) && (_MSC_VER < 1900) +#define snprintf _snprintf +#endif + + namespace gdcm { @@ -186,7 +191,7 @@ double v[3]; for( int j = 0; j < 3; ++j ) { - sprintf( buf, templ1, i, dir[j] ); + snprintf( buf, sizeof(buf), templ1, i, dir[j] ); const char * valstr = GetMrProtocolByName(buf); // when not present this means 0.0 double val = 0.0; @@ -202,7 +207,7 @@ double v[3]; for( int j = 0; j < 3; ++j ) { - sprintf( buf, templ2, i, dir[j] ); + snprintf( buf, sizeof(buf), templ2, i, dir[j] ); const char * valstr = GetMrProtocolByName(buf); // when not present this means 0.0 double val = 0.0; diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -162,6 +162,7 @@ uint32_t len; // = *(const uint32_t*)input; memcpy(&len, input, sizeof len); SwapperNoOp::SwapArray(&len,1); + uint32_t offset = 4; //if( verbose ) // std::cout << len << "," << inputlen << std::endl; if( len + 4 + 1 == inputlen ) @@ -177,11 +178,20 @@ else { //std::cerr << "Found the Protocol Data Block but could not read length..." << std::endl; - return 1; + if( len == 0x8088b1f ) + { + offset = 0; + len = inputlen; + } + else + { + gdcmWarningMacro("Unhandled Protocol Data Block magic value: " << len ); + return 1; + } } // Alright we need to check if the binary blob was padded, if padded we need to // discard the trailing \0 to please gzip: - std::string str( input + 4, input + len ); + std::string str( input + offset, input + len ); std::istringstream is( str ); zlib_stream::zip_istream gzis( is ); diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPDBHeader.h 2022-06-24 07:37:44.000000000 +0000 @@ -46,6 +46,8 @@ * * \warning: the API of this class might change. * + * \warning: SEDESC is not always pure ASCII it can contains latin1 + * * \see CSAHeader */ class GDCM_EXPORT PDBHeader diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -24,11 +24,12 @@ { if( !str ) return false; unsigned int group = 0, element = 0; - std::string owner; - owner.resize( strlen(str) ); // str != NULL - if( sscanf(str, "%04x,%04x,%[^\"]", &group , &element, &owner[0] ) != 3 + int nchar = -1; + if( sscanf(str, "%04x,%04x,%n", &group , &element, &nchar ) != 2 + || nchar == -1 || group > std::numeric_limits::max() || element > std::numeric_limits::max() + || group % 2 == 0 /*|| strlen(owner.c_str()) == 0*/ ) // can't use owner.empty() { gdcmDebugMacro( "Problem reading Private Tag: " << str ); @@ -38,8 +39,11 @@ // This is not considered an error to specify element as 1010 for example. // just keep the lower bits of element: SetElement( (uint8_t)element ); - SetOwner( owner.c_str() ); - if( !*GetOwner() ) + const char *owner = str + nchar; + SetOwner( owner ); + const bool hasBackslash = strchr(owner,'\\') != NULL; + const char * creator = GetOwner(); + if( !*creator || hasBackslash ) { gdcmDebugMacro( ": " << str ); return false; diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmPrivateTag.h 2022-06-24 07:37:44.000000000 +0000 @@ -51,6 +51,30 @@ const char *GetOwner() const { return Owner.c_str(); } void SetOwner(const char *owner) { if(owner) Owner = LOComp::Trim(owner); } + PrivateTag &operator=(const PrivateTag &_val) + { + SetElementTag( _val.GetElementTag() ); + Owner = _val.Owner; + return *this; + } + + bool operator==(const Tag &_val) const + { + return GetElementTag() == _val.GetElementTag(); + } + bool operator==(const PrivateTag &_val) const + { + return GetElementTag() == _val.GetElementTag() && Owner == _val.Owner; + } + bool operator!=(const Tag &_val) const + { + return GetElementTag() != _val.GetElementTag(); + } + bool operator!=(const PrivateTag &_val) const + { + return GetElementTag() != _val.GetElementTag() || Owner != _val.Owner; + } + bool operator<(const PrivateTag &_val) const; /// Read PrivateTag from a string. Element number will be truncated diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmReader.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -735,6 +735,8 @@ // scope of this function. bool Reader::CanRead() const { + if( !Stream ) return false; + // fastpath std::istream &is = *Stream; if( is.bad() ) return false; diff -Nru gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfItems.h gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfItems.h --- gdcm-3.0.10/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfItems.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/DataStructureAndEncodingDefinition/gdcmSequenceOfItems.h 2022-06-24 07:37:44.000000000 +0000 @@ -148,7 +148,7 @@ #ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION if( item.GetTag() == seqDelItem ) { - gdcmWarningMacro( "SegDelItem found in defined length Sequence. Skipping" ); + gdcmWarningMacro( "SeqDelItem found in defined length Sequence. Skipping" ); assert( item.GetVL() == 0 ); assert( item.GetNestedDataSet().Size() == 0 ); // we need to pay attention that the length of the Sequence of Items will be wrong diff -Nru gdcm-3.0.10/Source/InformationObjectDefinition/gdcmTableReader.cxx gdcm-3.0.14/Source/InformationObjectDefinition/gdcmTableReader.cxx --- gdcm-3.0.10/Source/InformationObjectDefinition/gdcmTableReader.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/InformationObjectDefinition/gdcmTableReader.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -586,7 +586,7 @@ int ret = 0; do { is.read(buf, sizeof(buf)); - std::streamsize len = is.gcount(); + std::streamsize len = is.gcount(); done = (unsigned int)len < sizeof(buf); if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) { fprintf(stderr, diff -Nru gdcm-3.0.10/Source/InformationObjectDefinition/gdcmXMLDictReader.cxx gdcm-3.0.14/Source/InformationObjectDefinition/gdcmXMLDictReader.cxx --- gdcm-3.0.10/Source/InformationObjectDefinition/gdcmXMLDictReader.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/InformationObjectDefinition/gdcmXMLDictReader.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -61,7 +61,7 @@ assert( v <= 0xFFFF ); char sv[4+1]; - r = sprintf(sv, "%04x", v); + r = snprintf(sv, sizeof(sv), "%04x", v); assert( r == 4 ); if( strncmp(raw, sv, 4) == 0 ) // GroupXX { @@ -84,7 +84,7 @@ assert( v <= 0xFFFF ); char sv[4+1]; - r = sprintf(sv, "%04x", v); + r = snprintf(sv, sizeof(sv), "%04x", v); assert( r == 4 ); if( strncmp(raw, sv, 4) == 0 ) { diff -Nru gdcm-3.0.10/Source/InformationObjectDefinition/gdcmXMLPrivateDictReader.cxx gdcm-3.0.14/Source/InformationObjectDefinition/gdcmXMLPrivateDictReader.cxx --- gdcm-3.0.10/Source/InformationObjectDefinition/gdcmXMLPrivateDictReader.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/InformationObjectDefinition/gdcmXMLPrivateDictReader.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -62,7 +62,7 @@ assert( v <= 0xFFFF ); char sv[4+1]; - r = sprintf(sv, "%04x", v); + r = snprintf(sv, sizeof(sv), "%04x", v); assert( r == 4 ); if( strncmp(raw, sv, 4) == 0 ) // GroupXX { @@ -109,7 +109,7 @@ assert( v <= 0xFF ); char sv[4+1]; - r = sprintf(sv, "xx%02x", v); + r = snprintf(sv, sizeof(sv), "xx%02x", v); assert( r == 4 ); if( strncmp(raw, sv, 4) == 0 ) { diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/CMakeLists.txt gdcm-3.0.14/Source/MediaStorageAndFileFormat/CMakeLists.txt --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -4,6 +4,7 @@ gdcmEmptyMaskGenerator.cxx gdcmEquipmentManufacturer.cxx gdcmFileStreamer.cxx + gdcmCleaner.cxx gdcmJSON.cxx gdcmFileChangeTransferSyntax.cxx gdcmAnonymizer.cxx @@ -16,6 +17,7 @@ gdcmFileDerivation.cxx gdcmImageFragmentSplitter.cxx gdcmTagPath.cxx + gdcmDPath.cxx gdcmSimpleSubjectWatcher.cxx gdcmAnonymizeEvent.cxx gdcmPixmap.cxx @@ -50,7 +52,9 @@ gdcmDictPrinter.cxx gdcmXMLPrinter.cxx gdcmScanner.cxx + gdcmScanner2.cxx gdcmStrictScanner.cxx + gdcmStrictScanner2.cxx gdcmPixmapReader.cxx gdcmImageReader.cxx gdcmPixmapWriter.cxx @@ -103,6 +107,10 @@ ${GDCM_SOURCE_DIR}/Utilities/gdcmrle/io.cxx ) + list(APPEND MSFF_SRCS + ${GDCM_SOURCE_DIR}/Utilities/gdcmcsa/csa.c + ) + # Do the proper thing when building static...if only there was configured # headers or def files instead if(NOT BUILD_SHARED_LIBS) diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmAnonymizer.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -95,6 +95,28 @@ return Replace(t, "", 0); } +bool Anonymizer::Empty( PrivateTag const &pt) +{ + // There is a secret code path to make it work for VR::SQ since operation is just 'make empty' + return Replace(pt, "", 0); +} + +bool Anonymizer::Clear( Tag const &t) +{ + DataSet &ds = F->GetDataSet(); + if(ds.FindDataElement(t)) + this->Empty(t); + return true; +} + +bool Anonymizer::Clear( PrivateTag const &pt) +{ + DataSet &ds = F->GetDataSet(); + if(ds.FindDataElement(pt)) + this->Empty(pt); + return true; +} + bool Anonymizer::Remove( Tag const &t ) { DataSet &ds = F->GetDataSet(); @@ -104,6 +126,18 @@ return true; } +bool Anonymizer::Remove( PrivateTag const &pt ) +{ + DataSet &ds = F->GetDataSet(); + if(ds.FindDataElement(pt)) + { + const DataElement &de = ds.GetDataElement(pt); + return ds.Remove( de.GetTag() ) == 1; + } + else + return true; +} + bool Anonymizer::Replace( Tag const &t, const char *value ) { VL::Type len = 0; //to avoid the size_t warning on 64 bit windows @@ -115,6 +149,17 @@ return Replace( t, value, len ); } +bool Anonymizer::Replace( PrivateTag const &pt, const char *value ) +{ + VL::Type len = 0; //to avoid the size_t warning on 64 bit windows + if( value ) + { + len = (VL::Type)strlen( value );//strlen returns size_t, but it should be VL::Type + //strlen shouldn't be more than 4gb anyway + } + return Replace( pt, value, len ); +} + bool Anonymizer::Replace( Tag const &t, const char *value, VL const & vl ) { if( t.GetGroup() < 0x0008 ) return false; @@ -147,16 +192,20 @@ } } de.SetByteValue( "", vl ); - ds.Insert( de ); + ds.Replace( de ); ret = true; } else { // TODO - assert( 0 && "TODO" ); + gdcmErrorMacro( "Cannot make empty private attribute that does not exist" ); ret = false; } } + else + { + gdcmErrorMacro( "Cannot replace private attribute." ); + } } else { @@ -263,6 +312,71 @@ return ret; } +bool Anonymizer::Replace( PrivateTag const &pt, const char *value, VL const & vl ) +{ + DataSet &ds = F->GetDataSet(); + if(ds.FindDataElement(pt)) + { + const DataElement &de = ds.GetDataElement(pt); + return Replace( de.GetTag(), value, vl ); + } + else + { + Tag start = pt; + start.SetElement( 0x0010 ); + bool needcreator = false; + bool found = false; + Tag maxCreator = pt; + maxCreator.SetElement(0x00ff); + do { + const DataElement& de = ds.FindNextDataElement( start ); + const ByteValue* bv = de.GetByteValue(); + std::string creator_str; + if(bv) { + creator_str = std::string(bv->GetPointer(),bv->GetLength()); + creator_str = LOComp::Trim(creator_str.c_str()); + } + if( maxCreator < de.GetTag() ) { + needcreator = true; + found = true; + } else if ( System::StrCaseCmp(creator_str.c_str(), pt.GetOwner()) == 0 ) { + needcreator = false; + found = true; + } else { + assert( start.GetElement() != 0xff ); + start.SetElement( start.GetElement() + 1 ); + } + } while ( !found ); + assert( start.GetGroup() == pt.GetGroup() ); + if(needcreator) + { + // add private creator: + Element priv_creator; + priv_creator.SetValue( pt.GetOwner() ); + DataElement creator = priv_creator.GetAsDataElement(); + assert( start.GetElement() <= 0xff ); + start.SetElement( start.GetElement() ); + creator.SetTag( start ); + ds.Insert(creator); + } + // add empty element: + static const Global &g = GlobalInstance; + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(pt); + DataElement fake; + Tag privateLocation(pt); + assert( pt.GetElement() <= 0xff ); + privateLocation.SetElement( start.GetElement() << 8 | pt.GetElement() ); + assert( start == privateLocation.GetPrivateCreator() ); + fake.SetTag( privateLocation ); + fake.SetVR( dictentry.GetVR() ); + ds.Insert( fake ); + + assert(ds.FindDataElement(pt)); + return Replace( privateLocation, value, vl ); + } +} + static bool Anonymizer_RemoveRetired(File const &file, DataSet &ds) { static const Global &g = GlobalInstance; @@ -502,8 +616,17 @@ //p7.SetCertificate( this->x509 ); DataSet &ds = F->GetDataSet(); + if( ds.FindDataElement( Tag(0x0012,0x0062) ) ) + { + gdcm::Attribute<0x0012,0x0062> patientIdentityRemoved = {}; + patientIdentityRemoved.SetFromDataSet( ds ); + const std::string value = patientIdentityRemoved.GetValue().Trim(); + if( value != "NO" ) { + gdcmErrorMacro( "EncryptedContentTransferSyntax Attribute Patient is set !" ); + return false; + } + } if( ds.FindDataElement( Tag(0x0400,0x0500) ) - || ds.FindDataElement( Tag(0x0012,0x0062) ) || ds.FindDataElement( Tag(0x0012,0x0063) ) ) { gdcmErrorMacro( "EncryptedContentTransferSyntax Attribute is present !" ); @@ -925,6 +1048,11 @@ static const Global &g = Global::GetInstance(); static const Defs &defs = g.GetDefs(); + if( defs.IsEmpty() ) + { + gdcmWarningMacro( "Missing Definitions, see Global.LoadResourcesFiles()" ); + return; + } const IOD& iod = defs.GetIODFromFile(*F); for(const Tag *ptr = start ; ptr != end ; ++ptr) @@ -952,6 +1080,8 @@ if( sqi ) { de.SetValue( *sqi ); // EXTREMELY IMPORTANT #2912092 + // Legacy behavior has been to create CP-246 / undefined length SQ as VR:UN... + if( de.GetVR() == VR::OB ) de.SetVR( VR::UN ); de.SetVLToUndefined(); assert( sqi->IsUndefinedLength() ); //de.GetVL().SetToUndefined(); diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmAnonymizer.h gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmAnonymizer.h --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmAnonymizer.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmAnonymizer.h 2022-06-24 07:37:44.000000000 +0000 @@ -81,26 +81,37 @@ ~Anonymizer() override; /// Make Tag t empty (if not found tag will be created) - /// Warning: does not handle SQ element bool Empty( Tag const &t ); - //bool Empty( PrivateTag const &t ); - //bool Empty( TagPath const &t ); + + /// Make PrivateTag pt empty (if not found tag will be created) + /// Pay special attention that this code must be done before any call to + /// Empty/Remove of the associated Private Creator, but before any call to + /// Replace. + bool Empty( PrivateTag const &pt ); + + /// Identical to 'Empty' except no action is done when tag is not present + bool Clear( Tag const &t ); + bool Clear( PrivateTag const &pt ); /// remove a tag (even a SQ can be removed) - /// Return code is false when tag t cannot be found bool Remove( Tag const &t ); - //bool Remove( PrivateTag const &t ); - //bool Remove( TagPath const &t ); + + /// remove a private tag (even a SQ can be removed) + /// Pay special attention that this code must be done before any call to + /// Empty/Remove of the associated Private Creator, but before any call to + /// Replace. When the private reservation becomes empty, no check is done to + /// automatically remove the private creator + bool Remove( PrivateTag const &pt ); /// Replace tag with another value, if tag is not found it will be created: /// WARNING: this function can only execute if tag is a VRASCII bool Replace( Tag const &t, const char *value ); + bool Replace( PrivateTag const &t, const char *value ); /// when the value contains \0, it is a good idea to specify the length. This function /// is required when dealing with VRBINARY tag bool Replace( Tag const &t, const char *value, VL const & vl ); - //bool Replace( PrivateTag const &t, const char *value, VL const & vl ); - //bool Replace( TagPath const &t, const char *value, VL const & vl ); + bool Replace( PrivateTag const &t, const char *value, VL const & vl ); /// Main function that loop over all elements and remove private tags bool RemovePrivateTags(); @@ -111,9 +122,6 @@ /// Main function that loop over all elements and remove retired element bool RemoveRetired(); - // TODO: - // bool Remove( PRIVATE_TAGS | GROUP_LENGTH | RETIRED ); - /// Set/Get File void SetFile(const File& f) { F = f; } //const File &GetFile() const { return *F; } diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmBitmap.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -400,6 +400,7 @@ const SequenceOfFragments *sf = PixelData.GetSequenceOfFragments(); if( !sf ) return false; const Fragment &frag = sf->GetFragment(0); + if( frag.IsEmpty() ) return false; const ByteValue &bv2 = dynamic_cast(frag.GetValue()); PixelFormat pf = GetPixelFormat(); // PixelFormat::UINT8; codec.SetPixelFormat( pf ); @@ -434,13 +435,6 @@ i->GetPixelFormat().SetBitsAllocated( cpf.GetBitsAllocated() ); i->GetPixelFormat().SetBitsStored( cpf.GetBitsStored() ); } - else if( cpf.GetBitsStored() < pf.GetBitsStored() ) - { - Bitmap *i = const_cast(this); - gdcmWarningMacro( "Encapsulated stream has more bits actually stored on disk. correcting." ); - i->GetPixelFormat().SetBitsAllocated( cpf.GetBitsAllocated() ); - i->GetPixelFormat().SetBitsStored( cpf.GetBitsStored() ); - } } } } @@ -684,6 +678,7 @@ const SequenceOfFragments *sf = PixelData.GetSequenceOfFragments(); if( !sf ) return false; const Fragment &frag = sf->GetFragment(0); + if( frag.IsEmpty() ) return false; const ByteValue &bv2 = dynamic_cast(frag.GetValue()); std::stringstream ss; @@ -731,7 +726,7 @@ assert( len <= outbv->GetLength() ); // DermaColorLossLess.dcm has a len of 63531, but DICOM will give us: 63532 ... assert( len <= outbv->GetLength() ); - if(buffer) memcpy(buffer, outbv->GetPointer(), len /*outbv->GetLength()*/ ); // FIXME + memcpy(buffer, outbv->GetPointer(), len /*outbv->GetLength()*/ ); // FIXME //assert( codec.IsLossy() == ts.IsLossy() ); lossyflag = codec.IsLossy(); @@ -812,6 +807,7 @@ const SequenceOfFragments *sf = PixelData.GetSequenceOfFragments(); if( !sf ) return false; const Fragment &frag = sf->GetFragment(0); + if( frag.IsEmpty() ) return false; const ByteValue &bv2 = dynamic_cast(frag.GetValue()); bool b = codec.GetHeaderInfo( bv2.GetPointer(), bv2.GetLength() , ts2 ); @@ -846,6 +842,7 @@ } else if( cpf.GetBitsStored() > pf.GetBitsStored() ) { + // Osirix10vs8BitsStored.dcm Bitmap *i = const_cast(this); gdcmWarningMacro( "Encapsulated stream has more bits actually stored on disk. correcting." ); i->GetPixelFormat().SetBitsAllocated( cpf.GetBitsAllocated() ); @@ -886,7 +883,7 @@ unsigned long check = outbv->GetLength(); // FIXME (void)check; assert( len <= outbv->GetLength() ); - if(buffer) memcpy(buffer, outbv->GetPointer(), len /*outbv->GetLength()*/ ); // FIXME + memcpy(buffer, outbv->GetPointer(), len /*outbv->GetLength()*/ ); // FIXME lossyflag = codec.IsLossy(); if( codec.IsLossy() && !ts.IsLossy() ) diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmCleaner.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,1023 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmCleaner.h" +#include "gdcmAnonymizeEvent.h" +#include "gdcmAttribute.h" +#include "gdcmCSAHeader.h" +#include "gdcmDataSetHelper.h" +#include "gdcmDicts.h" +#include "gdcmEvent.h" +#include "gdcmGlobal.h" + +#include "gdcmcsa/csa.h" + +namespace gdcm { + +static const PrivateTag part15_table_E_1_1[] = { + PrivateTag(0x0019, 0x0C, "SIEMENS MR HEADER"), + PrivateTag(0x0019, 0x0D, "SIEMENS MR HEADER"), + PrivateTag(0x0019, 0x0E, "SIEMENS MR HEADER"), + PrivateTag(0x0019, 0x23, "GEMS_ACQU_01"), + PrivateTag(0x0019, 0x24, "GEMS_ACQU_01"), + PrivateTag(0x0019, 0x27, "GEMS_ACQU_01"), + PrivateTag(0x0019, 0x27, "SIEMENS MR HEADER"), + PrivateTag(0x0019, 0x9E, "GEMS_ACQU_01"), + PrivateTag(0x0025, 0x01, "Philips ST80i"), + PrivateTag(0x0025, 0x07, "GEMS_SERS_01"), + PrivateTag(0x0043, 0x27, "GEMS_PARM_01"), + PrivateTag(0x0043, 0x39, "GEMS_PARM_01"), + PrivateTag(0x0043, 0x6F, "GEMS_PARM_01"), + PrivateTag(0x0045, 0x01, "GEMS_HELIOS_01"), + PrivateTag(0x0045, 0x02, "GEMS_HELIOS_01"), + PrivateTag(0x0099, 0x01, "NQHeader"), + PrivateTag(0x0099, 0x02, "NQHeader"), + PrivateTag(0x0099, 0x04, "NQHeader"), + PrivateTag(0x0099, 0x05, "NQHeader"), + PrivateTag(0x0099, 0x10, "NQHeader"), + PrivateTag(0x0099, 0x20, "NQHeader"), + PrivateTag(0x0099, 0x21, "NQHeader"), + PrivateTag(0x00E1, 0x21, "ELSCINT1"), + PrivateTag(0x00E1, 0x50, "ELSCINT1"), + PrivateTag(0x0119, 0x00, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x01, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x02, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x03, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x04, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x05, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x06, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x07, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x08, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x09, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x10, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x11, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x12, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x13, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0119, 0x21, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x00, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x02, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x03, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x04, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x05, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x06, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x07, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x08, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x09, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x10, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x11, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x12, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x20, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x21, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x22, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x29, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0129, 0x30, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0139, 0x01, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0149, 0x01, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0149, 0x02, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0149, 0x03, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x0199, 0x01, "NQLeft"), + PrivateTag(0x0199, 0x02, "NQLeft"), + PrivateTag(0x0199, 0x03, "NQLeft"), + PrivateTag(0x0199, 0x04, "NQLeft"), + PrivateTag(0x0199, 0x05, "NQLeft"), + PrivateTag(0x0199, 0x06, "NQLeft"), + PrivateTag(0x0199, 0x07, "NQLeft"), + PrivateTag(0x0199, 0x08, "NQLeft"), + PrivateTag(0x0199, 0x09, "NQLeft"), + PrivateTag(0x0199, 0x0A, "NQLeft"), + PrivateTag(0x0199, 0x0B, "NQLeft"), + PrivateTag(0x0199, 0x0C, "NQLeft"), + PrivateTag(0x0199, 0x0D, "NQLeft"), + PrivateTag(0x0199, 0x0E, "NQLeft"), + PrivateTag(0x0199, 0x0F, "NQLeft"), + PrivateTag(0x0199, 0x10, "NQLeft"), + PrivateTag(0x0199, 0x11, "NQLeft"), + PrivateTag(0x0199, 0x12, "NQLeft"), + PrivateTag(0x0199, 0x13, "NQLeft"), + PrivateTag(0x0199, 0x14, "NQLeft"), + PrivateTag(0x0199, 0x15, "NQLeft"), + PrivateTag(0x0199, 0x16, "NQLeft"), + PrivateTag(0x01E1, 0x26, "ELSCINT1"), + PrivateTag(0x01F1, 0x01, "ELSCINT1"), + PrivateTag(0x01F1, 0x07, "ELSCINT1"), + PrivateTag(0x01F1, 0x26, "ELSCINT1"), + PrivateTag(0x01F1, 0x27, "ELSCINT1"), + PrivateTag(0x0299, 0x01, "NQRight"), + PrivateTag(0x0299, 0x02, "NQRight"), + PrivateTag(0x0299, 0x03, "NQRight"), + PrivateTag(0x0299, 0x04, "NQRight"), + PrivateTag(0x0299, 0x05, "NQRight"), + PrivateTag(0x0299, 0x06, "NQRight"), + PrivateTag(0x0299, 0x07, "NQRight"), + PrivateTag(0x0299, 0x08, "NQRight"), + PrivateTag(0x0299, 0x09, "NQRight"), + PrivateTag(0x0299, 0x0A, "NQRight"), + PrivateTag(0x0299, 0x0B, "NQRight"), + PrivateTag(0x0299, 0x0C, "NQRight"), + PrivateTag(0x0299, 0x0D, "NQRight"), + PrivateTag(0x0299, 0x0E, "NQRight"), + PrivateTag(0x0299, 0x0F, "NQRight"), + PrivateTag(0x0299, 0x10, "NQRight"), + PrivateTag(0x0299, 0x11, "NQRight"), + PrivateTag(0x0299, 0x12, "NQRight"), + PrivateTag(0x0299, 0x13, "NQRight"), + PrivateTag(0x0299, 0x14, "NQRight"), + PrivateTag(0x0299, 0x15, "NQRight"), + PrivateTag(0x0299, 0x16, "NQRight"), + PrivateTag(0x0903, 0x10, "GEIIS PACS"), + PrivateTag(0x0903, 0x11, "GEIIS PACS"), + PrivateTag(0x0903, 0x12, "GEIIS PACS"), + PrivateTag(0x2001, 0x00, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x01, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x01, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x01, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x01, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x02, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x02, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x02, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x02, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x03, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x03, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x03, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x03, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x04, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x04, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x04, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x04, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x05, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x05, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x05, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x05, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x06, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x06, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x06, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x06, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x07, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x07, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x07, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x07, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x08, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x08, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x08, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x08, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x09, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x09, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x09, "Philips Imaging DD 129"), + PrivateTag(0x2001, 0x0A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x0A, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x0A, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x0B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x0B, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x0B, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x0C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x0C, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x0D, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x0D, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x0E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x0E, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x0E, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x0F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x0F, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x0F, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x10, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x10, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x11, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x11, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x12, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x12, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x12, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x13, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x13, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x14, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x14, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x15, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x15, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x16, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x16, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x17, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x17, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x17, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x18, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x18, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x18, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x19, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x19, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x19, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x1A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x1A, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x1A, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x1B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x1B, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x1B, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x1C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x1C, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x1C, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x1D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x1D, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x1D, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x1E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x1E, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x1E, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x1F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x1F, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x1F, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x20, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x21, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x21, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x21, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x22, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x22, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x22, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x23, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x23, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x23, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x24, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x24, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x24, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x25, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x25, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x25, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x26, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x26, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x26, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x27, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x27, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x27, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x28, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x28, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x28, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x29, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x29, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x2A, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2A, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x2B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x2B, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2B, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x2C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x2C, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2C, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x2D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x2D, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2D, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x2E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x2E, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2E, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x2F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x2F, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x2F, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x30, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x30, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x30, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x31, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x31, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x31, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x32, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x32, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x32, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x33, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x33, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x34, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x34, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x35, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x35, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x36, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x36, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x36, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x37, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x37, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x37, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x38, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x38, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x38, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x39, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x39, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x39, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x3A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x3A, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x3A, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x3B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x3B, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x3B, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x3C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x3C, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x3C, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x3D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x3D, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x3D, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x3E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x3E, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x3E, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x3F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x3F, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x40, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x40, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x40, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x41, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x41, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x42, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x42, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x43, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x44, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x44, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x45, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x45, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x46, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x46, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x47, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x47, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x48, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x49, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x49, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x4A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x4A, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x4B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x4B, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x4C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x4C, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0x4D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x4E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x4F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x50, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x50, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x51, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x52, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x53, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x53, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x54, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x55, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x56, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x57, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x57, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x58, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x58, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x59, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x5A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x5A, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x5C, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x5D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x5D, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x5E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x5E, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x5F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x5F, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x60, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x61, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x62, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x63, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x63, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x64, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x64, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x65, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x65, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x66, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x66, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x67, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x67, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x68, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x68, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x69, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x6A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x6B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x6B, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x6D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x6E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x6F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x71, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x71, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x72, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x72, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x73, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x73, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x74, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x74, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x75, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x75, "Philips Imaging DD 002"), + PrivateTag(0x2001, 0x76, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x77, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x79, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x7A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x7B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x7C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x7D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x7E, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x7F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x80, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x81, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x82, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x83, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x84, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x85, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x86, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x87, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x88, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x89, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x8A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x8B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x8C, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x90, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x91, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x92, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x93, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x94, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x9A, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x9B, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x9D, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0x9F, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xA1, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xA1, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA2, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xA2, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA3, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xA3, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA4, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xA4, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA5, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xA5, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA6, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA8, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xA9, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xAA, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xAB, "Philips Imaging DD 097"), + PrivateTag(0x2001, 0xC0, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xC1, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xC2, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xC3, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xC5, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xC6, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xC7, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xCA, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xCB, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD0, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD1, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD2, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD3, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD4, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD5, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD6, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD7, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD8, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xD9, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xDA, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xDB, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xDC, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xDD, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xDE, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xDF, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xE9, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF1, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF2, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF3, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF4, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF5, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF6, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF7, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xF9, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xFB, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xFC, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xFD, "Philips Imaging DD 001"), + PrivateTag(0x2001, 0xFF, "Philips Imaging DD 001"), + PrivateTag(0x2005, 0x0D, "Philips MR Imaging DD 001"), + PrivateTag(0x2005, 0x0E, "Philips MR Imaging DD 001"), + PrivateTag(0x7053, 0x00, "Philips PET Private Group"), + PrivateTag(0x7053, 0x09, "Philips PET Private Group"), + PrivateTag(0x7E01, 0x01, "HOLOGIC, Inc."), + PrivateTag(0x7E01, 0x02, "HOLOGIC, Inc."), + PrivateTag(0x7E01, 0x10, "HOLOGIC, Inc."), + PrivateTag(0x7E01, 0x11, "HOLOGIC, Inc."), + PrivateTag(0x7E01, 0x12, "HOLOGIC, Inc."), + PrivateTag(0x7FD1, 0x01, "SIEMENS SYNGO ULTRA-SOUND TOYON DATA STREAMING"), + PrivateTag(0x7FD1, 0x01, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x7FD1, 0x09, "SIEMENS SYNGO ULTRA-SOUND TOYON DATA STREAMING"), + PrivateTag(0x7FD1, 0x09, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x7FD1, 0x10, "SIEMENS SYNGO ULTRA-SOUND TOYON DATA STREAMING"), + PrivateTag(0x7FD1, 0x10, "SIEMENS Ultrasound SC2000"), + PrivateTag(0x7FD1, 0x11, "SIEMENS SYNGO ULTRA-SOUND TOYON DATA STREAMING"), + PrivateTag(0x7FD1, 0x11, "SIEMENS Ultrasound SC2000"), +}; + +static inline bool in_part15(const PrivateTag &pt) { + static const size_t len = + sizeof(part15_table_E_1_1) / sizeof *part15_table_E_1_1; + for (size_t i = 0; i < len; ++i) { + if (part15_table_E_1_1[i] == pt) { + return true; + } + } + return false; +} + +typedef std::set DataElementSet; +typedef DataElementSet::const_iterator ConstIterator; + +struct Cleaner::impl { + std::set preserve_dpaths; + std::set empty_dpaths; + std::set remove_dpaths; + std::set scrub_dpaths; + std::set empty_tags; + std::set empty_privatetags; + std::set remove_tags; + std::set remove_privatetags; + std::set scrub_tags; + std::set scrub_privatetags; + std::set empty_vrs; + std::set remove_vrs; + bool AllMissingPrivateCreator; + bool AllGroupLength; + bool AllIllegal; + impl() + : AllMissingPrivateCreator(true), + AllGroupLength(true), + AllIllegal(true) {} + + enum ACTION { NONE, EMPTY, REMOVE, SCRUB }; + enum ACTION ComputeAction(File const &file, DataSet &ds, + const DataElement &de, VR const &ref_dict_vr, + const std::string &tag_path); + + bool ProcessDataSet(Subject &s, File &file, DataSet &ds, + const std::string &tag_path); + + template + bool CheckVRBeforeInsert(std::set &empty_or_remove_vrs, T const &t, + std::set &set) { + if (empty_or_remove_vrs.empty()) { + set.insert(t); + return true; + } else { + // Let's check if VR of tag is already contained in VR + static const Global &g = GlobalInstance; + static const Dicts &dicts = g.GetDicts(); + const DictEntry &entry = dicts.GetDictEntry(t); + const VR &refvr = entry.GetVR(); + if (empty_or_remove_vrs.find(refvr) != empty_or_remove_vrs.end()) { + gdcmWarningMacro( + "Tag: " << t << " is also cleanup with VR cleaning. skipping"); + } else if (refvr == VR::INVALID) { + gdcmWarningMacro("inserting unknown tag " + << t << ". no check on VR is done"); + set.insert(t); + } else { + set.insert(t); + } + return true; + } + } + bool Empty(Tag const &t) { + if (t.IsPublic() && !t.IsGroupLength()) { + return CheckVRBeforeInsert(empty_vrs, t, empty_tags); + } + return false; + } + bool Empty(PrivateTag const &pt) { + const char *owner = pt.GetOwner(); + if (pt.IsPrivate() && *owner) { + if (in_part15(pt)) { + gdcmErrorMacro("Cannot add Part 15 attribute for now"); + return false; + } + return CheckVRBeforeInsert(empty_vrs, pt, empty_privatetags); + } + return false; + } + bool Empty(DPath const &dpath) { + empty_dpaths.insert(dpath); + return true; + } + bool Empty(VR const &vr) { + if (vr == VR::PN) { + empty_vrs.insert(vr); + return true; + } + return false; + } + + bool Remove(Tag const &t) { + if (t.IsPublic() && !t.IsGroupLength()) { + return CheckVRBeforeInsert(remove_vrs, t, remove_tags); + } + return false; + } + bool Remove(PrivateTag const &pt) { + const char *owner = pt.GetOwner(); + if (pt.IsPrivate() && *owner) { + if (in_part15(pt)) { + gdcmErrorMacro("Cannot add Part 15 attribute for now"); + return false; + } + return CheckVRBeforeInsert(remove_vrs, pt, remove_privatetags); + } + return false; + } + bool Remove(DPath const &dpath) { + remove_dpaths.insert(dpath); + return true; + } + bool Remove(VR const &vr) { + if (vr == VR::PN) { + remove_vrs.insert(vr); + return true; + } + return false; + } + + bool Scrub(Tag const &t) { return false; } + bool Scrub(PrivateTag const &pt) { + static const PrivateTag &csa1 = CSAHeader::GetCSAImageHeaderInfoTag(); + static const PrivateTag &csa2 = CSAHeader::GetCSASeriesHeaderInfoTag(); + if (pt == csa1 || pt == csa2) { + scrub_privatetags.insert(pt); + return true; + } + return false; + } + bool Scrub(DPath const &dpath) { + scrub_dpaths.insert(dpath); + return true; + } + + bool Scrub(VR const &vr) { return false; } + + bool Preserve(DPath const &dpath) { + preserve_dpaths.insert(dpath); + return true; + } + + void RemoveAllMissingPrivateCreator(bool remove) { + AllMissingPrivateCreator = remove; + } + bool RemoveMissingPrivateCreator(Tag const &t) { return false; } + void RemoveAllGroupLength(bool remove) { AllGroupLength = remove; } + void RemoveAllIllegal(bool remove) { AllIllegal = remove; } +}; + +static VR ComputeDictVR(File &file, DataSet &ds, DataElement const &de) { + VR dict_vr = de.GetVR(); + const Tag &tag = de.GetTag(); + bool compute_dict_vr = true; + if (tag.IsPublic() || tag.IsGroupLength() || tag.IsPrivateCreator()) { + } else { + const PrivateTag pt = ds.GetPrivateTag(tag); + const char *owner = pt.GetOwner(); + assert(owner); + compute_dict_vr = *owner != 0; + } + if (compute_dict_vr) dict_vr = DataSetHelper::ComputeVR(file, ds, tag); + + if (de.GetVR() == VR::SQ) { + assert(dict_vr != VR::UN); + if (!dict_vr.Compatible(de.GetVR())) { + gdcmErrorMacro("Impossible. Dict states VR is: " + << dict_vr << " which is impossible for SQ"); + dict_vr = VR::SQ; + } + } + if (dict_vr != VR::SQ) { + if (de.GetVL().IsUndefined()) { + Tag pixelData(0x7fe0, 0x0010); + assert(dict_vr == VR::OB); + if (tag != pixelData) { + gdcmErrorMacro("Impossible happen: " << de); + return VR::SQ; + } + } + } + return dict_vr; +} + +static inline std::string tostring(uint16_t const val, int const width = 4) { + std::ostringstream oss; + oss.setf(std::ios::right); + oss << std::hex << std::setw(width) << std::setfill('0') << val; + return oss.str(); +} + +static std::vector tag2strings(DataSet const &ds, Tag const &tag) { + std::vector ret; + if (tag.IsPublic() || tag.IsPrivateCreator() || tag.IsGroupLength()) { + ret.push_back(tostring(tag.GetGroup())); + ret.push_back(tostring(tag.GetElement())); + } else { + const PrivateTag pt = ds.GetPrivateTag(tag); + ret.push_back(tostring(pt.GetGroup())); + ret.push_back(tostring(pt.GetElement(), 2)); + ret.push_back(pt.GetOwner()); + } + return ret; +} + +template +static void print_contents(std::ostream &oss, const std::vector &v, + const char *const separator = ",") { + if (!v.empty()) { + std::copy(v.begin(), --v.end(), std::ostream_iterator(oss, separator)); + oss << v.back(); + } +} + +static bool isAllZero(const char *buffer, size_t len) { + while (len-- > 0) { + if (buffer[len] != 0) return false; + } + return true; +} + +static bool CleanCSA(DataSet &ds, const DataElement &de) { + const ByteValue *bv = de.GetByteValue(); + // fast path: + if (!bv) return true; + static const char vs01[] = "VS01"; + // bogus big-endian conversion + if (bv->GetLength() >= 4 && memcmp(bv->GetPointer(), vs01, 4) == 0) { + // technically there is digital trash, but since it is written in byte-swap + // mode, it cannot be detected easily. + return true; + } + static const char pds_com[] = ""; + // PET_REPLAY_PARAM case: + if (bv->GetLength() >= 10 && memcmp(bv->GetPointer(), pds_com, 10) == 0) { + return true; + } + static const char end[] = "END! "; + if (bv->GetLength() >= 10 && + memcmp(bv->GetPointer() + bv->GetLength() - 10, end, 10) == 0) { + return true; + } + const bool zero = isAllZero(bv->GetPointer(), bv->GetLength()); + if (zero) return true; + + DataElement clean(de.GetTag()); + clean.SetVR(de.GetVR()); + std::vector v; + v.resize(bv->GetLength()); + if (csa_memcpy(&v[0], bv->GetPointer(), bv->GetLength())) { + clean.SetByteValue(&v[0], v.size()); + ds.Replace(clean); + return true; + } + gdcmErrorMacro("Failure to call CleanCSA"); + return false; +} + +static DPath ConstructDPath(std::string const &tag_path, const DataSet &ds, + const Tag &tag) { + DPath dpath; + std::ostringstream oss; + oss << tag_path; + const std::vector tag_strings = tag2strings(ds, tag); + print_contents(oss, tag_strings); + dpath.ConstructFromString(oss.str().c_str()); + return dpath; +} + +static bool IsDPathInSet(std::set const &aset, DPath const dpath) { + bool found = false; + for (std::set::const_iterator it = aset.begin(); + found == false && it != aset.end(); ++it) { + found = it->Match(dpath); + } + + return found; +} + +Cleaner::impl::ACTION Cleaner::impl::ComputeAction( + File const &file, DataSet &ds, const DataElement &de, VR const &ref_dict_vr, + const std::string &tag_path) { + const Tag &tag = de.GetTag(); + // Group Length & Illegal cannot be preserved so it is safe to do them now: + if (tag.IsGroupLength()) { + if (AllGroupLength) return Cleaner::impl::REMOVE; + } else if (tag.IsIllegal()) { + if (AllIllegal) return Cleaner::impl::REMOVE; + } + + if (tag.IsPublic()) { + const DPath dpath = ConstructDPath(tag_path, ds, tag); + // Preserve + if (IsDPathInSet(preserve_dpaths, dpath)) return Cleaner::impl::NONE; + // Scrub + if (scrub_tags.find(tag) != scrub_tags.end() || + IsDPathInSet(scrub_dpaths, dpath)) { + return Cleaner::impl::SCRUB; + } + // Empty + if (empty_tags.find(tag) != empty_tags.end() || + IsDPathInSet(empty_dpaths, dpath)) { + assert(!tag.IsGroupLength()); + assert(!tag.IsPrivateCreator()); + assert(ds.FindDataElement(tag)); + return Cleaner::impl::EMPTY; + } + // Remove + if (remove_tags.find(tag) != remove_tags.end() || + IsDPathInSet(remove_dpaths, dpath)) { + return Cleaner::impl::REMOVE; + } + } + + if (tag.IsPrivate() && !tag.IsPrivateCreator() && !tag.IsGroupLength()) { + const PrivateTag pt = ds.GetPrivateTag(tag); + const char *owner = pt.GetOwner(); + assert(owner); + if (*owner == 0 && AllMissingPrivateCreator) { + return Cleaner::impl::REMOVE; + } + // At this point we have a private creator, it makes sense to check for + // preserve: Preserve + const DPath dpath = ConstructDPath(tag_path, ds, tag); + if (IsDPathInSet(preserve_dpaths, dpath)) return Cleaner::impl::NONE; + // Scrub + if (scrub_privatetags.find(pt) != scrub_privatetags.end() || + IsDPathInSet(scrub_dpaths, dpath)) { + return Cleaner::impl::SCRUB; + } + // Empty + if (empty_privatetags.find(pt) != empty_privatetags.end() || + IsDPathInSet(empty_dpaths, dpath)) { + return Cleaner::impl::EMPTY; + } + // Remove + if (remove_privatetags.find(pt) != remove_privatetags.end() || + IsDPathInSet(remove_dpaths, dpath)) { + return Cleaner::impl::REMOVE; + } + } + + // VR cleanup + if (!empty_vrs.empty() || !remove_vrs.empty()) { + VR vr = de.GetVR(); + assert(ref_dict_vr != VR::INVALID); + // be careful with vr handling since we must always prefer the one from the + // dict in case of attribute written as 'OB' but dict states 'PN': + if (ref_dict_vr != VR::UN /*&& ref_dict_vr != VR::INVALID*/) { + // we want to clean VR==PN; but this is a problem for implicit transfer + // syntax, so let's be nice to the user and prefer dict_vr. however for + // explicit, do not assume value in dict can take over the read VR + if (vr == VR::UN || vr == VR::INVALID) { + vr = ref_dict_vr; + } + if (vr != ref_dict_vr) { + // assert(vr == VR::OB || vr == VR::OW); + vr = ref_dict_vr; + } + } + // Empty + if (empty_vrs.find(vr) != empty_vrs.end()) { + return Cleaner::impl::EMPTY; + } + // Remove + if (remove_vrs.find(vr) != remove_vrs.end()) { + return Cleaner::impl::REMOVE; + } + } + + // default action: + return Cleaner::impl::NONE; +} + +bool Cleaner::impl::ProcessDataSet(Subject &subject, File &file, DataSet &ds, + const std::string &tag_path) { + subject.InvokeEvent(IterationEvent()); + ConstIterator it = ds.GetDES().begin(); + + for (; it != ds.GetDES().end(); /*++it*/) { + const DataElement &de = *it; + ++it; // 'Remove/Empty' may invalidate iterator + const Tag &tag = de.GetTag(); + AnonymizeEvent ae; + ae.SetTag(tag); + + VR dict_vr = ComputeDictVR(file, ds, de); + Cleaner::impl::ACTION action = + Cleaner::impl::ComputeAction(file, ds, de, dict_vr, tag_path); + + if (action == Cleaner::impl::NONE) { + // nothing to do, but recurse in nested-dataset: + if (dict_vr == VR::SQ) { + SmartPointer sqi = de.GetValueAsSQ(); + if (sqi) { + SequenceOfItems::SizeType s = sqi->GetNumberOfItems(); + for (SequenceOfItems::SizeType i = 1; i <= s; ++i) { + Item &item = sqi->GetItem(i); + + DataSet &nestedds = item.GetNestedDataSet(); + const std::vector tag_strings = tag2strings(ds, tag); + + std::ostringstream os; + os << tag_path; // already padded with trailing '/' + print_contents(os, tag_strings); + os << '/'; + os << '*'; // no need for item numbering + os << '/'; + + if (!ProcessDataSet(subject, file, nestedds, os.str())) { + gdcmErrorMacro("Error processing Item #" << i); + return false; + } + // Simple memcmp to avoid recomputation of Item Length: make them + // undefined length. TODO would be nice to only do this when + // strictly needed. + item.SetVLToUndefined(); + } + // Simple mechanism to avoid recomputation of Sequence Length: make + // them undefined length + DataElement dup(de.GetTag()); + dup.SetVR(VR::SQ); + dup.SetValue(*sqi); + dup.SetVLToUndefined(); + ds.Replace(dup); + } else { + // SmartPointer sqi = de.GetValueAsSQ(); + if (!de.IsEmpty()) { + gdcmWarningMacro( + "Please report. Dictionary states this should be a SQ. But we " + "failed to load it as such. Passing-through as-is" + << de); + } + } + } + } else if (action == Cleaner::impl::EMPTY) { + DataElement clean(de.GetTag()); + clean.SetVR(de.GetVR()); + ds.Replace(clean); + subject.InvokeEvent(ae); + } else if (action == Cleaner::impl::REMOVE) { + ds.Remove(tag); + subject.InvokeEvent(ae); + } else if (action == Cleaner::impl::SCRUB) { + const PrivateTag pt = ds.GetPrivateTag(tag); + + static const PrivateTag &csa1 = CSAHeader::GetCSAImageHeaderInfoTag(); + static const PrivateTag &csa2 = CSAHeader::GetCSASeriesHeaderInfoTag(); + + if (pt == csa1) { + const bool ret = CleanCSA(ds, de); + if (!ret) return false; + } else if (pt == csa2) { + const bool ret = CleanCSA(ds, de); + if (!ret) return false; + } else { + gdcmErrorMacro(" not implemented"); + return false; + } + subject.InvokeEvent(ae); + } else { + gdcmErrorMacro("Missing handling of action: " << action); + return false; + } + } + return true; +} + +Cleaner::Cleaner() : pimpl(new impl) {} + +Cleaner::~Cleaner() { delete pimpl; } + +bool Cleaner::Empty(Tag const &t) { return pimpl->Empty(t); } +bool Cleaner::Empty(PrivateTag const &pt) { return pimpl->Empty(pt); } +bool Cleaner::Empty(DPath const &dpath) { return pimpl->Empty(dpath); } +bool Cleaner::Empty(VR const &vr) { return pimpl->Empty(vr); } + +bool Cleaner::Remove(Tag const &t) { return pimpl->Remove(t); } +bool Cleaner::Remove(PrivateTag const &pt) { return pimpl->Remove(pt); } +bool Cleaner::Remove(DPath const &dpath) { return pimpl->Remove(dpath); } +bool Cleaner::Remove(VR const &vr) { return pimpl->Remove(vr); } + +bool Cleaner::Scrub(Tag const &t) { return pimpl->Scrub(t); } +bool Cleaner::Scrub(PrivateTag const &pt) { return pimpl->Scrub(pt); } +bool Cleaner::Scrub(DPath const &dpath) { return pimpl->Scrub(dpath); } +bool Cleaner::Scrub(VR const &vr) { return pimpl->Scrub(vr); } + +bool Cleaner::Preserve(DPath const &dpath) { return pimpl->Preserve(dpath); } + +void Cleaner::RemoveAllMissingPrivateCreator(bool remove) { + pimpl->RemoveAllMissingPrivateCreator(remove); +} +bool Cleaner::RemoveMissingPrivateCreator(Tag const &t) { + return pimpl->RemoveMissingPrivateCreator(t); +} +void Cleaner::RemoveAllGroupLength(bool remove) { + pimpl->RemoveAllGroupLength(remove); +} +void Cleaner::RemoveAllIllegal(bool remove) { pimpl->RemoveAllIllegal(remove); } + +bool Cleaner::Clean() { + DataSet &ds = F->GetDataSet(); + this->InvokeEvent(StartEvent()); + const bool ret = pimpl->ProcessDataSet(*this, *F, ds, "/"); + this->InvokeEvent(EndEvent()); + return ret; +} + +} // end namespace gdcm diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmCleaner.h gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmCleaner.h --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmCleaner.h 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmCleaner.h 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,90 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#ifndef GDCMCLEANER_H +#define GDCMCLEANER_H + +#include "gdcmDPath.h" +#include "gdcmFile.h" +#include "gdcmSmartPointer.h" +#include "gdcmSubject.h" + +namespace gdcm { +/** + * \brief Cleaner + * + * This class implement the Subject/Observer pattern trigger the following + * event: \li AnonymizeEvent \li IterationEvent \li StartEvent \li EndEvent + * + */ +class GDCM_EXPORT Cleaner : public Subject { + public: + Cleaner(); + ~Cleaner() override; + + /// + bool Empty(Tag const &t); + bool Empty(PrivateTag const &pt); + bool Empty(DPath const &dpath); + bool Empty(VR const &vr); + + bool Remove(Tag const &t); + bool Remove(PrivateTag const &pt); + bool Remove(DPath const &dpath); + bool Remove(VR const &vr); + + /// Clean digital tash (typically SIEMENS CSA header): + bool Scrub(Tag const &t); + bool Scrub(PrivateTag const &pt); + bool Scrub(DPath const &dpath); + bool Scrub(VR const &vr); + + bool Preserve(DPath const &dpath); + + /// Should I remove all private tag for which no private creator is found. + /// Default: true + void RemoveAllMissingPrivateCreator(bool remove); + + /// Specify a private tag (odd number) without a private creator (root level + /// only for now): + bool RemoveMissingPrivateCreator(Tag const &t); + + /// Should I remove all group length (deprecated). Default: true + void RemoveAllGroupLength(bool remove); + + /// Should I remove all illegal attribute. Default: true + void RemoveAllIllegal(bool remove); + + /// main loop + bool Clean(); + + /// Set/Get File + void SetFile(const File &f) { F = f; } + // const File &GetFile() const { return *F; } + File &GetFile() { return *F; } + + /// for wrapped language: instantiate a reference counted object + static SmartPointer New() { return new Cleaner; } + + private: + // I would prefer to have a smart pointer to DataSet but DataSet does not + // derive from Object... + SmartPointer F; + struct impl; + // PIMPL idiom + impl *pimpl; +}; + +} // end namespace gdcm + +#endif // GDCMCLEANER_H diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDataSetHelper.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDataSetHelper.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDataSetHelper.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDataSetHelper.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -116,6 +116,20 @@ // postcondition says it cannot be VR::INVALID, so return VR::UN return VR::UN; } + else + { + if( ds.FindDataElement( t ) ) + { + const DataElement &de = ds.GetDataElement( t ); + const VR &devr = de.GetVR(); + if( devr != refvr ) + { + if(!refvr.Compatible(devr)) + gdcmWarningMacro("Inconsistent VR: " << devr << " should be " << refvr << " for: [" << (owner ? owner : "") << "]" << " de is: " << de ); + } + } + + } VR vr = refvr; diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDictPrinter.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -440,15 +440,19 @@ std::string strowner; const char *owner = nullptr; const Tag& t = de.GetTag(); - if( t.IsPrivate() && !t.IsPrivateCreator() ) + VR dict_vr = VR::UN; + if( t.IsPrivate() && !t.IsPrivateCreator() && !t.IsGroupLength()) { strowner = ds.GetPrivateCreator(t); owner = strowner.c_str(); } - const DictEntry &entry = dicts.GetDictEntry(t,owner); - - if( de.GetTag().IsPrivate() && de.GetTag().GetElement() >= 0x0100 ) + // illegal element do not have private creator: + if(owner && *owner) { + const DictEntry &entry = dicts.GetDictEntry(t,owner); + dict_vr = entry.GetVR(); + + assert(t.GetElement() >= 0x0100 ); //owner = GetOwner(ds,de); //version = GetVersion(owner); @@ -466,24 +470,24 @@ } VM vm = GuessVMType(de); - if( PrintStyle == XML ) + if( PrintStyle == XML /*&& pvr != VR::UN*/ ) { os << "> 8) << "\" "; os << "vr=\"" << pvr << "\" vm=\"" << vm << "\" "; - if( de.GetTag().IsPrivate() ) + if( t.IsPrivate() ) { - os << R"(name="?" owner=")" << owner - << /*"\" version=\"" << version << */ "\"/>\n"; + assert( owner && *owner ); + os << R"(name="?" owner=")" << owner << "\"/>\n"; } } - else if ( PrintStyle == CXX ) + else if ( PrintStyle == CXX /*&& pvr != VR::UN*/ ) { os << "{0x" << std::hex << std::setw(4) << std::setfill('0') << t.GetGroup() << ",0x" << std::setw(4) << ((uint16_t)(t.GetElement() << 8) >> 8) << ","; - if( de.GetTag().IsPrivate() ) + if( t.IsPrivate() ) { os << "\"" << owner << "\","; @@ -492,21 +496,9 @@ std::replace( vm_str.begin(), vm_str.end(), '-', '_'); os << "VR::" << pvr << ",VM::VM" << vm_str << ",\"??\",false},\n"; } - - //os << "\n ?\n"; - //os << "\n"; - //os << "/>\n"; - //os << " Unknown "; - //os << (t.IsPrivate() ? "Private" : "Public"); - //os << " Tag & Data\n"; - //os << " \n"; - //os << " \n"; - //os << " \n"; - //os << "\n"; } - if( entry.GetVR() == VR::SQ || true ) + if( dict_vr == VR::SQ ) { SmartPointer sqi = de.GetValueAsSQ(); if( sqi ) @@ -537,7 +529,6 @@ { const DataSet &ds = F->GetDataSet(); PrintDataSet2(os, ds); - //os << "\n"; } } diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDPath.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDPath.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDPath.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDPath.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,158 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmDPath.h" +#include "gdcmPrivateTag.h" +#include "gdcmTag.h" + +namespace gdcm { + +DPath::DPath() {} + +DPath::~DPath() {} + +// LO mandates that '\\' is never used: +static const char SEPARATOR = '\\'; +void DPath::Print(std::ostream &os) const { os << Path; } + +bool DPath::IsValid(const char *path) { + DPath tp; + return tp.ConstructFromString(path); +} + +template +static void print_contents(std::ostream &oss, const std::vector &v, + const char *const separator = ",") { + if (!v.empty()) { + std::copy(v.begin(), --v.end(), std::ostream_iterator(oss, separator)); + oss << v.back(); + } +} + +static inline std::string tostring(uint16_t const val, int const width = 4) { + std::ostringstream oss; + oss.setf(std::ios::right); + oss << std::hex << std::setw(width) << std::setfill('0') << val; + return oss.str(); +} + +static std::vector tag2strings(gdcm::Tag const &tag) { + std::vector ret; + assert(tag.IsPublic() || tag.IsPrivateCreator() || tag.IsGroupLength()); + ret.push_back(tostring(tag.GetGroup())); + ret.push_back(tostring(tag.GetElement())); + return ret; +} + +static std::vector tag2strings(gdcm::PrivateTag const &pt) { + std::vector ret; + ret.push_back(tostring(pt.GetGroup())); + ret.push_back(tostring(pt.GetElement(), 2)); + ret.push_back(pt.GetOwner()); + return ret; +} + +static inline bool is_digits(const std::string &str) { + return str.find_first_not_of("0123456789") == std::string::npos; +} + +static std::vector split_from_slash_separated( + std::string const &path, const char separator) { + std::vector comps; + std::istringstream is(path); + std::string sub; + while (std::getline(is, sub, separator)) { + const bool isEmpty = sub.empty(); + const bool isDigits = is_digits(sub); + const bool isWildCard = sub == "*"; + const bool hasComma = sub.find(',') != std::string::npos; + if (isEmpty && comps.empty()) { + comps.push_back(sub); + } else if (isDigits) { + comps.push_back(sub); + } else if (isWildCard) { + comps.push_back(sub); + } else if (hasComma) { + comps.push_back(sub); + } else { +#if 0 + assert(!comps.empty()); + std::string &last = comps.back(); + last.push_back(separator); + last.append(sub); +#else + gdcmErrorMacro("Failed to parse: " << path << " using : " << separator); + comps.clear(); + return comps; +#endif + } + } + return comps; +} + +bool DPath::ConstructFromString(const char *spath) { + Path.clear(); + if (!spath) return false; + std::vector comps; + if (*spath == '/') { + comps = split_from_slash_separated(spath, '/'); + } else if (*spath == '\\') { + comps = split_from_slash_separated(spath, '\\'); + } else { +#if 0 + // 'name' and '//name' is equivalent: + comps.push_back(""); // + comps.push_back(spath); +#endif + return false; + } + if (comps.empty()) return false; + gdcm::PrivateTag pt; + gdcm::Tag t; + std::ostringstream os; + std::vector::const_iterator it = comps.begin(); + unsigned int index; + assert(comps.size() >= 2); + // check root + if (!it->empty()) return false; + ++it; + for (; it != comps.end(); ++it) { + os << SEPARATOR; + const char *str = it->c_str(); + if (pt.ReadFromCommaSeparatedString(str)) { + const std::vector tag_strings = tag2strings(pt); + print_contents(os, tag_strings, ","); + } else if (t.ReadFromCommaSeparatedString(str)) { + const std::vector tag_strings = tag2strings(t); + print_contents(os, tag_strings, ","); + } else if (is_digits(str) && sscanf(str, "%u", &index) == 1 && index > 0) { + os << index; + } else if (*str == '*') { + os << '*'; + } else { + gdcmErrorMacro("Not implemented: " << str); + return false; + } + } + Path = os.str(); + return true; +} + +bool DPath::Match(DPath const &other) const { + if (this->Path == other.Path) return true; + return false; +} + +bool DPath::operator<(const DPath &rhs) const { return this->Path < rhs.Path; } + +} // end namespace gdcm diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDPath.h gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDPath.h --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmDPath.h 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmDPath.h 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,56 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#ifndef GDCMDPATH_H +#define GDCMDPATH_H + +#include "gdcmTag.h" +#include + +namespace gdcm { + +/** + * \brief class to handle a DICOM path + * While supp 118 did introduced a notion of XPath for XML Native model this + * convention is too XML-centric. Instead prefer DCMTK style notation + * https://groups.google.com/g/comp.protocols.dicom/c/IyIH0IOBMPA + */ +class GDCM_EXPORT DPath { + friend std::ostream &operator<<(std::ostream &_os, const DPath &_val); + + public: + DPath(); + ~DPath(); + void Print(std::ostream &) const; + bool operator<(const DPath &rhs) const; + + bool ConstructFromString(const char *path); + + /// Return whether or not 'other' match the template DPath + bool Match(DPath const &other) const; + + /// Return if path is valid or not + static bool IsValid(const char *path); + + private: + std::string Path; +}; + +inline std::ostream &operator<<(std::ostream &os, const DPath &val) { + os << val.Path; + return os; +} + +} // end namespace gdcm + +#endif // GDCMDPATH_H diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -19,6 +19,23 @@ namespace gdcm { +static const char *TypeStrings[] = { + "UNKNOWN", + "FUJI", + "GEMS", + "HITACHI", + "KODAK", + "MARCONI", + "PMS", + "SIEMENS", + "TOSHIBA" +}; + +const char *EquipmentManufacturer::TypeToString( Type type ) +{ + return TypeStrings[type]; +} + struct Mapping { EquipmentManufacturer::Type type; @@ -31,7 +48,7 @@ static const char* const hitachi[] = {"Hitachi Medical Corporation","ALOKA CO., LTD."}; static const char* const kodak[] = {"Kodak"}; static const char* const pms[] = { "Philips Medical Systems", "Philips Healthcare", "Philips Medical Systems, Inc.","Philips","Picker International, Inc." }; -static const char* const siemens[] = { "SIEMENS", "Siemens HealthCare GmbH", "Siemens Health Services","Acuson" }; +static const char* const siemens[] = { "Siemens Healthineers", "SIEMENS", "Siemens HealthCare GmbH", "Siemens Health Services","Acuson" }; static const char* const marconi[] = { "Marconi Medical Systems, Inc." }; static const char* const toshiba[] = { "TOSHIBA_MEC", "Toshiba" }; @@ -52,24 +69,11 @@ MAPPING( EquipmentManufacturer::TOSHIBA, toshiba ) }; -EquipmentManufacturer::Type EquipmentManufacturer::Compute( DataSet const & ds ) +EquipmentManufacturer::Type EquipmentManufacturer::GuessFromPrivateAttributes( DataSet const & ds ) { - // proper anonymizer should not touch Manufacturer attribute value: - // http://dicom.nema.org/medical/dicom/current/output/chtml/part15/chapter_E.html#table_E.1-1 - gdcm::Attribute<0x0008,0x0070> manu = { "" }; // Manufacturer - manu.SetFromDataSet( ds ); - const std::string manufacturer = manu.GetValue().Trim(); - for( const Mapping * mapping = mappings; mapping != mappings + ARRAY_SIZE(mappings); ++mapping ) - { - for( size_t i = 0; i < mapping->nstrings; ++i ) - { - // case insensitive to handle: "GE MEDICAL SYSTEMS" vs "GE Medical Systems" - if( System::StrCaseCmp( mapping->strings[i], manufacturer.c_str() ) == 0 ) - return mapping->type; - } - } - // try against with well known private tag: + // watch out for private creator such as ELSCINT1 which can be found in + // GEMS/PEMS and maybe even SIEMENS ! gdcm::Tag gems_iden_01(0x0009,0x0010); if( ds.FindDataElement( gems_iden_01 ) ) { @@ -77,6 +81,7 @@ gdcm::Element priv_creator; priv_creator.SetFromDataElement( de ); if( priv_creator.GetValue() == "GEMS_IDEN_01" ) return GEMS; + if( priv_creator.GetValue() == "GEMS_PETD_01" ) return GEMS; } gdcm::PrivateTag siemens_manu(0x0021,0x0022,"SIEMENS MR SDS 01"); @@ -88,16 +93,35 @@ if( value.GetValue().Trim() == "SIEMENS" ) return SIEMENS; } - gdcm::Tag elscint1(0x00e1,0x0010); - if( ds.FindDataElement( elscint1 ) ) + return UNKNOWN; +} + +EquipmentManufacturer::Type EquipmentManufacturer::Compute( DataSet const & ds ) +{ + EquipmentManufacturer::Type ret = GuessFromPrivateAttributes( ds ); + + // proper anonymizer should not touch Manufacturer attribute value: + // http://dicom.nema.org/medical/dicom/current/output/chtml/part15/chapter_E.html#table_E.1-1 + gdcm::Attribute<0x0008,0x0070> manu = { "" }; // Manufacturer + manu.SetFromDataSet( ds ); + const std::string manufacturer = manu.GetValue().Trim(); + for( const Mapping * mapping = mappings; mapping != mappings + ARRAY_SIZE(mappings); ++mapping ) { - const gdcm::DataElement & de = ds.GetDataElement( elscint1 ); - gdcm::Element priv_creator; - priv_creator.SetFromDataElement( de ); - if( priv_creator.GetValue() == "ELSCINT1" ) return GEMS; + for( size_t i = 0; i < mapping->nstrings; ++i ) + { + // case insensitive to handle: "GE MEDICAL SYSTEMS" vs "GE Medical Systems" + if( System::StrCaseCmp( mapping->strings[i], manufacturer.c_str() ) == 0 ) { + if( ret != UNKNOWN && ret != mapping->type ) { + gdcmErrorMacro(" Impossible happen: " << ret << " vs " << mapping->type ); + return UNKNOWN; + } + return mapping->type; + } + } } - return UNKNOWN; + gdcmWarningMacro( "Unknown Manufacturer [" << manufacturer << "] trying guess." ); + return ret; } } // end namespace gdcm diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.h gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.h --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmEquipmentManufacturer.h 2022-06-24 07:37:44.000000000 +0000 @@ -23,7 +23,9 @@ /** * \brief * \details - * + * The intent is for private tags handling. This class is not meant to handle + * all possible vendors in the world, simply those well known where we intend + * to read private tags afterwards (typically SIEMENS+CSA, GEMS+PDB ...) */ class GDCM_EXPORT EquipmentManufacturer { @@ -43,7 +45,10 @@ static Type Compute( DataSet const & ds ); + static const char *TypeToString( Type type ); + private: + static EquipmentManufacturer::Type GuessFromPrivateAttributes( DataSet const & ds ); }; } // end namespace gdcm diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmFileExplicitFilter.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmFileExplicitFilter.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmFileExplicitFilter.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmFileExplicitFilter.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -95,7 +95,7 @@ //assert( de.GetVR() == VR::INVALID ); VR cvr = DataSetHelper::ComputeVR(*F,ds, t); VR oldvr = de.GetVR(); - if( cvr == VR::SQ ) { assert( oldvr == VR::SQ || oldvr == VR::UN || oldvr == VR::INVALID ); } + if( cvr == VR::SQ ) { assert( oldvr == VR::SQ || oldvr == VR::UN || oldvr == VR::INVALID || oldvr == VR::OB ); } //SequenceOfItems *sqi = de.GetSequenceOfItems(); //SequenceOfItems *sqi = dynamic_cast(&de.GetValue()); SmartPointer sqi = nullptr; @@ -126,7 +126,7 @@ //assert( oldvr & VR::VRASCII || oldvr == VR::INVALID || oldvr == VR::UN ); // gdcm-JPEG-Extended.dcm has a couple of VR::OB private field // is this a good idea to change them to an ASCII when we know this might not work ? - if( !(oldvr & VR::VRASCII || oldvr == VR::INVALID || oldvr == VR::UN) ) + if( !(oldvr & VR::VRASCII || oldvr == VR::INVALID || oldvr == VR::UN || oldvr == VR::OB) ) { gdcmErrorMacro( "Cannot convert VR for tag: " << t << " " << oldvr << " is incompatible with " << cvr << " as given by ref. dict." ); return false; @@ -181,7 +181,7 @@ } else if( de.GetSequenceOfFragments() ) { - assert( cvr & VR::OB_OW ); + assert( cvr & VR::OB ); } else { diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmFileStreamer.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -32,7 +32,7 @@ #include typedef int64_t off64_t; #else -#if defined(__APPLE__) || defined(__FreeBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) # define off64_t off_t #endif #include // ftruncate diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageChangePlanarConfiguration.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageChangePlanarConfiguration.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageChangePlanarConfiguration.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageChangePlanarConfiguration.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -37,6 +37,7 @@ } assert( Input->GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL || Input->GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL_422 + || Input->GetPhotometricInterpretation() == PhotometricInterpretation::YBR_PARTIAL_422 || Input->GetPhotometricInterpretation() == PhotometricInterpretation::YBR_RCT || Input->GetPhotometricInterpretation() == PhotometricInterpretation::RGB ); if( Input->GetPlanarConfiguration() == PlanarConfiguration ) diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageChangeTransferSyntax.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageChangeTransferSyntax.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageChangeTransferSyntax.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageChangeTransferSyntax.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -66,7 +66,8 @@ output.SetPhotometricInterpretation( PhotometricInterpretation::RGB ); } // when decompressing loss jpeg, need to revert to proper photo inter in uncompressed TS: - if( input.GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL_422 ) + if( input.GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL_422 + || input.GetPhotometricInterpretation() == PhotometricInterpretation::YBR_PARTIAL_422 ) { output.SetPhotometricInterpretation( PhotometricInterpretation::YBR_FULL ); } @@ -277,10 +278,11 @@ UpdatePhotometricInterpretation( input, output ); if( input.GetPixelFormat().GetSamplesPerPixel() == 3 ) { - if( input.GetPlanarConfiguration() == 0 ) + if( input.GetPlanarConfiguration() == 1 ) { - // http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.3.html#table_8.2.3-1 - output.SetPlanarConfiguration(1); + // CP-1843 + // https://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.3.html#para_d1e96f41-db25-4a4b-9009-9fd3796e5b43 + output.SetPlanarConfiguration(0); } } diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -593,7 +593,7 @@ assert( PI != PhotometricInterpretation::UNKNOWN ); std::stringstream bs_os; // ByteSwap std::stringstream pcpc_os; // Padded Composite Pixel Code - std::stringstream pi_os; // PhotometricInterpretation + //std::stringstream pi_os; // PhotometricInterpretation std::stringstream pl_os; // PlanarConf std::istream *cur_is = &is; @@ -645,6 +645,7 @@ // Nothing needs to be done break; case PhotometricInterpretation::YBR_FULL_422: + case PhotometricInterpretation::YBR_PARTIAL_422: { // US-GE-4AICL142.dcm // Hopefully it has been done by the JPEG decoder itself... @@ -665,7 +666,6 @@ default: gdcmErrorMacro( "Unhandled PhotometricInterpretation: " << PI ); return false; - assert(0); } if( /*PlanarConfiguration ||*/ RequestPlanarConfiguration ) diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageConverter.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageConverter.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageConverter.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageConverter.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -19,6 +19,7 @@ ImageConverter::ImageConverter() { + Input = nullptr; Output = new Image; } diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -978,6 +978,9 @@ ds.Replace(numframes.GetAsDataElement()); } } + else if( ms.MediaStorage::GetModalityDimension() == 2 /*&& dims[2] == 1*/ ) + ds.Remove( numframes.GetTag() ); + } else // cleanup ds.Remove( numframes.GetTag() ); diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.hxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.hxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.hxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmJPEGBITSCodec.hxx 2022-06-24 07:37:44.000000000 +0000 @@ -133,7 +133,7 @@ assert(gcount < INT_MAX); nbytes = (size_t)gcount; - if (nbytes <= 0) { + if (gcount <= 0) { if (src->start_of_file) /* Treat empty input file as fatal error */ ERREXIT(cinfo, JERR_INPUT_EMPTY); WARNMS(cinfo, JWRN_JPEG_EOF); @@ -272,7 +272,7 @@ class JPEGInternals { public: - JPEGInternals():cinfo(),jerr(),StateSuspension(0),SampBuffer(nullptr) {} + JPEGInternals():cinfo(),cinfo_comp(),jerr(),StateSuspension(0),SampBuffer(nullptr) {} jpeg_decompress_struct cinfo; jpeg_compress_struct cinfo_comp; my_error_mgr jerr; @@ -477,9 +477,9 @@ else if( cinfo.jpeg_color_space == JCS_YCCK ) { assert( cinfo.num_components == 4 ); - PI = PhotometricInterpretation::YBR_FULL_422; // 4th plane ?? + gdcmWarningMacro( "JCS_YCCK is not handled. Setting to CMYK for now." ); + PI = PhotometricInterpretation::CMYK; // non-sense...oh well this->PF.SetSamplesPerPixel( 4 ); - assert( 0 ); //TODO } else { @@ -835,6 +835,7 @@ break; case JCS_YCbCr: if( GetPhotometricInterpretation() != PhotometricInterpretation::YBR_FULL && + GetPhotometricInterpretation() != PhotometricInterpretation::YBR_PARTIAL_422 && GetPhotometricInterpretation() != PhotometricInterpretation::YBR_FULL_422 ) { // DermaColorLossLess.dcm (lossless) @@ -856,6 +857,7 @@ //cinfo.out_color_space = JCS_UNKNOWN; } if( GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL + || GetPhotometricInterpretation() == PhotometricInterpretation::YBR_PARTIAL_422 || GetPhotometricInterpretation() == PhotometricInterpretation::YBR_FULL_422 ) { cinfo.jpeg_color_space = JCS_UNKNOWN; diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -110,7 +110,7 @@ else if( metadata.components == 3 ) { PI = PhotometricInterpretation::RGB; - PlanarConfiguration = 1; + PlanarConfiguration = 0; // CP-1843 this->PF.SetSamplesPerPixel( 3 ); } else assert(0); @@ -151,6 +151,32 @@ #endif } +template +static void ConvPlanar(std::vector &input) +{ + size_t buf_size = input.size(); + assert( buf_size % sizeof(T) == 0 ); + size_t npixels = buf_size / sizeof( T ); + assert( npixels % 3 == 0 ); + size_t size = npixels / 3; + T* buffer = (T*)&input[0]; + + const T *r = buffer; + const T *g = buffer + size; + const T *b = buffer + size + size; + + T *copy = new T[ npixels ]; + T *p = copy; + for (size_t j = 0; j < size; ++j) + { + *(p++) = *(r++); + *(p++) = *(g++); + *(p++) = *(b++); + } + std::memcpy(&input[0], copy, input.size() ); + delete[] copy; +} + bool JPEGLSCodec::DecodeByStreamsCommon(const char *buffer, size_t totalLen, std::vector &rgbyteOut) { using namespace charls; @@ -164,6 +190,10 @@ return false; } + if( params.colorTransformation != charls::ColorTransformation::None ) + { + gdcmWarningMacro( "APP8 marker found to contains a color transformation. This is an HP extension" ); + } // allowedlossyerror == 0 => Lossless LossyFlag = params.allowedLossyError!= 0; @@ -171,6 +201,20 @@ ApiResult result = JpegLsDecode(&rgbyteOut[0], rgbyteOut.size(), pbyteCompressed, cbyteCompressed, ¶ms, nullptr); + if( params.components == 3 ) + { + const unsigned int nBytes = (params.bitsPerSample + 7) / 8; + if( params.interleaveMode == InterleaveMode::None ) + { + if(nBytes == 1 ) + ConvPlanar(rgbyteOut); + else if(nBytes == 2 ) + ConvPlanar(rgbyteOut); + else + assert(0); + } + } + if (result != ApiResult::OK) { gdcmErrorMacro( "Could not decode JPEG-LS stream" ); @@ -279,6 +323,7 @@ int image_height = dims[1]; const PixelFormat &pf = this->GetPixelFormat(); + unsigned int planarConf = this->GetPlanarConfiguration(); int sample_pixel = pf.GetSamplesPerPixel(); int bitsallocated = pf.GetBitsAllocated(); int bitsstored = pf.GetBitsStored(); @@ -331,13 +376,18 @@ if (sample_pixel == 4) { - params.interleaveMode = InterleaveMode::Line; + params.interleaveMode = InterleaveMode::Sample; } else if (sample_pixel == 3) { - params.interleaveMode = InterleaveMode::Line; - params.colorTransformation = ColorTransformation::HP1; + if(planarConf == 0) + params.interleaveMode = InterleaveMode::Sample; + else + params.interleaveMode = InterleaveMode::None; + params.colorTransformation = ColorTransformation::None; } + else if (sample_pixel == 1) + params.interleaveMode = InterleaveMode::None; ApiResult error = JpegLsEncode(outdata, outlen, &complen, indata, inlen, ¶ms, nullptr); diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmPGXCodec.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmPGXCodec.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmPGXCodec.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmPGXCodec.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -62,8 +62,16 @@ "You need to decompress first." ); return false; } + gdcm::PhotometricInterpretation pi = this->GetPhotometricInterpretation(); +#if 0 + if( pi != gdcm::PhotometricInterpretation::MONOCHROME2 ) { + gdcmErrorMacro( "Bogus PI" << pi ); + return false; + } +#endif const unsigned int *dims = this->GetDimensions(); - size_t image_size = dims[0] * dims[1]; + uint8_t pixelSize = pf.GetPixelSize (); + size_t image_size = dims[0] * dims[1] * pixelSize; const char *img_buffer = bv->GetPointer(); for( unsigned int i = 0; i < num_images; ++i, img_buffer += image_size ) @@ -88,14 +96,55 @@ { (void)filename; (void)out; + gdcmErrorMacro("TODO" ); return false; } -bool PGXCodec::GetHeaderInfo(std::istream &is, TransferSyntax &ts) +bool PGXCodec::GetHeaderInfo(std::istream &is0, TransferSyntax &ts) { - (void)is; - (void)ts; - return false; + std::string str; + std::getline(is0, str); + { + std::istringstream is(str); + std::string str1, str2, sign; + int depth; + is >> str1; + if( str1 != "PG" ) { + gdcmErrorMacro("PGX Wrong header: " << str1 ); + return false; + } + is >> str2; + if( str2 != "ML" ) { + gdcmErrorMacro("PGX Wrong header: " << str2 ); + return false; + } + is >> sign; + if( sign != "+" && sign != "-" ) { + gdcmErrorMacro("PGX Wrong header: " << sign); + return false; + } + is >> depth; + if( depth <= 0 ) { + gdcmErrorMacro("PGX Wrong header: " << depth ); + return false; + } + PhotometricInterpretation pi; + pi = PhotometricInterpretation::MONOCHROME2; + unsigned int dims[3] = {}; + is >> dims[0]; is >> dims[1]; + PixelFormat pf = GetPixelFormat(); + unsigned int numbytes = ( depth + 7 ) / 8; + pf.SetBitsAllocated( numbytes * 8); + pf.SetBitsStored( depth ); + if( sign[0] == '-' ) pf.SetPixelRepresentation(1); + ts = TransferSyntax::ExplicitVRLittleEndian; + + SetPhotometricInterpretation( pi ); + SetPixelFormat( pf ); + SetDimensions( dims ); + } + + return true; } ImageCodec * PGXCodec::Clone() const diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmPrinter.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmPrinter.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmPrinter.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmPrinter.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -463,8 +463,9 @@ std::string strowner; const char *owner = nullptr; const Tag& t = de.GetTag(); - if( t.IsPrivate() && !t.IsPrivateCreator() ) + if( t.IsPrivate() && !t.IsPrivateCreator() && !t.IsGroupLength() ) { + // do not reject illegal at this point to handle group 0x0003 / AEGIS_DICOM_2.00 strowner = ds.GetPrivateCreator(t); owner = strowner.c_str(); } @@ -535,8 +536,14 @@ if( vr != VR::INVALID && (!vr.Compatible( vr_read ) || vr_read == VR::INVALID || vr_read == VR::UN || vr_read != refvr ) ) { assert( vr != VR::INVALID ); + bool valid = true; + if( vr_read == VR::SQ ) { + if( !vr.Compatible( vr_read ) ) { + valid = false; + } + } // FIXME : if terminal supports it: print in red/green ! - os << GDCM_TERMINAL_VT100_FOREGROUND_GREEN; + os << (valid ? GDCM_TERMINAL_VT100_FOREGROUND_GREEN : GDCM_TERMINAL_VT100_FOREGROUND_RED); if( vr == VR::US_SS || vr == VR::OB_OW ) { os << "(" << vr << " => " << refvr << ") "; @@ -843,7 +850,6 @@ // retired element else if( retired ) { - assert( t.IsPublic() || t.GetElement() == 0x0 ); // Is there such thing as private and retired element ? os << " " << GDCM_TERMINAL_VT100_FOREGROUND_RED << GDCM_TERMINAL_VT100_UNDERLINE; os << name; os << GDCM_TERMINAL_VT100_NORMAL; diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmScanner2.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmScanner2.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmScanner2.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmScanner2.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,612 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmScanner2.h" +#include "gdcmReader.h" +#include "gdcmGlobal.h" +#include "gdcmDicts.h" +#include "gdcmDict.h" +#include "gdcmDictEntry.h" +#include "gdcmStringFilter.h" +#include "gdcmProgressEvent.h" +#include "gdcmFileNameEvent.h" + +#include // std::find + +namespace gdcm +{ + +Scanner2::~Scanner2() = default; + +void Scanner2::ClearPublicTags() +{ + PublicTags.clear(); +} + +void Scanner2::ClearPrivateTags() +{ + PrivateTags.clear(); +} + +void Scanner2::ClearSkipTags() +{ + SkipTags.clear(); +} + +bool Scanner2::AddSkipTag( Tag const & t ) +{ + SkipTags.insert( t ); + return true; +} + +bool Scanner2::AddPrivateTag( PrivateTag const & t ) +{ + if( !( t.IsPrivate() && t.GetOwner() && *t.GetOwner() ) ) return false; + // Do not check IsIllegal at this point + static const Global &g = GlobalInstance; + static const Dicts &dicts = g.GetDicts(); + const DictEntry &entry = dicts.GetDictEntry( t ); + // Is this tag an ASCII on ? + if( entry.GetVR() & VR::VRASCII ) + { + PrivateTags.insert( t ); + } + else if( entry.GetVR() == VR::INVALID ) + { + gdcmWarningMacro( "Only tag with known VR are allowed. Tag " << t << " will be discarded" ); + } + else + { + assert( entry.GetVR() & VR::VRBINARY ); + //gdcmWarningMacro( "Only ASCII VR are supported for now. Tag " << t << " will be discarded" ); + PrivateTags.insert( t ); + } + return true; +} + +bool Scanner2::AddPublicTag( Tag const & t ) +{ + if( !t.IsPublic() && !t.IsPrivateCreator() ) return false; + if( t.IsIllegal() ) return false; + static const Global &g = GlobalInstance; + static const Dicts &dicts = g.GetDicts(); + const DictEntry &entry = dicts.GetDictEntry( t ); + // Is this tag an ASCII on ? + if( entry.GetVR() & VR::VRASCII ) + { + PublicTags.insert( t ); + } + else if( entry.GetVR() == VR::INVALID ) + { + gdcmWarningMacro( "Only tag with known VR are allowed. Tag " << t << " will be discarded" ); + } + else + { + assert( entry.GetVR() & VR::VRBINARY ); + //gdcmWarningMacro( "Only ASCII VR are supported for now. Tag " << t << " will be discarded" ); + PublicTags.insert( t ); + } + return true; +} + +bool Scanner2::Scan( Directory::FilenamesType const & filenames ) +{ + this->InvokeEvent( StartEvent() ); + + // Is there at least one tag ? + if( !PublicTags.empty() || !PrivateTags.empty() ) + { + // Prepare hash tables: + PublicMappings.clear(); + PublicMappings[""]; // Create a fake table for dummy file + PrivateMappings.clear(); + PrivateMappings[""]; // Create a fake table for dummy file + + // Make our own copy: + Filenames = filenames; + + // Find the tag with the highest value (get the one from the end of the std::set) + Tag last(0x0,0x0); + if( !PublicTags.empty() ) + { + PublicTagsType::const_reverse_iterator it1 = PublicTags.rbegin(); + const Tag & publiclast = *it1; + last = publiclast; + } + if( !PrivateTags.empty() ) + { + PrivateTagsType::const_reverse_iterator pit1 = PrivateTags.rbegin(); + Tag privatelast = *pit1; + // at this point we do not know the private creator, since it can go up + // to 0xff, simply read up to the next public group (simple logic). + privatelast.SetGroup( privatelast.GetGroup() + 1 ); + privatelast.SetElement( 0x0 ); + if( last < privatelast ) last = privatelast; + } + + StringFilter sf; + Directory::FilenamesType::const_iterator it = Filenames.begin(); + const double progresstick = 1. / (double)Filenames.size(); + Progress = 0; + for(; it != Filenames.end(); ++it) + { + Reader reader; + const char *filename = it->c_str(); + assert( filename ); + reader.SetFileName( filename ); + bool read = false; + try + { + // Start reading all tags, including the 'last' one: + read = reader.ReadUpToTag(last, SkipTags); + } + catch(std::exception & ex) + { + (void)ex; + gdcmWarningMacro( "Failed to read:" << filename << " with ex:" << ex.what() ); + } + catch(...) + { + gdcmWarningMacro( "Failed to read:" << filename << " with unknown error" ); + } + if( read ) + { + // Keep the mapping: + sf.SetFile( reader.GetFile() ); + Scanner2::ProcessPublicTag(sf, filename); + Scanner2::ProcessPrivateTag(sf, filename); + } + // Update progress + Progress += progresstick; + ProgressEvent pe; + pe.SetProgress( Progress ); + this->InvokeEvent( pe ); + // For outside application tell which file is being processed: + FileNameEvent fe( filename ); + this->InvokeEvent( fe ); + } + } + + this->InvokeEvent( EndEvent() ); + return true; +} + +void Scanner2::Print( std::ostream & os ) const +{ + os << "Values:\n"; + for(ValuesType::const_iterator it = Values.begin() ; it != Values.end(); + ++it) + { + os << *it << "\n"; + } + os << "Mapping:\n"; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + assert( filename && *filename ); + bool b = IsKey(filename); + const char *comment = !b ? "could not be read" : "could be read"; + os << "Filename: " << filename << " (" << comment << ")\n"; + if( PublicMappings.find(filename) != PublicMappings.end() ) + { + const PublicTagToValue &mapping = GetPublicMapping(filename); + PublicTagToValue::const_iterator it = mapping.begin(); + for( ; it != mapping.end(); ++it) + { + const Tag & tag = it->first; + const char *value = it->second; + os << tag << " -> [" << value << "]\n"; + } + } + if( PrivateMappings.find(filename) != PrivateMappings.end() ) + { + const PrivateTagToValue &mapping = GetPrivateMapping(filename); + PrivateTagToValue::const_iterator it = mapping.begin(); + for( ; it != mapping.end(); ++it) + { + const PrivateTag & tag = it->first; + const char *value = it->second; + os << tag << " -> [" << value << "]\n"; + } + } + } +} + +static bool IsVRUI(Tag const &tag) +{ + static const Global &g = Global::GetInstance(); + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(tag); + if( dictentry.GetVR() == VR::UI ) return true; + return false; +} + +static bool IsVRUI(PrivateTag const &tag) +{ + static const Global &g = Global::GetInstance(); + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(tag); + if( dictentry.GetVR() == VR::UI ) return true; + return false; +} + + +void Scanner2::PrintTable( std::ostream & os, bool header ) const +{ + if( header ) { + os << "\"Filename\"" << "\t"; + { + PublicTagsType::const_iterator tag = PublicTags.begin(); + for( ; tag != PublicTags.end(); ++tag ) + { + const Tag &t = *tag; + os << '"' << t << '"'; + os << "\t"; + } + } + { + PrivateTagsType::const_iterator tag = PrivateTags.begin(); + for( ; tag != PrivateTags.end(); ++tag ) + { + const PrivateTag &t = *tag; + os << '"' << t << '"'; + os << "\t"; + } + } + os << "\n"; + } + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + assert( filename && *filename ); + os << '"' << filename << '"' << "\t"; + { + PublicTagsType::const_iterator tag = PublicTags.begin(); + const PublicTagToValue &mapping = GetPublicMapping(filename); + for( ; tag != PublicTags.end(); ++tag ) + { + const Tag &t = *tag; + bool isui = IsVRUI(t); + const char *value = ""; + if( mapping.find(t) != mapping.end() ) { + const char * v = mapping.find(t)->second; + if(v) value = v; + } + os << '"' << (isui ? String<>::Trim( value ) : value) << '"'; + os << "\t"; + } + } + { + PrivateTagsType::const_iterator tag = PrivateTags.begin(); + const PrivateTagToValue &mapping = GetPrivateMapping(filename); + for( ; tag != PrivateTags.end(); ++tag ) + { + const PrivateTag &t = *tag; + bool isui = IsVRUI(t); + const char *value = ""; + if( mapping.find(t) != mapping.end() ) { + const char * v = mapping.find(t)->second; + if(v) value = v; + } + os << '"' << (isui ? String<>::Trim( value ) : value) << '"'; + os << "\t"; + } + } + os << "\n"; + } +} + +Scanner2::PublicTagToValue const & Scanner2::GetPublicMapping(const char *filename) const +{ + assert( filename && *filename ); + if( PublicMappings.find(filename) != PublicMappings.end() ) + return PublicMappings.find(filename)->second; + return PublicMappings.find("")->second; // dummy file could not be found +} + +Scanner2::PrivateTagToValue const & Scanner2::GetPrivateMapping(const char *filename) const +{ + assert( filename && *filename ); + if( PrivateMappings.find(filename) != PrivateMappings.end() ) + return PrivateMappings.find(filename)->second; + return PrivateMappings.find("")->second; // dummy file could not be found +} + +bool Scanner2::IsKey( const char * filename ) const +{ + // Look for the file in Mappings tables: + assert( filename && *filename ); + PublicMappingType::const_iterator it2 = PublicMappings.find(filename); + PrivateMappingType::const_iterator it3 = PrivateMappings.find(filename); + return it2 != PublicMappings.end() || it3 != PrivateMappings.end(); +} + +Directory::FilenamesType Scanner2::GetKeys() const +{ + Directory::FilenamesType keys; + + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + if( IsKey( filename ) ) + { + keys.push_back( filename ); + } + } + assert( keys.size() <= Filenames.size() ); + return keys; +} + +const char* Scanner2::GetPublicValue(const char *filename, Tag const &t) const +{ + // \precondition + assert( PublicTags.find( t ) != PublicTags.end() ); + PublicTagToValue const &ftv = GetPublicMapping(filename); + if( ftv.find(t) != ftv.end() ) + { + return ftv.find(t)->second; + } + return nullptr; +} + +const char* Scanner2::GetPrivateValue(const char *filename, PrivateTag const &t) const +{ + // \precondition + assert( PrivateTags.find( t ) != PrivateTags.end() ); + PrivateTagToValue const &ftv = GetPrivateMapping(filename); + if( ftv.find(t) != ftv.end() ) + { + return ftv.find(t)->second; + } + return nullptr; +} + +const char *Scanner2::GetFilenameFromPublicTagToValue(Tag const &t, const char *valueref) const +{ + const char *filenameref = nullptr; + if( valueref ) + { + Directory::FilenamesType::const_iterator file = Filenames.begin(); + const std::string valueref_str = String<>::Trim( valueref ); + for(; file != Filenames.end() && !filenameref; ++file) + { + const char *filename = file->c_str(); + const char * value = GetPublicValue(filename, t); + if( value && valueref == value ) + { + filenameref = filename; + } + } + } + return filenameref; +} + +const char *Scanner2::GetFilenameFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const +{ + const char *filenameref = nullptr; + if( valueref ) + { + Directory::FilenamesType::const_iterator file = Filenames.begin(); + const std::string valueref_str = String<>::Trim( valueref ); + for(; file != Filenames.end() && !filenameref; ++file) + { + const char *filename = file->c_str(); + const char * value = GetPrivateValue(filename, pt); + if( value && valueref_str == value ) + { + filenameref = filename; + } + } + } + return filenameref; +} + + + +/// Will loop over all files and return a vector of std::strings of filenames +/// where value match the reference value 'valueref' +Directory::FilenamesType Scanner2::GetAllFilenamesFromPublicTagToValue(Tag const &t, const char *valueref) const +{ + Directory::FilenamesType theReturn; + if( valueref ) + { + const std::string valueref_str = String<>::Trim( valueref ); + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + const char * value = GetPublicValue(filename, t); + if( value && valueref_str == value ) + { + theReturn.push_back( filename ); + } + } + } + return theReturn; +} + +Directory::FilenamesType Scanner2::GetAllFilenamesFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const +{ + Directory::FilenamesType theReturn; + if( valueref ) + { + const std::string valueref_str = String<>::Trim( valueref ); + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + const char * value = GetPrivateValue(filename, pt); + if( value && valueref_str == value ) + { + theReturn.push_back( filename ); + } + } + } + return theReturn; +} + +Scanner2::PublicTagToValue const & Scanner2::GetMappingFromPublicTagToValue(Tag const &t, const char *valueref) const +{ + return GetPublicMapping( GetFilenameFromPublicTagToValue(t, valueref) ); +} + +Scanner2::PrivateTagToValue const & Scanner2::GetMappingFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const +{ + return GetPrivateMapping( GetFilenameFromPrivateTagToValue(pt, valueref) ); +} + +Scanner2::ValuesType Scanner2::GetPublicValues(Tag const &t) const +{ + ValuesType vt; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PublicTagToValue const &ttv = GetPublicMapping(filename); + if( ttv.find(t) != ttv.end() ) + { + vt.insert( ttv.find(t)->second ); + } + } + return vt; +} + +Scanner2::ValuesType Scanner2::GetPrivateValues(PrivateTag const &pt) const +{ + ValuesType vt; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PrivateTagToValue const &ttv = GetPrivateMapping(filename); + if( ttv.find(pt) != ttv.end() ) + { + vt.insert( ttv.find(pt)->second ); + } + } + return vt; +} + +Directory::FilenamesType Scanner2::GetPublicOrderedValues(Tag const &t) const +{ + Directory::FilenamesType theReturn; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PublicTagToValue const &ttv = GetPublicMapping(filename); + if( ttv.find(t) != ttv.end() ) + { + std::string theVal = std::string(ttv.find(t)->second); + if (std::find(theReturn.begin(), theReturn.end(), theVal) == theReturn.end()){ + theReturn.push_back( theVal );//only add new tags to the list + } + } + } + return theReturn; +} + +Directory::FilenamesType Scanner2::GetPrivateOrderedValues(PrivateTag const &pt) const +{ + Directory::FilenamesType theReturn; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PrivateTagToValue const &ttv = GetPrivateMapping(filename); + if( ttv.find(pt) != ttv.end() ) + { + std::string theVal = std::string(ttv.find(pt)->second); + if (std::find(theReturn.begin(), theReturn.end(), theVal) == theReturn.end()){ + theReturn.push_back( theVal );//only add new tags to the list + } + } + } + return theReturn; +} + +void Scanner2::ProcessPublicTag(StringFilter &sf, const char *filename) +{ + assert( filename ); + PublicTagToValue &mapping = PublicMappings[filename]; + const File& file = sf.GetFile(); + + const FileMetaInformation & header = file.GetHeader(); + const DataSet & ds = file.GetDataSet(); + PublicTagsType::const_iterator tag = PublicTags.begin(); + for( ; tag != PublicTags.end(); ++tag ) + { + if( tag->GetGroup() == 0x0002 ) + { + if( header.FindDataElement( *tag ) ) + { + DataElement const & de = header.GetDataElement( *tag ); + std::string s = sf.ToString(de.GetTag()); + + // Store the potentially new value: + Values.insert( s ); + assert( Values.find( s ) != Values.end() ); + const char *value = Values.find( s )->c_str(); + assert( value ); + mapping.insert( + PublicTagToValue::value_type(*tag, value)); + } + } + else + { + if( ds.FindDataElement( *tag ) ) + { + DataElement const & de = ds.GetDataElement( *tag ); + std::string s = sf.ToString(de.GetTag()); + + // Store the potentially new value: + Values.insert( s ); + assert( Values.find( s ) != Values.end() ); + const char *value = Values.find( s )->c_str(); + assert( value ); + mapping.insert( + PublicTagToValue::value_type(*tag, value)); + } + } + } // end for +} + +void Scanner2::ProcessPrivateTag(StringFilter &sf, const char *filename) +{ + assert( filename ); + PrivateTagToValue &mapping = PrivateMappings[filename]; + const File& file = sf.GetFile(); + const DataSet & ds = file.GetDataSet(); + PrivateTagsType::const_iterator ptag = PrivateTags.begin(); + for( ; ptag != PrivateTags.end(); ++ptag ) + { + if( ds.FindDataElement( *ptag ) ) + { + DataElement const & de = ds.GetDataElement( *ptag ); + std::string s = sf.ToString(de.GetTag()); + + // Store the potentially new value: + Values.insert( s ); + assert( Values.find( s ) != Values.end() ); + const char *value = Values.find( s )->c_str(); + assert( value ); + mapping.insert( + PrivateTagToValue::value_type(*ptag, value)); + } + } // end for +} + +} // end namespace gdcm diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmScanner2.h gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmScanner2.h --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmScanner2.h 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmScanner2.h 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,208 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#ifndef GDCMSCANNER2_H +#define GDCMSCANNER2_H + +#include "gdcmDirectory.h" +#include "gdcmSubject.h" +#include "gdcmTag.h" +#include "gdcmPrivateTag.h" +#include "gdcmSmartPointer.h" + +#include +#include +#include + +#include // strcmp + +namespace gdcm +{ +class StringFilter; + +/** + * \brief Scanner2 + * \details This filter is meant for quickly browsing a FileSet (a set of files on + * disk). Special consideration are taken so as to read the minimum amount of + * information in each file in order to retrieve the user specified set of + * DICOM Attribute. + * + * This filter is dealing with both VRASCII and VRBINARY element, thanks to the + * help of StringFilter + * + * \warning IMPORTANT In case of file where tags are not ordered (illegal as + * per DICOM specification), the output will be missing information + * + * \note implementation details. All values are stored in a std::set of + * std::string. Then the address of the cstring underlying the std::string is + * used in the std::map. + * + * This class implement the Subject/Observer pattern trigger the following events: + * \li ProgressEvent + * \li StartEvent + * \li EndEvent + */ +class GDCM_EXPORT Scanner2 : public Subject +{ + friend std::ostream& operator<<(std::ostream &_os, const Scanner2 &s); +public: + Scanner2():Values(),Filenames(),PublicMappings(),PrivateMappings() {} + ~Scanner2() override; + + /// struct to map a filename to a value + /// Implementation note: + /// all std::map in this class will be using const char * and not std::string + /// since we are pointing to existing std::string (held in a std::vector) + /// this avoid an extra copy of the byte array. + /// Tag are used as Tag class since sizeof(tag) <= sizeof(pointer) + typedef std::map PublicTagToValue; + typedef PublicTagToValue::value_type PublicTagToValueValueType; + + typedef std::map PrivateTagToValue; + typedef PrivateTagToValue::value_type PrivateTagToValueValueType; + + /// Add a tag that will need to be read. Those are root level tags + bool AddPublicTag( Tag const & t ); + void ClearPublicTags(); + + // Work in progress do not use: + bool AddPrivateTag( PrivateTag const & pt ); + void ClearPrivateTags(); + + /// Add a tag that will need to be skipped. Those are root level skip tags + bool AddSkipTag( Tag const & t ); + void ClearSkipTags(); + + /// Start the scan ! + bool Scan( Directory::FilenamesType const & filenames ); + + /// Return the list of filenames + Directory::FilenamesType const &GetFilenames() const { return Filenames; } + + /// Print result + void Print( std::ostream & os ) const override; + + /// Print result as CSV table + void PrintTable( std::ostream & os, bool header = false ) const; + + /// Check if filename is a key in the Mapping table. + /// returns true only of file can be found, which means + /// the file was indeed a DICOM file that could be processed + bool IsKey( const char * filename ) const; + + /// Return the list of filename that are key in the internal map, + /// which means those filename were properly parsed + Directory::FilenamesType GetKeys() const; + + // struct to store all the values found: + typedef std::set< std::string > ValuesType; + + /// Get all the values found (in lexicographic order) + ValuesType const & GetValues() const { return Values; } + + /// Get all the values found (in lexicographic order) associated with Tag 't' + ValuesType GetPublicValues(Tag const &t) const; + + /// Get all the values found (in lexicographic order) associated with PrivateTag 'pt' + ValuesType GetPrivateValues(PrivateTag const &pt) const; + + /// Get all the values found (in a vector) associated with Tag 't' + /// This function is identical to GetValues, but is accessible from the wrapped + /// layer (python, C#, java) + Directory::FilenamesType GetPublicOrderedValues(Tag const &t) const; + + Directory::FilenamesType GetPrivateOrderedValues(PrivateTag const &pt) const; + + /* ltstr is CRITICAL, otherwise pointers value are used to do the key comparison */ + struct ltstr + { + bool operator()(const char* s1, const char* s2) const + { + assert( s1 && s2 ); + return strcmp(s1, s2) < 0; + } + }; + typedef std::map PublicMappingType; + typedef PublicMappingType::const_iterator PublicConstIterator; + PublicConstIterator Begin() const { return PublicMappings.begin(); } + PublicConstIterator End() const { return PublicMappings.end(); } + + typedef std::map PrivateMappingType; + typedef PrivateMappingType::const_iterator PrivateConstIterator; + PrivateConstIterator PrivateBegin() const { return PrivateMappings.begin(); } + PrivateConstIterator PrivateEnd() const { return PrivateMappings.end(); } + + /// Mappings are the mapping from a particular tag to the map, mapping filename to value: + PublicMappingType const & GetPublicMappings() const { return PublicMappings; } + PrivateMappingType const & GetPrivateMappings() const { return PrivateMappings; } + + /// Get the std::map mapping filenames to value for file 'filename' + PublicTagToValue const & GetPublicMapping(const char *filename) const; + PrivateTagToValue const & GetPrivateMapping(const char *filename) const; + + /// Will loop over all files and return the first file where value match the reference value + /// 'valueref' + const char *GetFilenameFromPublicTagToValue(Tag const &t, const char *valueref) const; + const char *GetFilenameFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const; + + /// Will loop over all files and return a vector of std::strings of filenames + /// where value match the reference value 'valueref' + Directory::FilenamesType GetAllFilenamesFromPublicTagToValue(Tag const &t, const char *valueref) const; + Directory::FilenamesType GetAllFilenamesFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const; + + /// See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue followed + // by a call to GetMapping() + PublicTagToValue const & GetMappingFromPublicTagToValue(Tag const &t, const char *value) const; + PrivateTagToValue const & GetMappingFromPrivateTagToValue(PrivateTag const &pt, const char *value) const; + + /// Retrieve the value found for tag: t associated with file: filename + /// This is meant for a single short call. If multiple calls (multiple tags) + /// should be done, prefer the GetMapping function, and then reuse the TagToValue + /// hash table. + /// \warning Tag 't' should have been added via AddTag() prior to the Scan() call ! + const char* GetPublicValue(const char *filename, Tag const &t) const; + const char* GetPrivateValue(const char *filename, PrivateTag const &t) const; + + /// for wrapped language: instantiate a reference counted object + static SmartPointer New() { return new Scanner2; } + +protected: + void ProcessPublicTag(StringFilter &sf, const char *filename); + void ProcessPrivateTag(StringFilter &sf, const char *filename); +private: + // struct to store all uniq tags in ascending order: + typedef std::set< Tag > PublicTagsType; + typedef std::set< PrivateTag > PrivateTagsType; + std::set< Tag > PublicTags; // Public and Private Creator + std::set< PrivateTag > PrivateTags; // Only Private (no Private Creator) + std::set< Tag > SkipTags; + ValuesType Values; + Directory::FilenamesType Filenames; + + // Main struct that will hold all public mapping: + PublicMappingType PublicMappings; + // Main struct that will hold all private mapping: + PrivateMappingType PrivateMappings; + + double Progress; +}; +//----------------------------------------------------------------------------- +inline std::ostream& operator<<(std::ostream &os, const Scanner2 &s) +{ + s.Print( os ); + return os; +} + +} // end namespace gdcm + +#endif //GDCMSCANNER2_H diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,621 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmStrictScanner2.h" +#include "gdcmReader.h" +#include "gdcmGlobal.h" +#include "gdcmDicts.h" +#include "gdcmDict.h" +#include "gdcmDictEntry.h" +#include "gdcmStringFilter.h" +#include "gdcmProgressEvent.h" +#include "gdcmFileNameEvent.h" + +#include // std::find + +namespace gdcm +{ + +StrictScanner2::~StrictScanner2() = default; + +void StrictScanner2::ClearPublicTags() +{ + PublicTags.clear(); +} + +void StrictScanner2::ClearPrivateTags() +{ + PrivateTags.clear(); +} + +void StrictScanner2::ClearSkipTags() +{ + SkipTags.clear(); +} + +bool StrictScanner2::AddSkipTag( Tag const & t ) +{ + SkipTags.insert( t ); + return true; +} + +bool StrictScanner2::AddPrivateTag( PrivateTag const & t ) +{ + if( !( t.IsPrivate() && t.GetOwner() && *t.GetOwner() ) ) return false; + if( t.IsIllegal() ) return false; + static const Global &g = GlobalInstance; + static const Dicts &dicts = g.GetDicts(); + const DictEntry &entry = dicts.GetDictEntry( t ); + // Is this tag an ASCII on ? + if( entry.GetVR() & VR::VRASCII ) + { + PrivateTags.insert( t ); + } + else if( entry.GetVR() == VR::INVALID ) + { + gdcmWarningMacro( "Only tag with known VR are allowed. Tag " << t << " will be discarded" ); + } + else + { + assert( entry.GetVR() & VR::VRBINARY ); + //gdcmWarningMacro( "Only ASCII VR are supported for now. Tag " << t << " will be discarded" ); + PrivateTags.insert( t ); + } + return true; +} + +bool StrictScanner2::AddPublicTag( Tag const & t ) +{ + if( !t.IsPublic() && !t.IsPrivateCreator() ) return false; + if( t.IsIllegal() ) return false; + static const Global &g = GlobalInstance; + static const Dicts &dicts = g.GetDicts(); + const DictEntry &entry = dicts.GetDictEntry( t ); + // Is this tag an ASCII on ? + if( entry.GetVR() & VR::VRASCII ) + { + PublicTags.insert( t ); + } + else if( entry.GetVR() == VR::INVALID ) + { + gdcmWarningMacro( "Only tag with known VR are allowed. Tag " << t << " will be discarded" ); + } + else + { + assert( entry.GetVR() & VR::VRBINARY ); + //gdcmWarningMacro( "Only ASCII VR are supported for now. Tag " << t << " will be discarded" ); + PublicTags.insert( t ); + } + return true; +} + +// see gdcmReader.strict.cxx +bool StrictReadUpToTag( const char * filename, Tag const & last, std::set const & skiptags ); + +bool StrictScanner2::Scan( Directory::FilenamesType const & filenames ) +{ + this->InvokeEvent( StartEvent() ); + + // Is there at least one tag ? + if( !PublicTags.empty() || !PrivateTags.empty() ) + { + // Prepare hash tables: + PublicMappings.clear(); + PublicMappings[""]; // Create a fake table for dummy file + PrivateMappings.clear(); + PrivateMappings[""]; // Create a fake table for dummy file + + // Make our own copy: + Filenames = filenames; + + // Find the tag with the highest value (get the one from the end of the std::set) + Tag last(0x0,0x0); + if( !PublicTags.empty() ) + { + PublicTagsType::const_reverse_iterator it1 = PublicTags.rbegin(); + const Tag & publiclast = *it1; + last = publiclast; + } + if( !PrivateTags.empty() ) + { + PrivateTagsType::const_reverse_iterator pit1 = PrivateTags.rbegin(); + Tag privatelast = *pit1; + // at this point we do not know the private creator, since it can go up + // to 0xff, simply read up to the next public group (simple logic). + privatelast.SetGroup( privatelast.GetGroup() + 1 ); + privatelast.SetElement( 0x0 ); + if( last < privatelast ) last = privatelast; + } + + StringFilter sf; + Directory::FilenamesType::const_iterator it = Filenames.begin(); + const double progresstick = 1. / (double)Filenames.size(); + Progress = 0; + for(; it != Filenames.end(); ++it) + { + Reader reader; + const char *filename = it->c_str(); + assert( filename ); + reader.SetFileName( filename ); + // Pass #1, just check if the file is valid (up to the tag) + const bool strict = StrictReadUpToTag( filename, last, SkipTags ); + if( strict ) + { + // Pass #2, syntax is ok, retrieve data now: + bool read = false; + try + { + // Start reading all tags, including the 'last' one: + read = reader.ReadUpToTag(last, SkipTags); + } + catch(std::exception & ex) + { + (void)ex; + gdcmWarningMacro( "Failed to read:" << filename << " with ex:" << ex.what() ); + } + catch(...) + { + gdcmWarningMacro( "Failed to read:" << filename << " with unknown error" ); + } + if( read ) + { + // Keep the mapping: + sf.SetFile( reader.GetFile() ); + StrictScanner2::ProcessPublicTag(sf, filename); + StrictScanner2::ProcessPrivateTag(sf, filename); + } + } + // Update progress + Progress += progresstick; + ProgressEvent pe; + pe.SetProgress( Progress ); + this->InvokeEvent( pe ); + // For outside application tell which file is being processed: + FileNameEvent fe( filename ); + this->InvokeEvent( fe ); + } + } + + this->InvokeEvent( EndEvent() ); + return true; +} + +void StrictScanner2::Print( std::ostream & os ) const +{ + os << "Values:\n"; + for(ValuesType::const_iterator it = Values.begin() ; it != Values.end(); + ++it) + { + os << *it << "\n"; + } + os << "Mapping:\n"; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + assert( filename && *filename ); + bool b = IsKey(filename); + const char *comment = !b ? "could not be read" : "could be read"; + os << "Filename: " << filename << " (" << comment << ")\n"; + if( PublicMappings.find(filename) != PublicMappings.end() ) + { + const PublicTagToValue &mapping = GetPublicMapping(filename); + PublicTagToValue::const_iterator it = mapping.begin(); + for( ; it != mapping.end(); ++it) + { + const Tag & tag = it->first; + const char *value = it->second; + os << tag << " -> [" << value << "]\n"; + } + } + if( PrivateMappings.find(filename) != PrivateMappings.end() ) + { + const PrivateTagToValue &mapping = GetPrivateMapping(filename); + PrivateTagToValue::const_iterator it = mapping.begin(); + for( ; it != mapping.end(); ++it) + { + const PrivateTag & tag = it->first; + const char *value = it->second; + os << tag << " -> [" << value << "]\n"; + } + } + } +} + +static bool IsVRUI(Tag const &tag) +{ + static const Global &g = Global::GetInstance(); + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(tag); + if( dictentry.GetVR() == VR::UI ) return true; + return false; +} + +static bool IsVRUI(PrivateTag const &tag) +{ + static const Global &g = Global::GetInstance(); + static const Dicts &dicts = g.GetDicts(); + const DictEntry &dictentry = dicts.GetDictEntry(tag); + if( dictentry.GetVR() == VR::UI ) return true; + return false; +} + + +void StrictScanner2::PrintTable( std::ostream & os, bool header ) const +{ + if( header ) { + os << "\"Filename\"" << "\t"; + { + PublicTagsType::const_iterator tag = PublicTags.begin(); + for( ; tag != PublicTags.end(); ++tag ) + { + const Tag &t = *tag; + os << '"' << t << '"'; + os << "\t"; + } + } + { + PrivateTagsType::const_iterator tag = PrivateTags.begin(); + for( ; tag != PrivateTags.end(); ++tag ) + { + const PrivateTag &t = *tag; + os << '"' << t << '"'; + os << "\t"; + } + } + os << "\n"; + } + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + assert( filename && *filename ); + os << '"' << filename << '"' << "\t"; + { + PublicTagsType::const_iterator tag = PublicTags.begin(); + const PublicTagToValue &mapping = GetPublicMapping(filename); + for( ; tag != PublicTags.end(); ++tag ) + { + const Tag &t = *tag; + bool isui = IsVRUI(t); + const char *value = ""; + if( mapping.find(t) != mapping.end() ) { + const char * v = mapping.find(t)->second; + if(v) value = v; + } + os << '"' << (isui ? String<>::Trim( value ) : value) << '"'; + os << "\t"; + } + } + { + PrivateTagsType::const_iterator tag = PrivateTags.begin(); + const PrivateTagToValue &mapping = GetPrivateMapping(filename); + for( ; tag != PrivateTags.end(); ++tag ) + { + const PrivateTag &t = *tag; + bool isui = IsVRUI(t); + const char *value = ""; + if( mapping.find(t) != mapping.end() ) { + const char * v = mapping.find(t)->second; + if(v) value = v; + } + os << '"' << (isui ? String<>::Trim( value ) : value) << '"'; + os << "\t"; + } + } + os << "\n"; + } +} + +StrictScanner2::PublicTagToValue const & StrictScanner2::GetPublicMapping(const char *filename) const +{ + assert( filename && *filename ); + if( PublicMappings.find(filename) != PublicMappings.end() ) + return PublicMappings.find(filename)->second; + return PublicMappings.find("")->second; // dummy file could not be found +} + +StrictScanner2::PrivateTagToValue const & StrictScanner2::GetPrivateMapping(const char *filename) const +{ + assert( filename && *filename ); + if( PrivateMappings.find(filename) != PrivateMappings.end() ) + return PrivateMappings.find(filename)->second; + return PrivateMappings.find("")->second; // dummy file could not be found +} + +bool StrictScanner2::IsKey( const char * filename ) const +{ + // Look for the file in Mappings tables: + assert( filename && *filename ); + PublicMappingType::const_iterator it2 = PublicMappings.find(filename); + PrivateMappingType::const_iterator it3 = PrivateMappings.find(filename); + return it2 != PublicMappings.end() || it3 != PrivateMappings.end(); +} + +Directory::FilenamesType StrictScanner2::GetKeys() const +{ + Directory::FilenamesType keys; + + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + if( IsKey( filename ) ) + { + keys.push_back( filename ); + } + } + assert( keys.size() <= Filenames.size() ); + return keys; +} + +const char* StrictScanner2::GetPublicValue(const char *filename, Tag const &t) const +{ + // \precondition + assert( PublicTags.find( t ) != PublicTags.end() ); + PublicTagToValue const &ftv = GetPublicMapping(filename); + if( ftv.find(t) != ftv.end() ) + { + return ftv.find(t)->second; + } + return nullptr; +} + +const char* StrictScanner2::GetPrivateValue(const char *filename, PrivateTag const &t) const +{ + // \precondition + assert( PrivateTags.find( t ) != PrivateTags.end() ); + PrivateTagToValue const &ftv = GetPrivateMapping(filename); + if( ftv.find(t) != ftv.end() ) + { + return ftv.find(t)->second; + } + return nullptr; +} + +const char *StrictScanner2::GetFilenameFromPublicTagToValue(Tag const &t, const char *valueref) const +{ + const char *filenameref = nullptr; + if( valueref ) + { + Directory::FilenamesType::const_iterator file = Filenames.begin(); + const std::string valueref_str = String<>::Trim( valueref ); + for(; file != Filenames.end() && !filenameref; ++file) + { + const char *filename = file->c_str(); + const char * value = GetPublicValue(filename, t); + if( value && valueref == value ) + { + filenameref = filename; + } + } + } + return filenameref; +} + +const char *StrictScanner2::GetFilenameFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const +{ + const char *filenameref = nullptr; + if( valueref ) + { + Directory::FilenamesType::const_iterator file = Filenames.begin(); + const std::string valueref_str = String<>::Trim( valueref ); + for(; file != Filenames.end() && !filenameref; ++file) + { + const char *filename = file->c_str(); + const char * value = GetPrivateValue(filename, pt); + if( value && valueref_str == value ) + { + filenameref = filename; + } + } + } + return filenameref; +} + + + +/// Will loop over all files and return a vector of std::strings of filenames +/// where value match the reference value 'valueref' +Directory::FilenamesType StrictScanner2::GetAllFilenamesFromPublicTagToValue(Tag const &t, const char *valueref) const +{ + Directory::FilenamesType theReturn; + if( valueref ) + { + const std::string valueref_str = String<>::Trim( valueref ); + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + const char * value = GetPublicValue(filename, t); + if( value && valueref_str == value ) + { + theReturn.push_back( filename ); + } + } + } + return theReturn; +} + +Directory::FilenamesType StrictScanner2::GetAllFilenamesFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const +{ + Directory::FilenamesType theReturn; + if( valueref ) + { + const std::string valueref_str = String<>::Trim( valueref ); + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + const char * value = GetPrivateValue(filename, pt); + if( value && valueref_str == value ) + { + theReturn.push_back( filename ); + } + } + } + return theReturn; +} + +StrictScanner2::PublicTagToValue const & StrictScanner2::GetMappingFromPublicTagToValue(Tag const &t, const char *valueref) const +{ + return GetPublicMapping( GetFilenameFromPublicTagToValue(t, valueref) ); +} + +StrictScanner2::PrivateTagToValue const & StrictScanner2::GetMappingFromPrivateTagToValue(PrivateTag const &pt, const char *valueref) const +{ + return GetPrivateMapping( GetFilenameFromPrivateTagToValue(pt, valueref) ); +} + +StrictScanner2::ValuesType StrictScanner2::GetPublicValues(Tag const &t) const +{ + ValuesType vt; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PublicTagToValue const &ttv = GetPublicMapping(filename); + if( ttv.find(t) != ttv.end() ) + { + vt.insert( ttv.find(t)->second ); + } + } + return vt; +} + +StrictScanner2::ValuesType StrictScanner2::GetPrivateValues(PrivateTag const &pt) const +{ + ValuesType vt; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PrivateTagToValue const &ttv = GetPrivateMapping(filename); + if( ttv.find(pt) != ttv.end() ) + { + vt.insert( ttv.find(pt)->second ); + } + } + return vt; +} + +Directory::FilenamesType StrictScanner2::GetPublicOrderedValues(Tag const &t) const +{ + Directory::FilenamesType theReturn; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PublicTagToValue const &ttv = GetPublicMapping(filename); + if( ttv.find(t) != ttv.end() ) + { + std::string theVal = std::string(ttv.find(t)->second); + if (std::find(theReturn.begin(), theReturn.end(), theVal) == theReturn.end()){ + theReturn.push_back( theVal );//only add new tags to the list + } + } + } + return theReturn; +} + +Directory::FilenamesType StrictScanner2::GetPrivateOrderedValues(PrivateTag const &pt) const +{ + Directory::FilenamesType theReturn; + Directory::FilenamesType::const_iterator file = Filenames.begin(); + for(; file != Filenames.end(); ++file) + { + const char *filename = file->c_str(); + PrivateTagToValue const &ttv = GetPrivateMapping(filename); + if( ttv.find(pt) != ttv.end() ) + { + std::string theVal = std::string(ttv.find(pt)->second); + if (std::find(theReturn.begin(), theReturn.end(), theVal) == theReturn.end()){ + theReturn.push_back( theVal );//only add new tags to the list + } + } + } + return theReturn; +} + +void StrictScanner2::ProcessPublicTag(StringFilter &sf, const char *filename) +{ + assert( filename ); + PublicTagToValue &mapping = PublicMappings[filename]; + const File& file = sf.GetFile(); + + const FileMetaInformation & header = file.GetHeader(); + const DataSet & ds = file.GetDataSet(); + PublicTagsType::const_iterator tag = PublicTags.begin(); + for( ; tag != PublicTags.end(); ++tag ) + { + if( tag->GetGroup() == 0x0002 ) + { + if( header.FindDataElement( *tag ) ) + { + DataElement const & de = header.GetDataElement( *tag ); + std::string s = sf.ToString(de.GetTag()); + + // Store the potentially new value: + Values.insert( s ); + assert( Values.find( s ) != Values.end() ); + const char *value = Values.find( s )->c_str(); + assert( value ); + mapping.insert( + PublicTagToValue::value_type(*tag, value)); + } + } + else + { + if( ds.FindDataElement( *tag ) ) + { + DataElement const & de = ds.GetDataElement( *tag ); + std::string s = sf.ToString(de.GetTag()); + + // Store the potentially new value: + Values.insert( s ); + assert( Values.find( s ) != Values.end() ); + const char *value = Values.find( s )->c_str(); + assert( value ); + mapping.insert( + PublicTagToValue::value_type(*tag, value)); + } + } + } // end for +} + +void StrictScanner2::ProcessPrivateTag(StringFilter &sf, const char *filename) +{ + assert( filename ); + PrivateTagToValue &mapping = PrivateMappings[filename]; + const File& file = sf.GetFile(); + const DataSet & ds = file.GetDataSet(); + PrivateTagsType::const_iterator ptag = PrivateTags.begin(); + for( ; ptag != PrivateTags.end(); ++ptag ) + { + if( ds.FindDataElement( *ptag ) ) + { + DataElement const & de = ds.GetDataElement( *ptag ); + std::string s = sf.ToString(de.GetTag()); + + // Store the potentially new value: + Values.insert( s ); + assert( Values.find( s ) != Values.end() ); + const char *value = Values.find( s )->c_str(); + assert( value ); + mapping.insert( + PrivateTagToValue::value_type(*ptag, value)); + } + } // end for +} + +} // end namespace gdcm diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.h gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.h --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.h 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmStrictScanner2.h 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,215 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#ifndef GDCMSTRICTSCANNER2_H +#define GDCMSTRICTSCANNER2_H + +#include "gdcmDirectory.h" +#include "gdcmPrivateTag.h" +#include "gdcmSmartPointer.h" +#include "gdcmSubject.h" +#include "gdcmTag.h" + +#include +#include +#include + +#include // strcmp + +namespace gdcm { +class StringFilter; + +/** + * \brief StrictScanner2 + * \details This filter is meant for quickly browsing a FileSet (a set of files + * on disk). Special consideration are taken so as to read the minimum amount of + * information in each file in order to retrieve the user specified set of + * DICOM Attribute. + * + * This filter is dealing with both VRASCII and VRBINARY element, thanks to the + * help of StringFilter + * + * \warning IMPORTANT In case of file where tags are not ordered (illegal as + * per DICOM specification), the output will be missing information + * + * \note implementation details. All values are stored in a std::set of + * std::string. Then the address of the cstring underlying the std::string is + * used in the std::map. + * + * This class implement the Subject/Observer pattern trigger the following + * events: \li ProgressEvent \li StartEvent \li EndEvent + */ +class GDCM_EXPORT StrictScanner2 : public Subject { + friend std::ostream &operator<<(std::ostream &_os, const StrictScanner2 &s); + + public: + StrictScanner2() : Values(), Filenames(), PublicMappings(), PrivateMappings() {} + ~StrictScanner2() override; + + /// struct to map a filename to a value + /// Implementation note: + /// all std::map in this class will be using const char * and not std::string + /// since we are pointing to existing std::string (held in a std::vector) + /// this avoid an extra copy of the byte array. + /// Tag are used as Tag class since sizeof(tag) <= sizeof(pointer) + typedef std::map PublicTagToValue; + typedef PublicTagToValue::value_type PublicTagToValueValueType; + + typedef std::map PrivateTagToValue; + typedef PrivateTagToValue::value_type PrivateTagToValueValueType; + + /// Add a tag that will need to be read. Those are root level tags + bool AddPublicTag(Tag const &t); + void ClearPublicTags(); + + // Work in progress do not use: + bool AddPrivateTag(PrivateTag const &pt); + void ClearPrivateTags(); + + /// Add a tag that will need to be skipped. Those are root level skip tags + bool AddSkipTag(Tag const &t); + void ClearSkipTags(); + + /// Start the scan ! + bool Scan(Directory::FilenamesType const &filenames); + + /// Return the list of filenames + Directory::FilenamesType const &GetFilenames() const { return Filenames; } + + /// Print result + void Print(std::ostream &os) const override; + + /// Print result as CSV table + void PrintTable(std::ostream &os, bool header = false) const; + + /// Check if filename is a key in the Mapping table. + /// returns true only of file can be found, which means + /// the file was indeed a DICOM file that could be processed + bool IsKey(const char *filename) const; + + /// Return the list of filename that are key in the internal map, + /// which means those filename were properly parsed + Directory::FilenamesType GetKeys() const; + + // struct to store all the values found: + typedef std::set ValuesType; + + /// Get all the values found (in lexicographic order) + ValuesType const &GetValues() const { return Values; } + + /// Get all the values found (in lexicographic order) associated with Tag 't' + ValuesType GetPublicValues(Tag const &t) const; + + /// Get all the values found (in lexicographic order) associated with + /// PrivateTag 'pt' + ValuesType GetPrivateValues(PrivateTag const &pt) const; + + /// Get all the values found (in a vector) associated with Tag 't' + /// This function is identical to GetValues, but is accessible from the + /// wrapped layer (python, C#, java) + Directory::FilenamesType GetPublicOrderedValues(Tag const &t) const; + + Directory::FilenamesType GetPrivateOrderedValues(PrivateTag const &pt) const; + + /* ltstr is CRITICAL, otherwise pointers value are used to do the key + * comparison */ + struct ltstr { + bool operator()(const char *s1, const char *s2) const { + assert(s1 && s2); + return strcmp(s1, s2) < 0; + } + }; + typedef std::map PublicMappingType; + typedef PublicMappingType::const_iterator PublicConstIterator; + PublicConstIterator Begin() const { return PublicMappings.begin(); } + PublicConstIterator End() const { return PublicMappings.end(); } + + typedef std::map PrivateMappingType; + typedef PrivateMappingType::const_iterator PrivateConstIterator; + PrivateConstIterator PrivateBegin() const { return PrivateMappings.begin(); } + PrivateConstIterator PrivateEnd() const { return PrivateMappings.end(); } + + /// Mappings are the mapping from a particular tag to the map, mapping + /// filename to value: + PublicMappingType const &GetPublicMappings() const { return PublicMappings; } + PrivateMappingType const &GetPrivateMappings() const { + return PrivateMappings; + } + + /// Get the std::map mapping filenames to value for file 'filename' + PublicTagToValue const &GetPublicMapping(const char *filename) const; + PrivateTagToValue const &GetPrivateMapping(const char *filename) const; + + /// Will loop over all files and return the first file where value match the + /// reference value 'valueref' + const char *GetFilenameFromPublicTagToValue(Tag const &t, + const char *valueref) const; + const char *GetFilenameFromPrivateTagToValue(PrivateTag const &pt, + const char *valueref) const; + + /// Will loop over all files and return a vector of std::strings of filenames + /// where value match the reference value 'valueref' + Directory::FilenamesType GetAllFilenamesFromPublicTagToValue( + Tag const &t, const char *valueref) const; + Directory::FilenamesType GetAllFilenamesFromPrivateTagToValue( + PrivateTag const &pt, const char *valueref) const; + + /// See GetFilenameFromTagToValue(). This is simply GetFilenameFromTagToValue + /// followed + // by a call to GetMapping() + PublicTagToValue const &GetMappingFromPublicTagToValue( + Tag const &t, const char *value) const; + PrivateTagToValue const &GetMappingFromPrivateTagToValue( + PrivateTag const &pt, const char *value) const; + + /// Retrieve the value found for tag: t associated with file: filename + /// This is meant for a single short call. If multiple calls (multiple tags) + /// should be done, prefer the GetMapping function, and then reuse the + /// TagToValue hash table. \warning Tag 't' should have been added via + /// AddTag() prior to the Scan() call ! + const char *GetPublicValue(const char *filename, Tag const &t) const; + const char *GetPrivateValue(const char *filename, PrivateTag const &t) const; + + /// for wrapped language: instantiate a reference counted object + static SmartPointer New() { return new StrictScanner2; } + + protected: + void ProcessPublicTag(StringFilter &sf, const char *filename); + void ProcessPrivateTag(StringFilter &sf, const char *filename); + + private: + // struct to store all uniq tags in ascending order: + typedef std::set PublicTagsType; + typedef std::set PrivateTagsType; + std::set PublicTags; // Public and Private Creator + std::set PrivateTags; // Only Private (no Private Creator) + std::set SkipTags; + ValuesType Values; + Directory::FilenamesType Filenames; + + // Main struct that will hold all public mapping: + PublicMappingType PublicMappings; + // Main struct that will hold all private mapping: + PrivateMappingType PrivateMappings; + + double Progress; +}; +//----------------------------------------------------------------------------- +inline std::ostream &operator<<(std::ostream &os, const StrictScanner2 &s) { + s.Print(os); + return os; +} + +} // end namespace gdcm + +#endif // GDCMSTRICTSCANNER2_H diff -Nru gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmTagPath.cxx gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmTagPath.cxx --- gdcm-3.0.10/Source/MediaStorageAndFileFormat/gdcmTagPath.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MediaStorageAndFileFormat/gdcmTagPath.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -120,7 +120,7 @@ pos++; Path.push_back( t ); } - else if( sscanf(path+pos, "%d/", &value) == 1 ) + else if( sscanf(path+pos, "%u/", &value) == 1 ) { } } diff -Nru gdcm-3.0.10/Source/MessageExchangeDefinition/gdcmPresentationDataValue.cxx gdcm-3.0.14/Source/MessageExchangeDefinition/gdcmPresentationDataValue.cxx --- gdcm-3.0.10/Source/MessageExchangeDefinition/gdcmPresentationDataValue.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Source/MessageExchangeDefinition/gdcmPresentationDataValue.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -165,7 +165,7 @@ #if 0 char fn[512]; static int i = 0; - sprintf( fn, "/tmp/debugimp%d", i++ ); + snprintf( fn, sizeof(fn), "/tmp/debugimp%d", i++ ); std::ofstream d( fn, std::ios::binary ); d.write( theEntireBuffer.c_str(), theEntireBuffer.size() ); d.close(); @@ -205,7 +205,7 @@ #if 0 char fn[512]; static int i = 0; - sprintf( fn, "/tmp/debugex%d", i++ ); + snprintf( fn, sizeof(fn), "/tmp/debugex%d", i++ ); std::ofstream d( fn, std::ios::binary ); d.write( theEntireBuffer.c_str(), theEntireBuffer.size() ); d.close(); diff -Nru gdcm-3.0.10/Testing/Source/Common/Cxx/TestMD5.cxx gdcm-3.0.14/Testing/Source/Common/Cxx/TestMD5.cxx --- gdcm-3.0.10/Testing/Source/Common/Cxx/TestMD5.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Common/Cxx/TestMD5.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -223,7 +223,7 @@ { "64528209839b0369c2da530249f4ca58" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" }, { "2498ca4aaf62991c8a1f629a804bfa44" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" }, { "e4d559b6db04679b54bea40c763b09e4" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" }, -{ "58ab110be40303952e05d50e64823192" , "NM-PAL-16-PixRep1.dcm" }, +{ "3d4d7a22442b21477dfc3ba8ac6cac06" , "NM-PAL-16-PixRep1.dcm" }, { "deb7e4ee592efca5d475aaa6fab06459" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" }, { "52f727de4f831ff2bae850fdd8b1413a" , "JPEGInvalidSecondFrag.dcm" }, { "027faefc8031768dad1afc100f7aee27" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" }, @@ -248,6 +248,7 @@ { "5141fe286ad2e39259dac231e3d10b41" , "Bug_Siemens_PrivateIconNoItem.dcm" }, { "3155af485dc3f490cc9e212f95499615" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" }, { "ab93bd11ce0f48e2e9e1c700df160a30" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" }, +{ "8425e60ca4d6745e8a39c437cae25b74" , "MEDILABValidCP246_EVRLESQasOB.dcm" }, { nullptr, nullptr} }; diff -Nru gdcm-3.0.10/Testing/Source/Common/Cxx/TestSHA1.cxx gdcm-3.0.14/Testing/Source/Common/Cxx/TestSHA1.cxx --- gdcm-3.0.10/Testing/Source/Common/Cxx/TestSHA1.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Common/Cxx/TestSHA1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -222,7 +222,7 @@ { "c14634b31dc52e4ed2b0c626aa61af4de207f6e4" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" }, { "bf68f33e0922508d6075f0893298d339d817aa86" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" }, { "6d21ac7b5b4ad32b7d91750a70b574a732b679a7" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" }, -{ "94cadb9e79e0d04f3c212cf6fa069b3cf3f09a76" , "NM-PAL-16-PixRep1.dcm" }, +{ "3bfbd040e8b9a98b294e95cb6f3c06b2a5d8b008" , "NM-PAL-16-PixRep1.dcm" }, { "156463350047cada3ec091396695d3f3ef660c9a" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" }, { "9775e8206011b9d5cedfcba16946060cb047f826" , "JPEGInvalidSecondFrag.dcm" }, { "d17a34f8ae066048442ab5b110d43c412472ea7e" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" }, @@ -245,6 +245,7 @@ { "31f0556c75829dee3850414e166863220f9e03da" , "Bug_Siemens_PrivateIconNoItem.dcm" }, { "129b3cebd15fd1edb55c8fae75976501f2601dce" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" }, { "2ac195a776c8cb9f0e6eb2e297bd2bf37bb11697" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" }, +{ "18463186d3612a04a4338c12c7ac83da69ffaa49" , "MEDILABValidCP246_EVRLESQasOB.dcm" }, { NULL, NULL} }; diff -Nru gdcm-3.0.10/Testing/Source/Data/gdcmMD5DataImages.cxx gdcm-3.0.14/Testing/Source/Data/gdcmMD5DataImages.cxx --- gdcm-3.0.10/Testing/Source/Data/gdcmMD5DataImages.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Data/gdcmMD5DataImages.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -712,6 +712,7 @@ { "b7c6fb507da1b7a3f81f821a2e3eaf49" , "Bug_Siemens_PrivateIconNoItem.dcm" }, { "56238d3665ebdb0251d1161fb7f4edc6" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" }, { "5fe2b8742f05a0ba06d354f965266dbc" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" }, +{ "20b1e4de7b864d44fcd0dda1fc42402c" , "MEDILABValidCP246_EVRLESQasOB.dcm" }, /* Stopping condition */ { nullptr ,nullptr } diff -Nru gdcm-3.0.10/Testing/Source/Data/gdcmMediaStorageDataFiles.cxx gdcm-3.0.14/Testing/Source/Data/gdcmMediaStorageDataFiles.cxx --- gdcm-3.0.10/Testing/Source/Data/gdcmMediaStorageDataFiles.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Data/gdcmMediaStorageDataFiles.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -261,6 +261,7 @@ { "HardcopyColor_YBR_RCT_J2K_PC1.dcm" , "1.2.840.10008.5.1.1.30" }, { "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" , "1.2.840.10008.5.1.4.1.1.128" }, { "PET-GE-dicomwrite-PixelDataSQUNv3.dcm" , "1.2.840.10008.5.1.4.1.1.128" }, +{ "MEDILABValidCP246_EVRLESQasOB.dcm" , "1.2.840.10008.5.1.4.1.1.2" }, /* Stopping condition */ { nullptr ,nullptr } diff -Nru gdcm-3.0.10/Testing/Source/Data/gdcmSelectedPrivateGroupOffsetDataFiles.cxx gdcm-3.0.14/Testing/Source/Data/gdcmSelectedPrivateGroupOffsetDataFiles.cxx --- gdcm-3.0.10/Testing/Source/Data/gdcmSelectedPrivateGroupOffsetDataFiles.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Data/gdcmSelectedPrivateGroupOffsetDataFiles.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -240,6 +240,7 @@ { "Bug_Siemens_PrivateIconNoItem.dcm",1360}, { "HardcopyColor_YBR_RCT_J2K_PC1.dcm",1284}, { "PET-GE-dicomwrite-PixelDataSQUNv2.dcm",4620}, +{ "MEDILABValidCP246_EVRLESQasOB.dcm",1148}, { "dicomdir_With_embedded_icons",7125212 }, { "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 }, { "dicomdir_Acusson_WithPrivate_WithSR",3826 }, diff -Nru gdcm-3.0.10/Testing/Source/Data/gdcmSelectedTagsOffsetDataFiles.cxx gdcm-3.0.14/Testing/Source/Data/gdcmSelectedTagsOffsetDataFiles.cxx --- gdcm-3.0.10/Testing/Source/Data/gdcmSelectedTagsOffsetDataFiles.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Data/gdcmSelectedTagsOffsetDataFiles.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -157,7 +157,7 @@ { "MR_SIEMENS_forceLoad29-1010_29-1020.dcm",60556 }, { "MR_Spectroscopy_SIEMENS_OF.dcm",2102344 }, { "NM-MONO2-16-13x-heart.dcm",1222 }, -{ "NM-PAL-16-PixRep1.dcm",4432 }, +{ "NM-PAL-16-PixRep1.dcm", 4456}, { "NM_Kakadu44_SOTmarkerincons.dcm",1564 }, { "OT-MONO2-8-a7.dcm",430 }, { "OT-PAL-8-face.dcm",1646 }, @@ -242,6 +242,7 @@ { "Bug_Siemens_PrivateIconNoItem.dcm",12966}, { "HardcopyColor_YBR_RCT_J2K_PC1.dcm",2614}, { "PET-GE-dicomwrite-PixelDataSQUNv2.dcm",7706}, +{ "MEDILABValidCP246_EVRLESQasOB.dcm",18996}, { "dicomdir_Acusson_WithPrivate_WithSR",3826 }, { "dicomdir_Pms_WithVisit_WithPrivate_WithStudyComponents",37218 }, { "dicomdir_Pms_With_heavy_embedded_sequence",3003414 }, diff -Nru gdcm-3.0.10/Testing/Source/Data/gdcmStreamOffsetDataFiles.cxx gdcm-3.0.14/Testing/Source/Data/gdcmStreamOffsetDataFiles.cxx --- gdcm-3.0.10/Testing/Source/Data/gdcmStreamOffsetDataFiles.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/Data/gdcmStreamOffsetDataFiles.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -219,7 +219,7 @@ { "TOSHIBA_J2K_SIZ1_PixRep0.dcm", 2362 }, { "TOSHIBA_J2K_OpenJPEGv2Regression.dcm", 2362 }, { "TOSHIBA_J2K_SIZ0_PixRep1.dcm", 2346 }, -{ "NM-PAL-16-PixRep1.dcm", 4444 }, +{ "NM-PAL-16-PixRep1.dcm", 4468 }, { "MEDILABInvalidCP246_EVRLESQasUN.dcm", 19174 }, { "JPEGInvalidSecondFrag.dcm", 4800 }, { "lena512_rot90.j2k.dcm", 768 }, @@ -247,6 +247,7 @@ { "Bug_Siemens_PrivateIconNoItem.dcm",12978 }, { "HardcopyColor_YBR_RCT_J2K_PC1.dcm",2626 }, { "PET-GE-dicomwrite-PixelDataSQUNv2.dcm",7718 }, +{ "MEDILABValidCP246_EVRLESQasOB.dcm",19008 }, /* Stopping condition */ { nullptr ,0 }, diff -Nru gdcm-3.0.10/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPrivateTag.cxx gdcm-3.0.14/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPrivateTag.cxx --- gdcm-3.0.10/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPrivateTag.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestPrivateTag.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -27,6 +27,14 @@ std::cerr << "[" << pt.GetOwner() << "]" << std::endl; return 1; } + gdcm::PrivateTag pt2(0x29,0x1018,"SIEMENS CSA HEADER"); + if( pt != pt2 ) + return 1; + gdcm::PrivateTag pt3(0x29,0x1018,"SIEMENS CXA HEADER"); + if( pt == pt3 ) + return 1; + if( pt3 < pt ) + return 1; const char str[] = "0029,1019,SIEMENS CSA HEADER"; @@ -43,12 +51,30 @@ return 1; } + const char strc[] = "4453,0d,DR Systems, Inc."; + if( !pt.ReadFromCommaSeparatedString( strc ) ) return 1; + + if( pt != gdcm::Tag(0x4453,0x0d) ) + { + std::cerr << pt << std::endl; + return 1; + } + if( pt.GetOwner() != std::string("DR Systems, Inc.") ) + { + std::cerr << "[" << pt.GetOwner() << "]" << std::endl; + return 1; + } + + const gdcm::PrivateTag pt1(0x1,0x2,"BLA"); const char str0[] = ""; const char str1[] = "1,2,BLA"; const char str2[] = "1,65536,BLU"; const char str3[] = "65536,2,BLU"; const char str4[] = "65536,2"; + const char str5[] = "0028,1019,SIEMENS CSA HEADER"; + const char str6[] = "0029,1019,SIEMENS\\CSA HEADER"; + const char str7[] = "0029,1019,SIEMENS\"CSA HEADER"; if( pt.ReadFromCommaSeparatedString( nullptr ) ) { return 1; @@ -77,6 +103,18 @@ { return 1; } + if( pt.ReadFromCommaSeparatedString( str5 ) ) + { + return 1; + } + if( pt.ReadFromCommaSeparatedString( str6 ) ) + { + return 1; + } + if( !pt.ReadFromCommaSeparatedString( str7 ) ) + { + return 1; + } gdcm::PrivateTag null(0x0,0x0,nullptr); if( null.GetOwner() == nullptr ) @@ -97,7 +135,9 @@ ds.Insert(de); // get private tag gdcm::PrivateTag pt0(0x0029, 0x0023, "Titi"); - ds.GetDataElement(pt0); + if(ds.FindDataElement(pt0)) + return 1; + auto de0 = ds.GetDataElement(pt0); } return 0; diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -2,6 +2,7 @@ # MSFF set(MSFF_TEST_SRCS TestAnonymizer.cxx + TestAnonymizer4.cxx TestDataSetHelper.cxx TestEquipmentManufacturer.cxx TestFileChangeTransferSyntax1.cxx @@ -34,6 +35,7 @@ TestFileExplicitFilter.cxx TestImageFragmentSplitter.cxx TestTagPath.cxx + TestDPath.cxx TestOrientation.cxx TestIconImage.cxx TestImageHelper.cxx @@ -106,11 +108,19 @@ if(GDCM_DATA_ROOT) set(MSFF_TEST_SRCS ${MSFF_TEST_SRCS} + TestCleaner1.cxx + TestCleaner2.cxx + TestCleaner3.cxx + TestCleaner4.cxx TestSplitMosaicFilter3.cxx TestStrictScanner1.cxx + TestStrictScanner2_1.cxx TestStrictScanner2.cxx + TestStrictScanner2_2.cxx TestScanner1.cxx + TestScanner2_1.cxx TestScanner2.cxx + TestScanner2_2.cxx TestImageHelper2.cxx TestPrinter2.cxx TestIPPSorter.cxx diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer4.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer4.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer4.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer4.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,109 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmAnonymizer.h" +#include "gdcmReader.h" +#include "gdcmWriter.h" +#include "gdcmTesting.h" +#include "gdcmSystem.h" +#include "gdcmUIDGenerator.h" + +namespace gdcm +{ +static int TestAnonymize(const char *subdir, const char* filename) +{ + Reader reader; + reader.SetFileName( filename ); + if ( !reader.Read() ) + { + return 1; + } + + Anonymizer anonymizer; + anonymizer.SetFile( reader.GetFile() ); + // Setup some actions: + const char empty[] = ""; + const PrivateTag ptag1 = PrivateTag(0x0029,0x20,"SIEMENS MEDCOM HEADER"); + const PrivateTag ptag2 = PrivateTag(0x0029,0x60,"SIEMENS MEDCOM HEADER2"); + const PrivateTag ptag3 = PrivateTag(0x0029,0x10,"SIEMENS CSA HEADER"); + anonymizer.Replace( ptag1 , empty ); + anonymizer.Remove( ptag2 ); + anonymizer.Empty( ptag3 ); + anonymizer.Clear( ptag3 ); + + // Create directory first: + std::string tmpdir = Testing::GetTempDirectory( subdir ); + if( !System::FileIsDirectory( tmpdir.c_str() ) ) + { + System::MakeDirectory( tmpdir.c_str() ); + //return 1; + } + std::string outfilename = Testing::GetTempFilename( filename, subdir ); + + Writer writer; + writer.SetFileName( outfilename.c_str() ); + writer.SetFile( reader.GetFile() ); + writer.SetCheckFileMetaInformation( false ); + if( !writer.Write() ) + { + std::cerr << "Failed to write: " << outfilename << std::endl; + return 1; + } + std::cout << "Success to write: " << outfilename << std::endl; + + // now let's try to read it back in: + Reader reader2; + reader2.SetFileName( outfilename.c_str() ); + if ( !reader2.Read() ) + { + std::cerr << "Could not reread written file: " << outfilename << std::endl; + return 1; + } + + const DataSet & ds = reader.GetFile().GetDataSet(); + //std::cout << ds << std::endl; + + const ByteValue *bv = ds.GetDataElement( ptag2 ).GetByteValue(); + if( !bv ) + { + return 1; + } + if( bv->GetLength() != 0 ) + { + return 1; + } + + return 0; +} +} + +int TestAnonymizer4(int argc, char *argv[]) +{ + if( argc == 2 ) + { + const char *filename = argv[1]; + return gdcm::TestAnonymize(argv[0], filename); + } + + // else + int r = 0, i = 0; + const char *filename; + const char * const *filenames = gdcm::Testing::GetFileNames(); + while( (filename = filenames[i]) ) + { + r += gdcm::TestAnonymize( argv[0], filename ); + ++i; + } + + return r; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestAnonymizer.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -20,7 +20,7 @@ namespace gdcm { -int TestAnonymize(const char *subdir, const char* filename) +static int TestAnonymize(const char *subdir, const char* filename) { Reader reader; reader.SetFileName( filename ); @@ -37,6 +37,7 @@ anonymizer.Replace( pattag , patname ); anonymizer.Remove( Tag(0x0008,0x2112) ); anonymizer.Empty( Tag(0x0008,0x0070) ); + anonymizer.Clear( Tag(0x0010,0x0020) ); UIDGenerator uid; // Those two are very special, since (0008,0016) needs to be propagated to (0002,0002) and // (0008,0018) needs to be propagated to (0002,0003) diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner1.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner1.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner1.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,175 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmCSAHeader.h" +#include "gdcmCleaner.h" +#include "gdcmFilename.h" +#include "gdcmReader.h" +#include "gdcmSmartPointer.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmWriter.h" + +namespace gdcm { +static std::pair ComputeMD5CSADecoded( + const DataSet &ds, const PrivateTag &pt) { + std::pair ret; + CSAHeader csa; + char digest1[33]; + char digest2[33]; + if (ds.FindDataElement(pt)) { + const DataElement &de = ds.GetDataElement(pt); + const ByteValue *bv = de.GetByteValue(); + if (!Testing::ComputeMD5(bv->GetPointer(), bv->GetLength(), digest1)) + return ret; + if (!csa.LoadFromDataElement(de)) return ret; + if (csa.GetFormat() != CSAHeader::SV10) return ret; + std::ostringstream os; + csa.Print(os); + std::string str = os.str(); + if (!Testing::ComputeMD5(str.c_str(), str.size(), digest2)) return ret; + ret.first = digest1; + ret.second = digest2; + } + return ret; +} +} // namespace gdcm + +int TestCleaner1Impl(std::string const &filename, + std::string const &outfilename, bool useDPath) { + using namespace gdcm; + // reference digest of decoded csa: + const std::string ref1 = "ff225133ae107e4e8ee0ba1972016e0c"; + const std::string ref2 = "860bf885643a9a40e6d4bd468f8fd6c4"; + + // first pass + { + Reader reader; + reader.SetFileName(filename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << filename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + const std::string raw1 = "42efe9d2b2611d88039ce76a0d5eeb42"; + const std::string raw2 = "938bbc5c001fb24e37b97dbffbd83ff7"; + + CSAHeader csa; + const PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag(); + const PrivateTag &t2 = csa.GetCSASeriesHeaderInfoTag(); + const std::pair digests1 = + ComputeMD5CSADecoded(ds, t1); + const std::pair digests2 = + ComputeMD5CSADecoded(ds, t2); + if (digests1.first != raw1 || digests2.first != raw2) { + std::cerr << "bogus digest" << std::endl; + return 1; + } + if (digests1.second != ref1 || digests2.second != ref2) { + std::cerr << "bogus digest" << std::endl; + return 1; + } + + // Setup DPath + DPath dpath1, dpath2; + if (!dpath1.ConstructFromString("/0029,10,SIEMENS CSA HEADER") || + !dpath2.ConstructFromString("/0029,20,SIEMENS CSA HEADER")) { + return 1; + } + + Cleaner cleaner; + cleaner.SetFile(file); + if (useDPath) { + if (!cleaner.Scrub(dpath1)) { + return 1; + } + if (!cleaner.Scrub(dpath2)) { + return 1; + } + } else { + if (!cleaner.Scrub(t1)) { + return 1; + } + if (!cleaner.Scrub(t2)) { + return 1; + } + } + if (!cleaner.Clean()) { + return 1; + } + + Writer writer; + writer.SetFileName(outfilename.c_str()); + writer.SetFile(cleaner.GetFile()); + if (!writer.Write()) { + std::cerr << "Failed to write: " << outfilename << std::endl; + return 1; + } + } + + // re-read, written out: + { + Reader reader; + reader.SetFileName(outfilename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << outfilename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + const std::string raw1 = "c712f47d79928578a724f36420342fc1"; + const std::string raw2 = "3a33733b8dc87cb5f80eccf0aeb784f5"; + + CSAHeader csa; + const PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag(); + const PrivateTag &t2 = csa.GetCSASeriesHeaderInfoTag(); + const std::pair digests1 = + ComputeMD5CSADecoded(ds, t1); + const std::pair digests2 = + ComputeMD5CSADecoded(ds, t2); + if (digests1.first != raw1 || digests2.first != raw2) { + std::cerr << "bogus digest" << std::endl; + return 1; + } + if (digests1.second != ref1 || digests2.second != ref2) { + std::cerr << "bogus digest" << std::endl; + return 1; + } + } + return 0; +} + +int TestCleaner1(int, char *[]) { + using namespace gdcm; + const char *directory = gdcm::Testing::GetDataRoot(); + std::string sfilename = std::string(directory) + "/SIEMENS_CSA2.dcm"; + const char *filename = sfilename.c_str(); + + // Create directory first: + const char subdir[] = "TestCleaner1"; + std::string tmpdir = Testing::GetTempDirectory(subdir); + if (!System::FileIsDirectory(tmpdir.c_str())) { + System::MakeDirectory(tmpdir.c_str()); + } + std::string outfilename = Testing::GetTempFilename(filename, subdir); + + int res1 = TestCleaner1Impl(filename, outfilename, true); + int res2 = TestCleaner1Impl(filename, outfilename, false); + + return res1 + res2; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner2.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner2.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner2.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner2.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,174 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmCleaner.h" +#include "gdcmFilename.h" +#include "gdcmReader.h" +#include "gdcmSmartPointer.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmWriter.h" + +namespace gdcm { +static const DataSet &GetNestedDataSet(const DataSet &ds, + const PrivateTag &path) { + const DataElement &de = ds.GetDataElement(path); + SmartPointer sqi = de.GetValueAsSQ(); + assert(sqi && sqi->GetNumberOfItems() == 1); + const Item &item = sqi->GetItem(1); + const DataSet &subds = item.GetNestedDataSet(); + return subds; +} +static bool IsTagIn(const DataSet &ds, const PrivateTag &path, + const PrivateTag &pt) { + const DataSet &subds = GetNestedDataSet(ds, path); + return subds.FindDataElement(pt); +} +static bool IsTagEmpty(const DataSet &ds, const PrivateTag &path, + const PrivateTag &pt) { + const DataSet &subds = GetNestedDataSet(ds, path); + if (!subds.FindDataElement(pt)) return false; + const DataElement &de = subds.GetDataElement(pt); + return de.IsEmpty(); +} +} // namespace gdcm + +int TestCleaner2Impl(std::string const &filename, + std::string const &outfilename, bool useDPath) { + using namespace gdcm; + + // Setup DPath + DPath dpath1, dpath2; + PrivateTag pt1, pt2; + // This attribute is a SQ. make sure we can Empty a SQ: + static const char ref1[] = "0029,e0,SPI-P-Private_ICS Release 1;4"; + static const char ref2[] = "0029,00,SPI-P-Private_ICS Release 1;1"; + if (useDPath) { + if (!dpath1.ConstructFromString(ref1)) { + return 1; + } + if (!dpath2.ConstructFromString(ref2)) { + return 1; + } + } + if (!pt1.ReadFromCommaSeparatedString(ref1)) { + return 1; + } + if (!pt2.ReadFromCommaSeparatedString(ref2)) { + return 1; + } + PrivateTag path1(0x0029, 0xf, "SPI-P-Private_ICS Release 1"); + PrivateTag path2(0x0029, 0xcd, "SPI-P-Private_ICS Release 1;1"); + PrivateTag path3(0x0029, 0x1b, "SPI-P-Private_ICS Release 1"); + PrivateTag path4(0x0029, 0x4c, "SPI-P-Private_ICS Release 1"); + // first pass + { + Reader reader; + reader.SetFileName(filename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << filename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + const bool b0 = IsTagIn(ds, path4, pt1); + + const bool b1 = IsTagIn(ds, path1, pt2); + const DataSet &ds1 = GetNestedDataSet(ds, path1); + const bool b2 = IsTagIn(ds1, path2, pt2); + const bool b3 = IsTagIn(ds, path3, pt2); + const bool b4 = IsTagIn(ds, path4, pt2); + if (!b0 || !b1 || !b2 || !b3 || !b4) { + std::cerr << "Test not setup correctly" << std::endl; + return 1; + } + + Cleaner cleaner; + cleaner.SetFile(file); + cleaner.RemoveAllGroupLength(false); + if (useDPath) { + if (!cleaner.Empty(dpath1)) { + return 1; + } + if (!cleaner.Empty(dpath2)) { + return 1; + } + } else { + if (!cleaner.Empty(pt1)) { + return 1; + } + if (!cleaner.Empty(pt2)) { + return 1; + } + } + if (!cleaner.Clean()) { + return 1; + } + + Writer writer; + writer.SetFileName(outfilename.c_str()); + writer.SetFile(cleaner.GetFile()); + if (!writer.Write()) { + std::cerr << "Failed to write: " << outfilename << std::endl; + return 1; + } + } + + // re-read, written out: + { + Reader reader; + reader.SetFileName(outfilename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << outfilename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + const bool b0 = IsTagEmpty(ds, path4, pt1); + const bool b1 = IsTagEmpty(ds, path1, pt2); + const DataSet &ds1 = GetNestedDataSet(ds, path1); + const bool b2 = IsTagEmpty(ds1, path2, pt2); + const bool b3 = IsTagEmpty(ds, path3, pt2); + const bool b4 = IsTagEmpty(ds, path4, pt2); + if (!b0 || !b1 || !b2 || !b3 || !b4) { + std::cerr << "At least one tag was not empty" << std::endl; + return 1; + } + } + return 0; +} + +int TestCleaner2(int, char *[]) { + using namespace gdcm; + const char *directory = gdcm::Testing::GetDataRoot(); + std::string sfilename = + std::string(directory) + "/PhilipsInteraSeqTermInvLen.dcm"; + const char *filename = sfilename.c_str(); + + // Create directory first: + const char subdir[] = "TestCleaner2"; + std::string tmpdir = Testing::GetTempDirectory(subdir); + if (!System::FileIsDirectory(tmpdir.c_str())) { + System::MakeDirectory(tmpdir.c_str()); + } + std::string outfilename = Testing::GetTempFilename(filename, subdir); + + int res1 = 0; // TestCleaner2Impl(filename, outfilename, true); + int res2 = TestCleaner2Impl(filename, outfilename, false); + + return res1 + res2; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner3.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner3.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner3.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner3.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,167 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmCleaner.h" +#include "gdcmFilename.h" +#include "gdcmReader.h" +#include "gdcmSmartPointer.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmWriter.h" + +namespace gdcm { +static const DataSet &GetNestedDataSet(const DataSet &ds, + const PrivateTag &path) { + const DataElement &de = ds.GetDataElement(path); + SmartPointer sqi = de.GetValueAsSQ(); + assert(sqi && sqi->GetNumberOfItems() == 1); + const Item &item = sqi->GetItem(1); + const DataSet &subds = item.GetNestedDataSet(); + return subds; +} +static bool IsTagIn(const DataSet &ds, const PrivateTag &path, + const PrivateTag &pt) { + const DataSet &subds = GetNestedDataSet(ds, path); + return subds.FindDataElement(pt); +} +} // namespace gdcm + +int TestCleaner3Impl(std::string const &filename, + std::string const &outfilename, bool useDPath) { + using namespace gdcm; + + // Setup DPath + DPath dpath1, dpath2; + PrivateTag pt1, pt2; + // This attribute is a SQ. make sure we can Empty a SQ: + static const char ref1[] = "0029,e0,SPI-P-Private_ICS Release 1;4"; + static const char ref2[] = "0029,00,SPI-P-Private_ICS Release 1;1"; + if (useDPath) { + if (!dpath1.ConstructFromString(ref1)) { + return 1; + } + if (!dpath2.ConstructFromString(ref2)) { + return 1; + } + } + if (!pt1.ReadFromCommaSeparatedString(ref1)) { + return 1; + } + if (!pt2.ReadFromCommaSeparatedString(ref2)) { + return 1; + } + PrivateTag path1(0x0029, 0xf, "SPI-P-Private_ICS Release 1"); + PrivateTag path2(0x0029, 0xcd, "SPI-P-Private_ICS Release 1;1"); + PrivateTag path3(0x0029, 0x1b, "SPI-P-Private_ICS Release 1"); + PrivateTag path4(0x0029, 0x4c, "SPI-P-Private_ICS Release 1"); + // first pass + { + Reader reader; + reader.SetFileName(filename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << filename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + const bool b0 = IsTagIn(ds, path4, pt1); + + const bool b1 = IsTagIn(ds, path1, pt2); + const DataSet &ds1 = GetNestedDataSet(ds, path1); + const bool b2 = IsTagIn(ds1, path2, pt2); + const bool b3 = IsTagIn(ds, path3, pt2); + const bool b4 = IsTagIn(ds, path4, pt2); + if (!b0 || !b1 || !b2 || !b3 || !b4) { + std::cerr << "Test not setup correctly" << std::endl; + return 1; + } + + Cleaner cleaner; + cleaner.SetFile(file); + cleaner.RemoveAllGroupLength(false); + if (useDPath) { + if (!cleaner.Remove(dpath1)) { + return 1; + } + if (!cleaner.Remove(dpath2)) { + return 1; + } + } else { + if (!cleaner.Remove(pt1)) { + return 1; + } + if (!cleaner.Remove(pt2)) { + return 1; + } + } + if (!cleaner.Clean()) { + return 1; + } + + Writer writer; + writer.SetFileName(outfilename.c_str()); + writer.SetFile(cleaner.GetFile()); + if (!writer.Write()) { + std::cerr << "Failed to write: " << outfilename << std::endl; + return 1; + } + } + + // re-read, written out: + { + Reader reader; + reader.SetFileName(outfilename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << outfilename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + const bool b0 = IsTagIn(ds, path4, pt1); + const bool b1 = IsTagIn(ds, path1, pt2); + const DataSet &ds1 = GetNestedDataSet(ds, path1); + const bool b2 = IsTagIn(ds1, path2, pt2); + const bool b3 = IsTagIn(ds, path3, pt2); + const bool b4 = IsTagIn(ds, path4, pt2); + if (b0 || b1 || b2 || b3 || b4) { + std::cerr << "At least one tag was not removed" << std::endl; + return 1; + } + } + return 0; +} + +int TestCleaner3(int, char *[]) { + using namespace gdcm; + const char *directory = gdcm::Testing::GetDataRoot(); + std::string sfilename = + std::string(directory) + "/PhilipsInteraSeqTermInvLen.dcm"; + const char *filename = sfilename.c_str(); + + // Create directory first: + const char subdir[] = "TestCleaner3"; + std::string tmpdir = Testing::GetTempDirectory(subdir); + if (!System::FileIsDirectory(tmpdir.c_str())) { + System::MakeDirectory(tmpdir.c_str()); + } + std::string outfilename = Testing::GetTempFilename(filename, subdir); + + int res1 = 0; // TestCleaner3Impl(filename, outfilename, true); + int res2 = TestCleaner3Impl(filename, outfilename, false); + + return res1 + res2; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestCleaner4.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,375 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmCleaner.h" +#include "gdcmFilename.h" +#include "gdcmReader.h" +#include "gdcmSmartPointer.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmWriter.h" + +namespace gdcm { +template +static const DataSet &GetNestedDataSet(const DataSet &ds, const T &path) { + const DataElement &de = ds.GetDataElement(path); + SmartPointer sqi = de.GetValueAsSQ(); + assert(sqi && sqi->GetNumberOfItems() == 1); + const Item &item = sqi->GetItem(1); + const DataSet &subds = item.GetNestedDataSet(); + return subds; +} +template +static bool IsTagIn(const DataSet &ds, const T &pt) { + return ds.FindDataElement(pt); +} +template +static bool IsTagIn(const DataSet &ds, const T1 &path, const T2 &pt) { + const DataSet &subds = GetNestedDataSet(ds, path); + return subds.FindDataElement(pt); +} +template +static bool IsTagEmpty(const DataSet &ds, const T &pt) { + if (!ds.FindDataElement(pt)) return false; + const DataElement &de = ds.GetDataElement(pt); + return de.IsEmpty(); +} +template +static bool IsTagEmpty(const DataSet &ds, const T1 &path, const T2 &pt) { + const DataSet &subds = GetNestedDataSet(ds, path); + if (!subds.FindDataElement(pt)) return false; + const DataElement &de = subds.GetDataElement(pt); + return de.IsEmpty(); +} +} // namespace gdcm + +struct TestCleaner4Impl { + virtual bool check_before(gdcm::DataSet &ds) = 0; + virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) = 0; + int run(std::string const &filename, std::string const &outfilename, + bool useDPath, bool preservePatientName = false) { + using namespace gdcm; + + // Setup DPath + DPath dpath1, dpath2; + if (useDPath) { + } + // first pass + { + Reader reader; + reader.SetFileName(filename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << filename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + + if (!check_before(ds)) { + std::cerr << "Test not setup correctly" << std::endl; + return 1; + } + + Cleaner cleaner; + cleaner.SetFile(file); + cleaner.RemoveAllGroupLength(false); + if (preservePatientName) { + DPath dpath; + dpath.ConstructFromString("\\0010,0010"); + cleaner.Preserve(dpath); + } + if (useDPath) { + if (!cleaner.Empty(dpath1)) { + return 1; + } + } else { + if (!cleaner.Empty(VR(VR::PN))) { + return 1; + } + } + if (!cleaner.Clean()) { + return 1; + } + + Writer writer; + writer.SetFileName(outfilename.c_str()); + writer.SetFile(cleaner.GetFile()); +#if 0 + gdcm::FileMetaInformation::SetSourceApplicationEntityTitle("gdcmconv"); + file.GetHeader().Clear(); + writer.SetCheckFileMetaInformation(true); +#endif + if (!writer.Write()) { + std::cerr << "Failed to write: " << outfilename << std::endl; + return 1; + } + } + + // re-read, written out: + { + Reader reader; + reader.SetFileName(outfilename.c_str()); + if (!reader.Read()) { + std::cerr << "Could not read: " << outfilename << std::endl; + return 1; + } + + File &file = reader.GetFile(); + DataSet &ds = file.GetDataSet(); + if (!check_after(ds, preservePatientName)) { + std::cerr << "At least one tag was not empty" << std::endl; + return 1; + } + } + return 0; + } +}; + +struct TestCleaner4Impl1 : public TestCleaner4Impl { + virtual bool check_before(gdcm::DataSet &ds) { + const gdcm::Tag t1(0x0008, 0x0090); // + const gdcm::Tag t2(0x0008, 0x1050); // + const gdcm::Tag t3(0x0008, 0x1070); // + const gdcm::Tag t4(0x0010, 0x0010); // + { + const bool b1 = IsTagIn(ds, t1); + const bool b2 = IsTagIn(ds, t2); + const bool b3 = IsTagIn(ds, t3); + const bool b4 = IsTagIn(ds, t4); + if (!b1 || !b2 || !b3 || !b4) { + return false; + } + } + { + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, t4); + if (b1 || b2 || b3 || b4) { + return false; + } + } + return true; + } + virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) { + const gdcm::Tag t1(0x0008, 0x0090); // + const gdcm::Tag t2(0x0008, 0x1050); // + const gdcm::Tag t3(0x0008, 0x1070); // + const gdcm::Tag t4(0x0010, 0x0010); // + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, t4); + + if (!b1 || !b2 || !b3 || !b4) { + return false; + } + return true; + } +}; + +struct TestCleaner4Impl2 : public TestCleaner4Impl { + virtual bool check_before(gdcm::DataSet &ds) { + const gdcm::Tag t1(0x0008, 0x0090); // PN 6 EU^^^^ + const gdcm::Tag t2(0x0008, 0x1050); // PN 4 ^^^^ + const gdcm::Tag t3(0x0008, 0x1060); // PN 16 DR.H.DOOLITTLER + const gdcm::Tag t4(0x0008, 0x1070); // PN 4 CNA + const gdcm::Tag t5(0x0010, 0x0010); // PN 16 ABCDEF^GHIJK^^MR + const gdcm::Tag t6(0x0032, 0x1032); // PN 10 EMERG-UNIT + { + const bool b1 = IsTagIn(ds, t1); + const bool b2 = IsTagIn(ds, t2); + const bool b3 = IsTagIn(ds, t3); + const bool b4 = IsTagIn(ds, t4); + const bool b5 = IsTagIn(ds, t5); + const bool b6 = IsTagIn(ds, t6); + if (!b1 || !b2 || !b3 || !b4 || !b5 || !b6) { + return false; + } + } + { + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, t4); + const bool b5 = IsTagEmpty(ds, t5); + const bool b6 = IsTagEmpty(ds, t6); + if (b1 || b2 || b3 || b4 || b5 || b6) { + return false; + } + } + return true; + } + virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) { + const gdcm::Tag t1(0x0008, 0x0090); // PN 6 EU^^^^ + const gdcm::Tag t2(0x0008, 0x1050); // PN 4 ^^^^ + const gdcm::Tag t3(0x0008, 0x1060); // PN 16 DR.H.DOOLITTLER + const gdcm::Tag t4(0x0008, 0x1070); // PN 4 CNA + const gdcm::Tag t5(0x0010, 0x0010); // PN 16 ABCDEF^GHIJK^^MR + const gdcm::Tag t6(0x0032, 0x1032); // PN 10 EMERG-UNIT + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, t4); + const bool b5 = IsTagEmpty(ds, t5); + const bool b6 = IsTagEmpty(ds, t6); + + if (!b1 || !b2 || !b3 || !b4 || !b5 || !b6) { + return false; + } + return true; + } +}; + +struct TestCleaner4Impl3 : public TestCleaner4Impl { + virtual bool check_before(gdcm::DataSet &ds) { + const gdcm::Tag t1(0x0008, 0x0090); // + const gdcm::Tag t2(0x0008, 0x1070); // + const gdcm::Tag t3(0x0010, 0x0010); // + const gdcm::PrivateTag path1(0x2001, 0x00, "Philips Imaging DD 129"); + const gdcm::Tag t4(0x0070, 0x0084); // + const gdcm::PrivateTag pt5(0x2005, 0x91, "Philips MR Imaging DD 004"); // + { + const bool b1 = IsTagIn(ds, t1); + const bool b2 = IsTagIn(ds, t2); + const bool b3 = IsTagIn(ds, t3); + const bool b4 = IsTagIn(ds, path1, t4); + const bool b5 = IsTagIn(ds, pt5); + if (!b1 || !b2 || !b3 || !b4 || !b5) { + return false; + } + } + { + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, path1, t4); + const bool b5 = IsTagEmpty(ds, pt5); + if (!b1 || !b2 || b3 || b4 || !b5) { + return false; + } + } + return true; + } + virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) { + const gdcm::Tag t1(0x0008, 0x0090); // + const gdcm::Tag t2(0x0008, 0x1070); // + const gdcm::Tag t3(0x0010, 0x0010); // + const gdcm::PrivateTag path1(0x2001, 0x00, "Philips Imaging DD 129"); + const gdcm::Tag t4(0x0070, 0x0084); // + const gdcm::PrivateTag pt5(0x2005, 0x91, "Philips MR Imaging DD 004"); // + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, path1, t4); + const bool b5 = IsTagEmpty(ds, pt5); + + if (!b1 || !b2 || !b3 || !b4 || !b5) { + return false; + } + return true; + } +}; + +struct TestCleaner4Impl4 : public TestCleaner4Impl { + virtual bool check_before(gdcm::DataSet &ds) { + const gdcm::Tag t1(0x0008, 0x0090); // + const gdcm::Tag t2(0x0008, 0x1070); // + const gdcm::Tag t3(0x0010, 0x0010); // + const gdcm::PrivateTag path1(0xe1, 0x39, "ELSCINT1"); + const gdcm::Tag t4(0x0008, 0x0090); // + const gdcm::Tag t5(0x0032, 0x1032); // + { + const bool b1 = IsTagIn(ds, t1); + const bool b2 = IsTagIn(ds, t2); + const bool b3 = IsTagIn(ds, t3); + const bool b4 = IsTagIn(ds, path1, t4); + const bool b5 = IsTagIn(ds, path1, t5); + if (!b1 || !b2 || !b3 || !b4 || !b5) { + return false; + } + } + { + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, path1, t4); + const bool b5 = IsTagEmpty(ds, path1, t5); + if (!b1 || b2 || b3 || !b4 || !b5) { + return false; + } + } + return true; + } + virtual bool check_after(gdcm::DataSet &ds, bool preservePatientName) { + const gdcm::Tag t1(0x0008, 0x0090); // + const gdcm::Tag t2(0x0008, 0x1070); // + const gdcm::Tag t3(0x0010, 0x0010); // + const gdcm::PrivateTag path1(0xe1, 0x39, "ELSCINT1"); + const gdcm::Tag t4(0x0008, 0x0090); // + const gdcm::Tag t5(0x0032, 0x1032); // + const bool b1 = IsTagEmpty(ds, t1); + const bool b2 = IsTagEmpty(ds, t2); + const bool b3 = + preservePatientName ? !IsTagEmpty(ds, t3) : IsTagEmpty(ds, t3); + const bool b4 = IsTagEmpty(ds, path1, t4); + const bool b5 = IsTagEmpty(ds, path1, t5); + + if (!b1 || !b2 || !b3 || !b4 || !b5) { + assert(0); + return false; + } + return true; + } +}; + +int TestCleaner4(int, char *[]) { + using namespace gdcm; + const char *directory = gdcm::Testing::GetDataRoot(); + std::string sfilename1 = + std::string(directory) + "/GE_DLX-8-MONO2-Multiframe.dcm"; // implicit + const char *filename1 = sfilename1.c_str(); + std::string sfilename2 = + std::string(directory) + "/JPEGInvalidSecondFrag.dcm"; // OB => PN + const char *filename2 = sfilename2.c_str(); + std::string sfilename3 = + std::string(directory) + "/undefined_length_un_vr.dcm"; // => nested + const char *filename3 = sfilename3.c_str(); + std::string sfilename4 = + std::string(directory) + "/MAROTECH_CT_JP2Lossy.dcm"; // => nested + const char *filename4 = sfilename4.c_str(); + + // Create directory first: + const char subdir[] = "TestCleaner4"; + std::string tmpdir = Testing::GetTempDirectory(subdir); + if (!System::FileIsDirectory(tmpdir.c_str())) { + System::MakeDirectory(tmpdir.c_str()); + } + std::string outfilename1 = Testing::GetTempFilename(filename1, subdir); + std::string outfilename2 = Testing::GetTempFilename(filename2, subdir); + std::string outfilename3 = Testing::GetTempFilename(filename3, subdir); + std::string outfilename4 = Testing::GetTempFilename(filename4, subdir); + + TestCleaner4Impl1 testCleaner1; + TestCleaner4Impl2 testCleaner2; + TestCleaner4Impl3 testCleaner3; + TestCleaner4Impl4 testCleaner4; + int res1 = testCleaner1.run(filename1, outfilename1, false); + int res2 = testCleaner2.run(filename2, outfilename2, false); + int res3 = testCleaner3.run(filename3, outfilename3, false); + int res4 = testCleaner4.run(filename4, outfilename4, false, false); + int res5 = testCleaner4.run(filename4, outfilename4, false, true); + + return res1 + res2 + res3 + res4 + res5; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDataSetHelper.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDataSetHelper.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDataSetHelper.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDataSetHelper.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -33,6 +33,8 @@ // DX_GE_FALCON_SNOWY-VOI.dcm const PrivateTag pt2(0x0045,0x72,"GEMS_FALCON_03"); const PrivateTag pt3(0x0045,0x73,"GEMS_FALCON_03"); + // MEDILABValidCP246_EVRLESQasOB.dcm + const PrivateTag pt4(0x0029,0x1140,"SIEMENS MEDCOM HEADER"); if( PrivateTag(de.GetTag(),"GEMS_IMAG_01") == pt1 ) { assert( vr == VR::UL ); @@ -46,6 +48,12 @@ assert( vr2 == VR::DS ); return vr; } + if( PrivateTag(de.GetTag(),"SIEMENS MEDCOM HEADER") == pt4 ) + { + assert( vr == VR::OB ); + assert( vr2 == VR::SQ ); + return vr; + } // ELSCINT1_PMSCT_RLE1.dcm if( de.GetTag() == Tag(0x0020,0x0070) ) { diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDPath.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDPath.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDPath.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestDPath.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,132 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmDPath.h" + +int TestDPath(int, char *[]) { + gdcm::DPath tp; + +#if 0 + { + const char path[] = "10,10"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } +#endif + + { + const char path[] = "/0010,0010"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + + { + const char path[] = "/0008,1120/*/0008,1155"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + + // contains a '/' in creator + { + const char path[] = "\\19,0,Siemens: Thorax/Multix FD Lab Settings"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + { + const char path[] = "\\019,0,PHILIPS MR R5.6/PART"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + { + const char path[] = "\\4109,2,Applicare/Centricity Radiology Web/Version 1.0"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + + // contains a ',' in creator + { + const char path[] = "/4453,1000,DR Systems, Inc."; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + + // wildcard '*' in item + { + const char path[] = "/29,2,SIEMENS SYNGO ADVANCED PRESENTATION/*/70,84"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + + // indexed: + { + const char path[] = "/40,100/1/40,6"; + if (!gdcm::DPath::IsValid(path)) { + return 1; + } + if (!tp.ConstructFromString(path)) { + return 1; + } + tp.Print(std::cout); + std::cout << std::endl; + } + + return 0; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestEquipmentManufacturer.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestEquipmentManufacturer.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestEquipmentManufacturer.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestEquipmentManufacturer.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -21,9 +21,10 @@ { if( verbose ) std::cerr << "Reading: " << filename << std::endl; + const gdcm::Tag pixeldata(0x7fe0, 0x0010); gdcm::Reader reader; reader.SetFileName( filename ); - if ( !reader.Read() ) + if (!reader.ReadUpToTag(pixeldata)) { std::cerr << "TestReadError: Failed to read: " << filename << std::endl; return 1; @@ -95,7 +96,7 @@ gdcm::EquipmentManufacturer::Type manufacturer = gdcm::EquipmentManufacturer::Compute( ds ); if( verbose ) { - std::cout << "Found: " << manufacturer << std::endl; + std::cout << "Found: " << gdcm::EquipmentManufacturer::TypeToString(manufacturer) << " -> " << manufacturer << std::endl; } if( manufacturer == gdcm::EquipmentManufacturer::UNKNOWN ) { diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestImageChangeTransferSyntax5.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -19,6 +19,7 @@ #include "gdcmFileMetaInformation.h" #include "gdcmTesting.h" #include "gdcmByteSwap.h" +#include "gdcmImageChangePlanarConfiguration.h" namespace gdcm { @@ -47,6 +48,7 @@ } const gdcm::Image &image = reader.GetImage(); + int pc = image.GetPlanarConfiguration(); gdcm::ImageChangeTransferSyntax change; change.SetTransferSyntax( gdcm::TransferSyntax::JPEGLSLossless ); @@ -89,7 +91,17 @@ } // Check that after decompression we still find the same thing: int res = 0; - const gdcm::Image &img = reader2.GetImage(); + gdcm::Image img = reader2.GetImage(); + // When recompressing: US-RGB-8-epicard.dcm, make sure to compute the md5 using the + // same original Planar Configuration... + if( (int)img.GetPlanarConfiguration() != pc ) + { + gdcm::ImageChangePlanarConfiguration icpc; + icpc.SetInput( reader2.GetImage() ); + icpc.SetPlanarConfiguration( pc ); + icpc.Change(); + img = icpc.GetOutput(); + } //std::cerr << "Success to read image from file: " << filename << std::endl; unsigned long len = img.GetBufferLength(); char* buffer = new char[len]; diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestPrinter1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -188,7 +188,7 @@ { "c2f13224f3f0bc3aa8bbfa6f4a0a23ec" , "rle16loo.dcm" } , { "bd5d9b2f994cfc0c6a95cca8c586533a" , "rle16sti.dcm" } , { "631c5bb2e2f046215999072d13316363" , "SIEMENS-12-Jpeg_Process_2_4-Lossy-a.dcm" } , -{ "d8e82f56fd66b15dc3bd055daa212143" , "SIEMENS_CSA2.dcm" } , +{ "e71384013e91e3a6e6acdb84b9c83a4d" , "SIEMENS_CSA2.dcm" } , { "fa919f3ee7cef3af1f362dd166d53103" , "SIEMENS_GBS_III-16-ACR_NEMA_1.acr" } , { "825580733e8cfaf5d8679348889db40d" , "SIEMENS_GBS_III-16-ACR_NEMA_1-ULis2Bytes.dcm" } , { "ff6bf3c70ef86ca08244317afd7fb98a" , "SIEMENS_ImageLocationUN.dcm" } , @@ -200,9 +200,9 @@ { "1e22b1b3ef16b82cac4299279018282a" , "SIEMENS_MAGNETOM-12-MONO2-GDCM12-VRUN.dcm" } , { "16f02a1ee88f8753978a3dad9a5968ac" , "SIEMENS_MAGNETOM-12-MONO2-Uncompressed.dcm" } , { "bec3be5aaf61c96757095120bc5db29e" , "SIEMENS_MAGNETOM-12-MONO2-VRUN.dcm" } , -{ "37e064a26737be39cfec1fa9078ba920" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" } , +{ "3fb1221855970e4837dccab0d0441ccc" , "SIEMENS_MOSAIC_12BitsStored-16BitsJPEG.dcm" } , { "be0b7098b442990aebf3364d747af482" , "SIEMENS-MR-RGB-16Bits.dcm" } , -{ "a6469a8635a1b08b9642394e8dc6b350" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" } , +{ "433387bd667a1737628f05547d982758" , "SIEMENS_SOMATOM-12-ACR_NEMA-ZeroLengthUs.acr" } , { "5fc4be2074b6186d3993818cd1baeb89" , "SIEMENS_Sonata-12-MONO2-SQ.dcm" } , { "c56ae357244ed3d4203c2b28fe3ab447" , "SIEMENS_Sonata-16-MONO2-Value_Multiplicity.dcm" } , { "7176eb4ec64dab63578eb6826318c87d" , "SignedShortLosslessBug.dcm" } , @@ -229,12 +229,12 @@ { "2940bd46f097f79012d24f47504c3c8c" , "TOSHIBA_J2K_OpenJPEGv2Regression.dcm" }, { "696917fea41e83b9980bad82b609162c" , "TOSHIBA_J2K_SIZ0_PixRep1.dcm" }, { "7ef3da46c43e51cfe2eb82e4d23dd623" , "TOSHIBA_J2K_SIZ1_PixRep0.dcm" }, -{ "5b77abdbd612e78f87efce4a211c3ccb" , "NM-PAL-16-PixRep1.dcm" }, +{ "47d8f59fe43aae50263fef27145cca11" , "NM-PAL-16-PixRep1.dcm" }, { "27ccfa08495b406c9c5e1b686a8b35f9" , "MEDILABInvalidCP246_EVRLESQasUN.dcm" }, -{ "fb202f4c8b4f807031e57dd52b004d06" , "JPEGInvalidSecondFrag.dcm" }, +{ "43620b01e21fdcecb2ff4cbd71f921cc" , "JPEGInvalidSecondFrag.dcm" }, { "2a8649f99c4ada4109b6aa7c52cf1a6a" , "SC16BitsAllocated_8BitsStoredJPEG.dcm" }, { "25cca40808c9ecdaac6316667c77daac" , "SC16BitsAllocated_8BitsStoredJ2K.dcm" }, -{ "98cd51ca2afc715fbfc659b4ba34991b" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" }, +{ "a841fb52502c740d57d187219a906173" , "SIEMENS_SYNGO-12-MONO2-LUTWrongLength512.dcm" }, { "41d1baead629d878d09d6c1037faf47a" , "JPEGNote_empty.dcm" }, { "3cb9917c468226c265ef637aac5f4b61" , "JPEGLS_CharLS_10742.dcm" }, { "8381875d83ce321955a064e40d047dde" , "JPEGLosslessYBR_FULL_422.dcm" }, @@ -242,14 +242,15 @@ { "807bf2aef3bc1885217c8a12d2d2bc19" , "JPEGNote_bogus.dcm" }, { "669cc0e807673ebe57124739a1874f35" , "RLEDebianBug816607Orig.dcm" }, { "1daa9bb53a8ce090041472f528248686" , "IllegalGroup2ImplicitTS.dcm" }, -{ "d8ca0903beb2ed12cf3083a13bd879e6" , "GE_MR_0025xx1bProtocolDataBlockXML.dcm" }, +{ "d08fd49e8bd15a5e66b5578c49441514" , "GE_MR_0025xx1bProtocolDataBlockXML.dcm" }, { "df3327313dadcc29e88779c7bc884abb" , "EmptyIcon_Bug417.dcm" }, { "7d0db54d48964c813d513b472f29155c" , "JPEGLosslessSeNonZero.dcm" }, { "44e6c3eef66b555ec3ae3e6dec6e8157" , "US-YBR_FULL_422-EVRLE.dcm" }, -{ "80deb837f8cfc1edc95f636ef099d431" , "Osirix10vs8BitsStored.dcm" }, +{ "6b8a1f866c39aaccef4185a0923552cd" , "Osirix10vs8BitsStored.dcm" }, { "a638f2bc00e67f35257f36e5d5caa6b0" , "Bug_Siemens_PrivateIconNoItem.dcm" }, { "f64bcbdf9396df3eb3cedd28457042da" , "HardcopyColor_YBR_RCT_J2K_PC1.dcm" }, { "4f9b4e5530f1d60472d85a641105c009" , "PET-GE-dicomwrite-PixelDataSQUNv2.dcm" }, +{ "a7f54f67b6a978813b8ab1a0e2900f30" , "MEDILABValidCP246_EVRLESQasOB.dcm" }, { nullptr ,nullptr } diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_1.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_1.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_1.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,234 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmScanner2.h" +#include "gdcmDirectory.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmTrace.h" + +// dcmdump /path/to/image/*.dcm 2>&/dev/null| grep 0020 | grep "000e\|000d" | sort | uniq +// +// $ find /images/ -type f -exec dcmdump -s +P 0010,0010 {} \; + +static int TestScanner2Extra() +{ + const char *extradataroot = gdcm::Testing::GetDataExtraRoot(); + if( !extradataroot ) + { + return 1; + } + if( !gdcm::System::FileIsDirectory(extradataroot) ) + { + std::cerr << "No such directory: " << extradataroot << std::endl; + return 1; + } + + gdcm::Directory d; + unsigned int nfiles = d.Load( extradataroot, true ); // no recursion + std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl; + + gdcm::Scanner2 s; + const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID + const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID + const gdcm::Tag t3(0x0010,0x0010); // Patient's Name + const gdcm::Tag t4(0x0004,0x5678); // DUMMY element + const gdcm::Tag t5(0x0028,0x0010); // Rows + const gdcm::Tag t6(0x0028,0x0011); // Columns + s.AddPublicTag( t1 ); + s.AddPublicTag( t2 ); + s.AddPublicTag( t3 ); + s.AddPublicTag( t4 ); + s.AddPublicTag( t5 ); + s.AddPublicTag( t6 ); + bool b = s.Scan( d.GetFilenames() ); + if( !b ) + { + std::cerr << "Scanner2 failed" << std::endl; + return 1; + } + //s.Print( std::cout ); + return 0; +} + +int TestScanner2_1(int argc, char *argv[]) +{ + gdcm::Trace::WarningOff(); + gdcm::Trace::ErrorOff(); + const char *directory = gdcm::Testing::GetDataRoot(); + if( argc == 2 ) + { + directory = argv[1]; + } + + if( !gdcm::System::FileIsDirectory(directory) ) + { + std::cerr << "No such directory: " << directory << std::endl; + return 1; + } + + gdcm::Directory d; + unsigned int nfiles = d.Load( directory ); // no recursion +// d.Print( std::cout ); + std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl; + + gdcm::Scanner2 s; + const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID + const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID + const gdcm::Tag t3(0x0010,0x0010); // Patient's Name + const gdcm::Tag t4(0x0004,0x5678); // DUMMY element + const gdcm::Tag t5(0x0028,0x0010); // Rows + const gdcm::Tag t6(0x0028,0x0011); // Columns + const gdcm::Tag t7(0x0008,0x0016); // + s.AddPublicTag( t1 ); + s.AddPublicTag( t2 ); + s.AddPublicTag( t3 ); + s.AddPublicTag( t4 ); + s.AddPublicTag( t5 ); + s.AddPublicTag( t6 ); + s.AddPublicTag( t7 ); + bool b = s.Scan( d.GetFilenames() ); + if( !b ) + { + std::cerr << "Scanner2 failed" << std::endl; + return 1; + } +// s.Print( std::cout ); + + gdcm::Directory::FilenamesType const & files = s.GetFilenames(); + if( files != d.GetFilenames() ) + { + return 1; + } + + int numerrors = 0; + for( gdcm::Directory::FilenamesType::const_iterator it = files.begin(); it != files.end(); ++it ) + { + const char *filename = it->c_str(); + const char* value = s.GetPublicValue(filename, t7); + const char *msstr = gdcm::Testing::GetMediaStorageFromFile(filename); + if( msstr && strcmp(msstr, "1.2.840.10008.1.3.10" ) == 0 ) + { + // would need to check (0002,0002)... + } + if( value && msstr ) + { + if( strcmp( value, msstr ) != 0 ) + { + std::cerr << "Problem with file " << filename << std::endl; + std::cerr << value << "/" << msstr << std::endl; + ++numerrors; + } + } + else + { + if ( !msstr ) + { + std::cerr << "Problem with file " << filename << std::endl; + if( value ) std::cerr << "Value found: " << value << std::endl; + ++numerrors; + } + } + } + + if( numerrors ) + return numerrors; + + // Check dummy filename: + bool iskey = s.IsKey( "gdcm.rocks.invalid.name" ); + if( iskey ) + { + std::cout << "IsKey returned: " << iskey << std::endl; + return 1; + } + + // Let's get the value for tag t1 in first file: + gdcm::Scanner2::PublicMappingType const &mt = s.GetPublicMappings(); + std::string sfilename; + sfilename = gdcm::Testing::GetDataRoot(); + sfilename+= "/test.acr"; +{ + //const char *filename = d.GetFilenames()[0].c_str(); + const char *filename = sfilename.c_str(); + // The following breaks with Papyrus file: PET-cardio-Multiframe-Papyrus.dcm + unsigned int i = 0; + gdcm::Scanner2::PublicMappingType::const_iterator it = mt.find(filename); + assert( it != mt.end() ); + while( it == mt.end() ) + { + ++i; + if( i == d.GetFilenames().size() ) + { + return 1; + } + filename = d.GetFilenames()[i].c_str(); + it = mt.find(filename); + } + std::cout << "Mapping for " << filename << " is :" << std::endl; + const gdcm::Scanner2::PublicTagToValue &tv = it->second; + //const std::string &filename = d.GetFilenames()[0]; + gdcm::Scanner2::PublicTagToValue::const_iterator it2 = tv.find( t5 ); + if( it2 == tv.end() || t5 != it2->first ) + { + std::cerr << "Could not find tag:" << t5 << std::endl; + return 1; + } + const char * t1value = it2->second; + std::cout << filename << " -> " << t1 << " = " << (*t1value ? t1value : "none" ) << std::endl; +} + + const gdcm::Directory::FilenamesType &filenames = d.GetFilenames(); +{ + gdcm::Directory::FilenamesType::const_iterator it = filenames.begin(); + for(; it != filenames.end(); ++it) + { + const char *filename = it->c_str(); + const gdcm::Tag &reftag = t6; + const char *value = s.GetPublicValue( filename, reftag ); + if( value ) + { + assert( value ); + std::cout << filename << " has " << reftag << " = " << value << std::endl; + } + else + { + std::cout << filename << " has " << reftag << " = no value or not DICOM" << std::endl; + } + } +} +/* +{ + std::vector keys = s.GetKeys(); + for( std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) + { + const char *filename = *it; + const gdcm::Directory::FilenamesType::const_iterator it2 + = std::find(filenames.begin(), filenames.end(), filename); + if( it2 == filenames.end() ) + { + return 1; + } + if( !s.IsKey( filename ) ) + { + return 1; + } + } +} +*/ + + // puposely discard gdcmDataExtra test, this is just an 'extra' test... + int b2 = TestScanner2Extra(); (void)b2; + + + return 0; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_2.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_2.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_2.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestScanner2_2.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,69 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmScanner2.h" +#include "gdcmDirectory.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmTrace.h" + +int TestScanner2_2(int argc, char *argv[]) +{ + gdcm::Trace::WarningOff(); + gdcm::Trace::ErrorOff(); + + const char *directory = gdcm::Testing::GetDataRoot(); + if( argc == 2 ) + { + directory = argv[1]; + } + + if( !gdcm::System::FileIsDirectory(directory) ) + { + std::cerr << "No such directory: " << directory << std::endl; + return 1; + } + + gdcm::Directory d; + unsigned int nfiles = d.Load( directory ); // no recursion + std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl; + + gdcm::Scanner2 s; + const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID + s.AddPublicTag( t2 ); + bool b = s.Scan( d.GetFilenames() ); + if( !b ) + { + std::cerr << "Scanner2 failed" << std::endl; + return 1; + } + + gdcm::Directory::FilenamesType const & files = s.GetFilenames(); + if( files != d.GetFilenames() ) + { + return 1; + } + + const char str1[] = "1.3.12.2.1107.5.2.4.7630.20010301125744000008"; + gdcm::Directory::FilenamesType fns = s.GetAllFilenamesFromPublicTagToValue(t2, str1); + + // all SIEMENS_MAGNETOM-12-MONO2-FileSeq*.dcm: + if( fns.size() != 4 ) return 1; + + const char str2[] = "1.3.12.2.1107.5.2.4.7630.2001030112574400000"; + fns = s.GetAllFilenamesFromPublicTagToValue(t2, str2); + + if( !fns.empty() ) return 1; + + return 0; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter2.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter2.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter2.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestSplitMosaicFilter2.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -176,7 +176,13 @@ unsigned int modims[3]; b = filter.ComputeMOSAICDimensions( modims ); - if( b ) return 1; + if( !b ) return 1; + const unsigned int ref0[3] = { 64u, 64u, 36u }; // padded with black + if( modims[0] != ref0[0] || modims[1] != ref0[1] || modims[2] != ref0[2] ) + { + std::cerr << "Invalid ComputeMOSAICDimensions " << filename << std::endl; + return 1; + } // alternate code path: gdcm::PrivateTag t2 (0x0019,0x0a, "SIEMENS MR HEADER"); diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner1.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner1.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner1.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -230,7 +230,7 @@ */ // puposely discard gdcmDataExtra test, this is just an 'extra' test... - int b2 = TestScannerExtra(); (void)b2; + //int b2 = TestScannerExtra(); (void)b2; return 0; diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_1.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_1.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_1.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_1.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,237 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmStrictScanner2.h" +#include "gdcmDirectory.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmTrace.h" + +// dcmdump /path/to/image/*.dcm 2>&/dev/null| grep 0020 | grep "000e\|000d" | sort | uniq +// +// $ find /images/ -type f -exec dcmdump -s +P 0010,0010 {} \; + +static int TestScanner2Extra() +{ + const char *extradataroot = gdcm::Testing::GetDataExtraRoot(); + if( !extradataroot ) + { + return 1; + } + if( !gdcm::System::FileIsDirectory(extradataroot) ) + { + std::cerr << "No such directory: " << extradataroot << std::endl; + return 1; + } + + gdcm::Directory d; + unsigned int nfiles = d.Load( extradataroot, true ); // no recursion + std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl; + + gdcm::StrictScanner2 s; + const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID + const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID + const gdcm::Tag t3(0x0010,0x0010); // Patient's Name + const gdcm::Tag t4(0x0004,0x5678); // DUMMY element + const gdcm::Tag t5(0x0028,0x0010); // Rows + const gdcm::Tag t6(0x0028,0x0011); // Columns + s.AddPublicTag( t1 ); + s.AddPublicTag( t2 ); + s.AddPublicTag( t3 ); + s.AddPublicTag( t4 ); + s.AddPublicTag( t5 ); + s.AddPublicTag( t6 ); + bool b = s.Scan( d.GetFilenames() ); + if( !b ) + { + std::cerr << "Scanner2 failed" << std::endl; + return 1; + } + //s.Print( std::cout ); + return 0; +} + +int TestStrictScanner2_1(int argc, char *argv[]) +{ + gdcm::Trace::WarningOff(); + gdcm::Trace::ErrorOff(); + const char *directory = gdcm::Testing::GetDataRoot(); + std::string tmpdir = gdcm::Testing::GetTempDirectory( "TestWriter" ); + directory = tmpdir.c_str(); + if( argc == 2 ) + { + directory = argv[1]; + } + + if( !gdcm::System::FileIsDirectory(directory) ) + { + std::cerr << "No such directory: " << directory << std::endl; + return 1; + } + + gdcm::Directory d; + unsigned int nfiles = d.Load( directory ); // no recursion +// d.Print( std::cout ); + std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl; + + gdcm::StrictScanner2 s; + const gdcm::Tag t1(0x0020,0x000d); // Study Instance UID + const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID + const gdcm::Tag t3(0x0010,0x0010); // Patient's Name + const gdcm::Tag t4(0x0004,0x5678); // DUMMY element + const gdcm::Tag t5(0x0028,0x0010); // Rows + const gdcm::Tag t6(0x0028,0x0011); // Columns + const gdcm::Tag t7(0x0008,0x0016); // + s.AddPublicTag( t1 ); + s.AddPublicTag( t2 ); + s.AddPublicTag( t3 ); + s.AddPublicTag( t4 ); + s.AddPublicTag( t5 ); + s.AddPublicTag( t6 ); + s.AddPublicTag( t7 ); + bool b = s.Scan( d.GetFilenames() ); + if( !b ) + { + std::cerr << "Scanner2 failed" << std::endl; + return 1; + } +// s.Print( std::cout ); + + gdcm::Directory::FilenamesType const & files = s.GetFilenames(); + if( files != d.GetFilenames() ) + { + return 1; + } + + int numerrors = 0; + for( gdcm::Directory::FilenamesType::const_iterator it = files.begin(); it != files.end(); ++it ) + { + const char *filename = it->c_str(); + const char* value = s.GetPublicValue(filename, t7); + const char *msstr = gdcm::Testing::GetMediaStorageFromFile(filename); + if( msstr && strcmp(msstr, "1.2.840.10008.1.3.10" ) == 0 ) + { + // would need to check (0002,0002)... + } + if( value && msstr ) + { + if( strcmp( value, msstr ) != 0 ) + { + std::cerr << "Problem with file " << filename << std::endl; + std::cerr << value << "/" << msstr << std::endl; + ++numerrors; + } + } + else + { + if ( !msstr ) + { + std::cerr << "Problem with file " << filename << std::endl; + if( value ) std::cerr << "Value found: " << value << std::endl; + ++numerrors; + } + } + } + + if( numerrors ) + return numerrors; + + // Check dummy filename: + bool iskey = s.IsKey( "gdcm.rocks.invalid.name" ); + if( iskey ) + { + std::cout << "IsKey returned: " << iskey << std::endl; + return 1; + } + + // Let's get the value for tag t1 in first file: + gdcm::StrictScanner2::PublicMappingType const &mt = s.GetPublicMappings(); + std::string sfilename; + sfilename = gdcm::Testing::GetDataRoot(); + sfilename = directory; + sfilename+= "/test.acr"; +{ + //const char *filename = d.GetFilenames()[0].c_str(); + const char *filename = sfilename.c_str(); + // The following breaks with Papyrus file: PET-cardio-Multiframe-Papyrus.dcm + unsigned int i = 0; + gdcm::StrictScanner2::PublicMappingType::const_iterator it = mt.find(filename); + assert( it != mt.end() ); + while( it == mt.end() ) + { + ++i; + if( i == d.GetFilenames().size() ) + { + return 1; + } + filename = d.GetFilenames()[i].c_str(); + it = mt.find(filename); + } + std::cout << "Mapping for " << filename << " is :" << std::endl; + const gdcm::StrictScanner2::PublicTagToValue &tv = it->second; + //const std::string &filename = d.GetFilenames()[0]; + gdcm::StrictScanner2::PublicTagToValue::const_iterator it2 = tv.find( t5 ); + if( it2 == tv.end() || t5 != it2->first ) + { + std::cerr << "Could not find tag:" << t5 << std::endl; + return 1; + } + const char * t1value = it2->second; + std::cout << filename << " -> " << t1 << " = " << (*t1value ? t1value : "none" ) << std::endl; +} + + const gdcm::Directory::FilenamesType &filenames = d.GetFilenames(); +{ + gdcm::Directory::FilenamesType::const_iterator it = filenames.begin(); + for(; it != filenames.end(); ++it) + { + const char *filename = it->c_str(); + const gdcm::Tag &reftag = t6; + const char *value = s.GetPublicValue( filename, reftag ); + if( value ) + { + assert( value ); + std::cout << filename << " has " << reftag << " = " << value << std::endl; + } + else + { + std::cout << filename << " has " << reftag << " = no value or not DICOM" << std::endl; + } + } +} +/* +{ + std::vector keys = s.GetKeys(); + for( std::vector::const_iterator it = keys.begin(); it != keys.end(); ++it) + { + const char *filename = *it; + const gdcm::Directory::FilenamesType::const_iterator it2 + = std::find(filenames.begin(), filenames.end(), filename); + if( it2 == filenames.end() ) + { + return 1; + } + if( !s.IsKey( filename ) ) + { + return 1; + } + } +} +*/ + + // puposely discard gdcmDataExtra test, this is just an 'extra' test... + //int b2 = TestScanner2Extra(); (void)b2; + + + return 0; +} diff -Nru gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_2.cxx gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_2.cxx --- gdcm-3.0.10/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_2.cxx 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Testing/Source/MediaStorageAndFileFormat/Cxx/TestStrictScanner2_2.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,70 @@ +/*========================================================================= + + Program: GDCM (Grassroots DICOM). A DICOM library + + Copyright (c) 2006-2011 Mathieu Malaterre + All rights reserved. + See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +#include "gdcmStrictScanner2.h" +#include "gdcmDirectory.h" +#include "gdcmSystem.h" +#include "gdcmTesting.h" +#include "gdcmTrace.h" + +int TestStrictScanner2_2(int argc, char *argv[]) +{ + gdcm::Trace::WarningOff(); + gdcm::Trace::ErrorOff(); + const char *directory = gdcm::Testing::GetDataRoot(); + std::string tmpdir = gdcm::Testing::GetTempDirectory( "TestWriter" ); + directory = tmpdir.c_str(); + if( argc == 2 ) + { + directory = argv[1]; + } + + if( !gdcm::System::FileIsDirectory(directory) ) + { + std::cerr << "No such directory: " << directory << std::endl; + return 1; + } + + gdcm::Directory d; + unsigned int nfiles = d.Load( directory ); // no recursion + std::cout << "done retrieving file list. " << nfiles << " files found." << std::endl; + + gdcm::StrictScanner2 s; + const gdcm::Tag t2(0x0020,0x000e); // Series Instance UID + s.AddPublicTag( t2 ); + bool b = s.Scan( d.GetFilenames() ); + if( !b ) + { + std::cerr << "Scanner2 failed" << std::endl; + return 1; + } + + gdcm::Directory::FilenamesType const & files = s.GetFilenames(); + if( files != d.GetFilenames() ) + { + return 1; + } + + const char str1[] = "1.3.12.2.1107.5.2.4.7630.20010301125744000008"; + gdcm::Directory::FilenamesType fns = s.GetAllFilenamesFromPublicTagToValue(t2, str1); + + // all SIEMENS_MAGNETOM-12-MONO2-FileSeq*.dcm: + if( fns.size() != 4 ) return 1; + + const char str2[] = "1.3.12.2.1107.5.2.4.7630.2001030112574400000"; + fns = s.GetAllFilenamesFromPublicTagToValue(t2, str2); + + if( !fns.empty() ) return 1; + + return 0; +} diff -Nru gdcm-3.0.10/Utilities/doxygen/CMakeLists.txt gdcm-3.0.14/Utilities/doxygen/CMakeLists.txt --- gdcm-3.0.10/Utilities/doxygen/CMakeLists.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/CMakeLists.txt 2022-06-24 07:37:44.000000000 +0000 @@ -232,6 +232,7 @@ gdcm2pnm gdcm2vtk gdcmanon + gdcmclean gdcmconv gdcmdiff gdcmdump diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmanon.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmanon.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmanon.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmanon.xml 2022-06-24 07:37:44.000000000 +0000 @@ -107,9 +107,15 @@ dumb mode options - --empty %d,%d DICOM tag(s) to empty + + --empty %d,%d DICOM tag(s) to empty + %d,%d,%s DICOM private tag(s) to empty + --clear %d,%d DICOM tag(s) to clear + %d,%d,%s DICOM private tag(s) to clear --remove %d,%d DICOM tag(s) to remove - --replace %d,%d,%s DICOM tag(s) to replace + %d,%d,%s DICOM private tag(s) to remove + --replace %d,%d=%s DICOM tag(s) to replace + %d,%d,%s=%s DICOM private tag(s) to replace @@ -179,7 +185,7 @@ Empty the tag (0010,0010) Patient's Name, -Empty the tag (0010,0020) Patient ID, +Clear the tag (0010,0020) Patient ID, Remove the tag (0010,0040) Patient's Sex @@ -191,11 +197,14 @@ Replace the tag (0010,1030) Patient's Weight with the value '10' -You are required to check which DICOM attribute is Type 1 and Type 1C, before trying to 'Empty' or 'Remove' a particular DICOM attribute. For the same reason, you are required to check what are valid value in a replace operation. +You are required to check which DICOM attribute is Type 1 and Type 1C, before trying to 'Empty','Clear' or 'Remove' a particular DICOM attribute. For the same reason, you are required to check what are valid value in a replace operation. -$ gdcmanon --dumb --empty 10,10 --empty 10,20 --remove 10,40 --remove 10,1010 --replace 10,1030,10 012345.002.050.dcm out.dcm +$ gdcmanon --dumb --empty 10,10 --clear 10,20 --remove 10,40 --remove 10,1010 --replace 10,1030,10 012345.002.050.dcm out.dcm +In the following example a private tag (0029,20,SIEMENS MEDCOM HEADER) is cleared out (made empty only when present): +$ gdcmanon --dumb --clear "0029,20,SIEMENS MEDCOM HEADER" input.dcm output.dcm + Multiple operation of –dumb mode can take place, just reuse the output of the previous operation. Always use gdcmdump on the input and output file to check what was actually achieved. You can use a diff program to check only what changed (see gdcmdiff(1) for example). Irreversible Anonymization @@ -224,7 +233,7 @@ Remarks: -As mentionned in DICOM Sup 142, this anonymization is preferred over de-identification since: It is not required that the Encrypted Attributes Data Set be created; indeed, there may be circumstances where the Dataset is expected to be archived long enough that any contemporary encryption technology may be inadequate to provide long term protection against unauthorized recovery of identification +As mentioned in DICOM Sup 142, this anonymization is preferred over de-identification since: It is not required that the Encrypted Attributes Data Set be created; indeed, there may be circumstances where the Dataset is expected to be archived long enough that any contemporary encryption technology may be inadequate to provide long term protection against unauthorized recovery of identification diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmclean.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmclean.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmclean.xml 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmclean.xml 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,158 @@ + + + ]> + + +MathieuMalaterreMain developer +20062011Mathieu Malaterre + + + gdcmclean + 1 + GDCM + &version; + DICOM Manipulation. + + gdcmclean + Tool to clean a DICOM file. + + +SYNOPSIS + +gdcmclean [options] file-in file-out +gdcmclean [options] dir-in dir-out + + + +DESCRIPTION + +The gdcmclean tool is an cleaning tool. + + + +PARAMETERS + +file-in DICOM input filename + +file-out DICOM output filename + + +or + +file-in DICOM input directory + +file-out DICOM output directory + + + +OPTIONS + +You need to : + +specific options + + -i --input DICOM filename / directory + -o --output DICOM filename / directory + -r --recursive recursively process (sub-)directories. + --continue Do not stop when file found is not DICOM. + + + +Editing mode options + + --empty %d,%d DICOM tag(s) to empty + %d,%d,%s DICOM private tag(s) to empty + %s DICOM keyword/path(s) to empty + --remove %d,%d DICOM tag(s) to remove + %d,%d,%s DICOM private tag(s) to remove + %s DICOM keyword/path(s) to remove + --scrub %d,%d DICOM tag(s) to scrub + %d,%d,%s DICOM private tag(s) to scrub + %s DICOM keyword/path(s) to scrub + --preserve %s DICOM path(s) to preserve + --preserve-missing-private-creator Whether or not preserve private attributes with missing private creator. + --preserve-group-length Whether or not preserve deprecated group length attributes (will not be re-computed). + --preserve-illegal Whether or not preserve illegal attributes (eg. group 0003...). + + + +general options + + -h --help + print this help text and exit + + -v --version + print version information and exit + + -V --verbose + verbose mode (warning+error). + + -W --warning + warning mode, print warning information + + -E --error + error mode, print error information + + -D --debug + debug mode, print debug information + + + + +Typical usage + +Editing mode + +This functionality is not described in the DICOM standard. + +The following example shows how to use editing mode and achieve multiple operations at the same time: + +Preserve illegal attributes (removed by default), + + +Empty any 'PN' attributes anywhere in the hierarchy tree, but preserve the DICOM attribute value only at location "0010,0010", + + +Empty the tag (0010,0020) Patient ID, (only if keyword is know internally), + + +Empty the tag (0070,0084), + + +Remove the private attributes: (0029,20, SIEMENS MEDCOM HEADER) / (0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1.0) / (0043,2a,GEMS_PARM_01). Since (0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1.0) is defined internally in the private dictionary with Value Representation = PN, this attribute will be skipped (since redundant). + + +Scrub the private attributes: (0029,10,SIEMENS CSA HEADER) / (0029,20,SIEMENS CSA HEADER) + + + +$ gdcmclean \ + --recursive --continue \ + --preserve-illegal \ + --empty PN --preserve /0010,0010 \ + --empty PatientID --empty "0070,0084" \ + --remove "0029,20,SIEMENS MEDCOM HEADER" --remove "0033,02,MITRA OBJECT UTF8 ATTRIBUTES 1.0" --remove "0043,2a,GEMS_PARM_01" \ + --scrub "0029,10,SIEMENS CSA HEADER" --scrub "0029,20,SIEMENS CSA HEADER" \ + input_folder output_folder + + + +DICOM Path + +For ease of use on shell cmmand the syntax allow for the '/' separator in the DICOM Path notation. So the following is valid +"/0040,0100/1/0040,0006" +However Private Creator can use all of Value Representation LO definition. So in some case you will be required to use backslash as separator (since illegal in VR:LO): +"\\4109,2,Applicare/Centricity Radiology Web/Version 1.0" + + +Safe Private Attributes +It is currently not possible to empty/remove any private attribute listed in the Safe Private Attributes table at: +https://dicom.nema.org/medical/dicom/current/output/chtml/part15/sect_E.3.10.html#table_E.3.10-1 + + + +SEE ALSO + +gdcmanon(1), gdcmdump(1), gdcmdiff(1) + + diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmconv.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmconv.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmconv.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmconv.xml 2022-06-24 07:37:44.000000000 +0000 @@ -72,7 +72,7 @@ -F --force Force decompression/merging before recompression/splitting. --generate-icon Generate icon. --icon-minmax %d,%d Min/Max value for icon. - --icon-auto-minmax Automatically commpute best Min/Max values for icon. + --icon-auto-minmax Automatically compute best Min/Max values for icon. --compress-icon Decide whether icon follows main TransferSyntax or remains uncompressed. --planar-configuration [01] Change planar configuration. -Y --lossy Use the lossy (if possible) compressor. diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmdump.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmdump.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmdump.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmdump.xml 2022-06-24 07:37:44.000000000 +0000 @@ -54,7 +54,7 @@ --csa-asl print decoded SIEMENS CSA MR_ASL (base64). --csa-diffusion print decoded SIEMENS CSA MRDiffusion (base64). --mrprotocol print SIEMENS MrProtocol only (within ASCCONV BEGIN/END). - either encapsulated in CSA or directly (syngo XA10) + or Phoenix Meta Protocol (0021,19,SIEMENS MR SDS 01). -P --pdb print GEMS Protocol Data Block (0025,1b,GEMS_SERS_01). --elscint print ELSCINT Protocol Information (01f7,26,ELSCINT1). --vepro print VEPRO Protocol Information (0055,20,VEPRO VIF 3.0 DATA). @@ -63,6 +63,7 @@ --ct3 print CT Private Data 2 (7005,10,TOSHIBA_MEC_CT3). --pmtf print PMTF INFORMATION DATA sub-sequences (0029,01,PMTF INFORMATION DATA). --mecmr3 print TOSHIBA_MEC_MR3 sub-sequences (0029,01,TOSHIBA_MEC_MR3). + --medcom print MedCom History Information as UTF-8 (0029,20,SIEMENS MEDCOM HEADER). -A --asn1 print encapsulated ASN1 structure >(0400,0520). --map-uid-names map UID to names. diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmimg.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmimg.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmimg.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmimg.xml 2022-06-24 07:37:44.000000000 +0000 @@ -235,7 +235,7 @@ $ gdcmimg --sign 1 --template template.dcm input.jpg output.dcm -Pay attention that any values from template.dcm that are not consistent with what is found inside the reference image will be overriden (eg. image size). On particular case should be of concern: the Pixel Representation for the JPEG family. +Pay attention that any values from template.dcm that are not consistent with what is found inside the reference image will be overridden (eg. image size). On particular case should be of concern: the Pixel Representation for the JPEG family. diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmscanner.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmscanner.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmscanner.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmscanner.xml 2022-06-24 07:37:44.000000000 +0000 @@ -77,6 +77,12 @@ $ gdcmscanner -t 10,10 -d gdcmData -p + +For private tag simply do: + +$ gdcmscanner -P "0029,60,SIEMENS MEDCOM HEADER2" -d gdcmData -p + + Table usage diff -Nru gdcm-3.0.10/Utilities/doxygen/man/gdcmscu.xml gdcm-3.0.14/Utilities/doxygen/man/gdcmscu.xml --- gdcm-3.0.10/Utilities/doxygen/man/gdcmscu.xml 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/doxygen/man/gdcmscu.xml 2022-06-24 07:37:44.000000000 +0000 @@ -148,7 +148,7 @@ $ gdcmscu --echo dicom.example.com 11112 --call SERVSCP -If you want to specifiy your own AE-TITLE (default is GDCMSCU), simply use: +If you want to specify your own AE-TITLE (default is GDCMSCU), simply use: $ gdcmscu --echo dicom.example.com 11112 --call SERVSCP --aetitle MYSCU diff -Nru gdcm-3.0.10/Utilities/gdcmcsa/csa.c gdcm-3.0.14/Utilities/gdcmcsa/csa.c --- gdcm-3.0.10/Utilities/gdcmcsa/csa.c 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Utilities/gdcmcsa/csa.c 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,288 @@ +#include +#include +#include +#include +#include /* realloc */ +#include /* memcpy */ + +struct stream { + const void *start; + const void *end; + void *cur; + size_t (*read)(void *ptr, size_t size, size_t nmemb, struct stream *in); + size_t (*write)(const void *ptr, size_t size, size_t nmemb, + struct stream *outstream); +}; + +static size_t stream_read(void *ptr, size_t size, size_t nmemb, + struct stream *in) { + char *cur = (char *)in->cur; + const char *end = (const char *)in->end; + const size_t len = size * nmemb; + if (cur + len <= end) { + memcpy(ptr, cur, len); + in->cur = cur + len; + } else { + in->cur = NULL; + return 0; + } + return nmemb; +} + +static size_t stream_write(const void *ptr, size_t size, size_t nmemb, + struct stream *out) { + char *cur = (char *)out->cur; + const char *end = (const char *)out->end; + const size_t len = size * nmemb; + if (cur + len <= end) { + memcpy(cur, ptr, len); + out->cur = cur + len; + } else { + out->cur = NULL; + return 0; + } + return nmemb; +} + +enum CSA_TYPE { INVALID = 0, NOMAGIC = 1, SV10 = 2 }; + +struct app { + struct stream *in; + struct stream *out; + uint32_t nelements; + enum CSA_TYPE csa_type; +}; + +static struct app *create_app(struct app *self, struct stream *in, + struct stream *out) { + self->in = in; + self->out = out; + self->nelements = 0; + self->csa_type = INVALID; + + return self; +} + +static void setup_buffer(struct app *self, void *output, const void *input, + size_t len) { + self->in->cur = (char *)input; + self->in->start = input; + self->in->end = (char *)input + len; + self->in->read = stream_read; + self->out->cur = output; + self->out->start = output; + self->out->end = (char *)output + len; + self->out->write = stream_write; +} + +#define ERROR_RETURN(X, Y) \ + if (X != Y) return false + +static size_t fread_mirror(void *ptr, size_t size, size_t nmemb, + struct app *self) { + struct stream *instream = self->in; + struct stream *outstream = self->out; + + size_t s = instream->read(ptr, size, nmemb, instream); + if (s == nmemb) { + s = outstream->write(ptr, size, nmemb, outstream); + if (s == nmemb) return nmemb; + } + return 0; +} + +static size_t fread_mirror_clean(void *ptr, size_t size, size_t nmemb, + struct app *self) { + struct stream *instream = self->in; + struct stream *outstream = self->out; + + if (nmemb != 64) return 0; + size_t s = instream->read(ptr, size, nmemb, instream); + if (s == nmemb) { + char *str = (char *)ptr; + const size_t len = strnlen(str, nmemb); + assert(len < nmemb); + size_t i; + for (i = len; i < nmemb; ++i) { + str[i] = 0; + } + s = outstream->write(ptr, size, nmemb, outstream); + if (s == nmemb) return nmemb; + } + return 0; +} + +static bool read_magic(struct app *self) { + enum CSA_TYPE magic = INVALID; + uint32_t n; + size_t s = fread_mirror(&n, sizeof n, 1, self); + ERROR_RETURN(s, 1); + uint32_t unused; + s = fread_mirror(&unused, sizeof unused, 1, self); + ERROR_RETURN(s, 1); + + // Handle very special case hopefully no conflict with case of no-magic + if (n == 0x30315653 && unused == 0x01020304) { // aka 'SV10' + s = fread_mirror(&n, sizeof n, 1, self); + ERROR_RETURN(s, 1); + s = fread_mirror(&unused, sizeof unused, 1, self); + ERROR_RETURN(s, 1); + magic = SV10; + } else if (n < 0x100 && unused == 0x4d) { // 'M' + magic = NOMAGIC; + } else if (n == 0x7364703c && unused == 0x6f633c3e) // aka 'nelements = n; + self->csa_type = magic; + return true; +} + +static bool write_trailer(struct app *self) { + size_t s; + // trailing byte in SV10 + if (self->csa_type == SV10) { + uint32_t unused; + s = fread_mirror(&unused, sizeof unused, 1, self); + ERROR_RETURN(s, 1); + } else if (self->csa_type == NOMAGIC) { + // no magic + uint32_t i; + for (i = 0; i < 28u; ++i) { + uint32_t unused; + s = fread_mirror(&unused, sizeof unused, 1, self); + ERROR_RETURN(s, 1); + } + } else { + assert(0); + return false; + } + return true; +} + +struct csa_info { + char name[64]; + uint32_t vm; + char vr[4]; + int32_t syngodt; + uint32_t nitems; +}; + +struct csa_item_data { + uint32_t len; + char *buffer; +}; + +static bool read_info(struct app *self, struct csa_info *i) { + // name. This is 64bytes string. It is assumed that there will be a trailing + // \0 + size_t s = fread_mirror_clean(i->name, sizeof *i->name, + sizeof i->name / sizeof *i->name, self); + ERROR_RETURN(s, 64); + // vm + s = fread_mirror(&i->vm, sizeof i->vm, 1, self); + ERROR_RETURN(s, 1); + // vm == 115301884 seems to be ok... + assert(i->vm < 0x6df5dfd); + // vr + s = fread_mirror(i->vr, sizeof *i->vr, sizeof i->vr / sizeof *i->vr, self); + ERROR_RETURN(s, 4); + // syngodt (signed) + s = fread_mirror(&i->syngodt, sizeof i->syngodt, 1, self); + ERROR_RETURN(s, 1); + // numer of items + s = fread_mirror(&i->nitems, sizeof i->nitems, 1, self); + ERROR_RETURN(s, 1); + { + uint32_t unused; + s = fread_mirror(&unused, sizeof unused, 1, self); + ERROR_RETURN(s, 1); + } + + return true; +} + +static bool read_data(struct app *self, struct csa_item_data *d) { + size_t s = fread_mirror(&d->len, sizeof d->len, 1, self); + ERROR_RETURN(s, 1); + int j; + for (j = 0; j < 3; j++) { + uint32_t unused; + s = fread_mirror(&unused, sizeof unused, 1, self); + ERROR_RETURN(s, 1); + } + + if (d->len != 0) { + const uint32_t padding_len = (4 - d->len % 4) % 4; + const uint32_t padded_len = ((d->len + 3u) / 4u) * 4u; // (len + 3) & ~0x03 + assert(padded_len == d->len + padding_len); // programmer error + d->buffer = (char *)realloc(d->buffer, padded_len); + s = fread_mirror(d->buffer, sizeof *d->buffer, padded_len, self); + ERROR_RETURN(s, padded_len); + } + + return true; +} + +#undef ERROR_RETURN + +static bool csa_scrub(void *output, const void *input, size_t len) { + if (!input || !output) return false; + struct stream sin; + struct stream sout; + struct app a; + struct app *self = create_app(&a, &sin, &sout); + setup_buffer(self, output, input, len); + if (!read_magic(self)) return false; + + bool good = true; + struct csa_info info; + struct csa_item_data data; + data.len = 0; + data.buffer = NULL; + uint32_t element; + for (element = 0; good && element < self->nelements; ++element) { + // read csa key info + if (!read_info(self, &info)) { + good = false; + break; + } + // read all csa item data: + uint32_t item; + for (item = 0; good && item < info.nitems; ++item) { + if (!read_data(self, &data)) { + good = false; + break; + } + } // end for items + } + // release memory: + free(data.buffer); + if (!good) return false; + + // write trailer: + if (!write_trailer(self)) { + return false; + } + + // make sure the whole input was processed: + assert(self->in->cur <= self->in->end); + if (self->in->cur < self->in->end) { + return false; + } + assert(self->out->cur == self->out->end); // programmer error + return true; +} + +void *csa_memcpy(void *dest, const void *src, size_t n) { + const bool b = csa_scrub(dest, src, n); + return b ? dest : NULL; +} diff -Nru gdcm-3.0.10/Utilities/gdcmcsa/csa.h gdcm-3.0.14/Utilities/gdcmcsa/csa.h --- gdcm-3.0.10/Utilities/gdcmcsa/csa.h 1970-01-01 00:00:00.000000000 +0000 +++ gdcm-3.0.14/Utilities/gdcmcsa/csa.h 2022-06-24 07:37:44.000000000 +0000 @@ -0,0 +1,9 @@ +#ifdef __cplusplus +extern "C" { +#endif + +void *csa_memcpy(void *dest, const void *src, size_t n); + +#ifdef __cplusplus +} /* end extern "C" */ +#endif diff -Nru gdcm-3.0.10/Utilities/gdcmmd5/md5.c gdcm-3.0.14/Utilities/gdcmmd5/md5.c --- gdcm-3.0.10/Utilities/gdcmmd5/md5.c 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/gdcmmd5/md5.c 2022-06-24 07:37:44.000000000 +0000 @@ -1,3 +1,18 @@ +#include /* size_t */ +#include /* uintptr_t */ +#include /* malloc, free */ +#include /* memcpy, strlen */ + +/* This MD5 implementation has been taken from a third party. Slight + modifications to the arrangement of the code have been made to put + it in a single source file instead of a separate header and + implementation file. */ + +#if defined(__clang__) && !defined(__INTEL_COMPILER) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wcast-align" +#endif + /* Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved. @@ -21,13 +36,12 @@ ghost@aladdin.com */ -/* $Id: md5.c,v 1.6 2002/04/13 19:20:28 lpd Exp $ */ /* Independent implementation of MD5 (RFC 1321). This code implements the MD5 Algorithm defined in RFC 1321, whose text is available at - http://www.ietf.org/rfc/rfc1321.txt + http://www.ietf.org/rfc/rfc1321.txt The code is derived from the text of the RFC, including the test suite (section A.5) but excluding the rest of Appendix A. It does not include any code or documentation that is identified in the RFC as being @@ -38,14 +52,14 @@ that follows (in reverse chronological order): 2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order - either statically or dynamically; added missing #include - in library. + either statically or dynamically; added missing #include + in library. 2002-03-11 lpd Corrected argument list for main(), and added int return - type, in test program and T value program. + type, in test program and T value program. 2002-02-21 lpd Added missing #include in test program. 2000-07-03 lpd Patched to eliminate warnings about "constant is - unsigned in ANSI C, signed in traditional"; made test program - self-checking. + unsigned in ANSI C, signed in traditional"; made test program + self-checking. 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5). 1999-05-03 lpd Original version. @@ -54,7 +68,7 @@ #include "md5.h" #include -#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ +#undef BYTE_ORDER /* 1 = big-endian, -1 = little-endian, 0 = unknown */ #ifdef ARCH_IS_BIG_ENDIAN # define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1) #else @@ -64,318 +78,329 @@ #define T_MASK ((md5_word_t)~0) #define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87) #define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9) -#define T3 0x242070db +#define T3 0x242070db #define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111) #define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050) -#define T6 0x4787c62a +#define T6 0x4787c62a #define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec) #define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe) -#define T9 0x698098d8 +#define T9 0x698098d8 #define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850) #define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e) #define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841) -#define T13 0x6b901122 +#define T13 0x6b901122 #define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c) #define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71) -#define T16 0x49b40821 +#define T16 0x49b40821 #define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d) #define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf) -#define T19 0x265e5a51 +#define T19 0x265e5a51 #define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855) #define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2) -#define T22 0x02441453 +#define T22 0x02441453 #define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e) #define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437) -#define T25 0x21e1cde6 +#define T25 0x21e1cde6 #define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829) #define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278) -#define T28 0x455a14ed +#define T28 0x455a14ed #define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa) #define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07) -#define T31 0x676f02d9 +#define T31 0x676f02d9 #define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375) #define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd) #define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e) -#define T35 0x6d9d6122 +#define T35 0x6d9d6122 #define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3) #define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb) -#define T38 0x4bdecfa9 +#define T38 0x4bdecfa9 #define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f) #define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f) -#define T41 0x289b7ec6 +#define T41 0x289b7ec6 #define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805) #define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a) -#define T44 0x04881d05 +#define T44 0x04881d05 #define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6) #define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a) -#define T47 0x1fa27cf8 +#define T47 0x1fa27cf8 #define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a) #define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb) -#define T50 0x432aff97 +#define T50 0x432aff97 #define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58) #define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6) -#define T53 0x655b59c3 +#define T53 0x655b59c3 #define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d) #define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82) #define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e) -#define T57 0x6fa87e4f +#define T57 0x6fa87e4f #define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f) #define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb) -#define T60 0x4e0811a1 +#define T60 0x4e0811a1 #define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d) #define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca) -#define T63 0x2ad7d2bb +#define T63 0x2ad7d2bb #define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e) - -static void -md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/) +static void md5_process(md5_state_t* pms, const md5_byte_t* data /*[64]*/) { - md5_word_t - a = pms->abcd[0], b = pms->abcd[1], - c = pms->abcd[2], d = pms->abcd[3]; - md5_word_t t; + md5_word_t a = pms->abcd[0]; + md5_word_t b = pms->abcd[1]; + md5_word_t c = pms->abcd[2]; + md5_word_t d = pms->abcd[3]; + md5_word_t t; #if BYTE_ORDER > 0 - /* Define storage only for big-endian CPUs. */ - md5_word_t X[16]; + /* Define storage only for big-endian CPUs. */ + md5_word_t X[16]; #else - /* Define storage for little-endian or both types of CPUs. */ - md5_word_t xbuf[16]; - const md5_word_t *X; + /* Define storage for little-endian or both types of CPUs. */ + md5_word_t xbuf[16]; + const md5_word_t* X; #endif - { + { #if BYTE_ORDER == 0 - /* - * Determine dynamically whether this is a big-endian or - * little-endian machine, since we can use a more efficient - * algorithm on the latter. - */ - static const int w = 1; + /* + * Determine dynamically whether this is a big-endian or + * little-endian machine, since we can use a more efficient + * algorithm on the latter. + */ + static const int w = 1; - if (*((const md5_byte_t *)&w)) /* dynamic little-endian */ + if (*((const md5_byte_t*)&w)) /* dynamic little-endian */ #endif -#if BYTE_ORDER <= 0 /* little-endian */ - { - /* - * On little-endian machines, we can process properly aligned - * data without copying it. - */ - if (!((data - (const md5_byte_t *)0) & 3)) { - /* data are properly aligned */ - X = (const md5_word_t *)data; - } else { - /* not aligned */ - memcpy(xbuf, data, 64); - X = xbuf; - } - } +#if BYTE_ORDER <= 0 /* little-endian */ + { + /* + * On little-endian machines, we can process properly aligned + * data without copying it. + */ + if (!((uintptr_t)data & 3)) { + /* data are properly aligned */ + X = (const md5_word_t*)data; + } else { + /* not aligned */ + memcpy(xbuf, data, 64); + X = xbuf; + } + } #endif #if BYTE_ORDER == 0 - else /* dynamic big-endian */ + else /* dynamic big-endian */ #endif -#if BYTE_ORDER >= 0 /* big-endian */ - { - /* - * On big-endian machines, we must arrange the bytes in the - * right order. - */ - const md5_byte_t *xp = data; - int i; +#if BYTE_ORDER >= 0 /* big-endian */ + { + /* + * On big-endian machines, we must arrange the bytes in the + * right order. + */ + const md5_byte_t* xp = data; + int i; # if BYTE_ORDER == 0 - X = xbuf; /* (dynamic only) */ + X = xbuf; /* (dynamic only) */ # else -# define xbuf X /* (static only) */ +# define xbuf X /* (static only) */ # endif - for (i = 0; i < 16; ++i, xp += 4) - xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24); - } -#endif + for (i = 0; i < 16; ++i, xp += 4) { + xbuf[i] = + (md5_word_t)(xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24)); + } } +#endif + } #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n)))) - /* Round 1. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ +/* Round 1. */ +/* Let [abcd k s i] denote the operation + a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + F(b,c,d) + X[k] + Ti;\ +#define SET(a, b, c, d, k, s, Ti) \ + t = a + F(b, c, d) + X[k] + (Ti); \ a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 7, T1); - SET(d, a, b, c, 1, 12, T2); - SET(c, d, a, b, 2, 17, T3); - SET(b, c, d, a, 3, 22, T4); - SET(a, b, c, d, 4, 7, T5); - SET(d, a, b, c, 5, 12, T6); - SET(c, d, a, b, 6, 17, T7); - SET(b, c, d, a, 7, 22, T8); - SET(a, b, c, d, 8, 7, T9); - SET(d, a, b, c, 9, 12, T10); - SET(c, d, a, b, 10, 17, T11); - SET(b, c, d, a, 11, 22, T12); - SET(a, b, c, d, 12, 7, T13); - SET(d, a, b, c, 13, 12, T14); - SET(c, d, a, b, 14, 17, T15); - SET(b, c, d, a, 15, 22, T16); + /* Do the following 16 operations. */ + SET(a, b, c, d, 0, 7, T1); + SET(d, a, b, c, 1, 12, T2); + SET(c, d, a, b, 2, 17, T3); + SET(b, c, d, a, 3, 22, T4); + SET(a, b, c, d, 4, 7, T5); + SET(d, a, b, c, 5, 12, T6); + SET(c, d, a, b, 6, 17, T7); + SET(b, c, d, a, 7, 22, T8); + SET(a, b, c, d, 8, 7, T9); + SET(d, a, b, c, 9, 12, T10); + SET(c, d, a, b, 10, 17, T11); + SET(b, c, d, a, 11, 22, T12); + SET(a, b, c, d, 12, 7, T13); + SET(d, a, b, c, 13, 12, T14); + SET(c, d, a, b, 14, 17, T15); + SET(b, c, d, a, 15, 22, T16); #undef SET - /* Round 2. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ +/* Round 2. */ +/* Let [abcd k s i] denote the operation + a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ #define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + G(b,c,d) + X[k] + Ti;\ +#define SET(a, b, c, d, k, s, Ti) \ + t = a + G(b, c, d) + X[k] + (Ti); \ a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 1, 5, T17); - SET(d, a, b, c, 6, 9, T18); - SET(c, d, a, b, 11, 14, T19); - SET(b, c, d, a, 0, 20, T20); - SET(a, b, c, d, 5, 5, T21); - SET(d, a, b, c, 10, 9, T22); - SET(c, d, a, b, 15, 14, T23); - SET(b, c, d, a, 4, 20, T24); - SET(a, b, c, d, 9, 5, T25); - SET(d, a, b, c, 14, 9, T26); - SET(c, d, a, b, 3, 14, T27); - SET(b, c, d, a, 8, 20, T28); - SET(a, b, c, d, 13, 5, T29); - SET(d, a, b, c, 2, 9, T30); - SET(c, d, a, b, 7, 14, T31); - SET(b, c, d, a, 12, 20, T32); + /* Do the following 16 operations. */ + SET(a, b, c, d, 1, 5, T17); + SET(d, a, b, c, 6, 9, T18); + SET(c, d, a, b, 11, 14, T19); + SET(b, c, d, a, 0, 20, T20); + SET(a, b, c, d, 5, 5, T21); + SET(d, a, b, c, 10, 9, T22); + SET(c, d, a, b, 15, 14, T23); + SET(b, c, d, a, 4, 20, T24); + SET(a, b, c, d, 9, 5, T25); + SET(d, a, b, c, 14, 9, T26); + SET(c, d, a, b, 3, 14, T27); + SET(b, c, d, a, 8, 20, T28); + SET(a, b, c, d, 13, 5, T29); + SET(d, a, b, c, 2, 9, T30); + SET(c, d, a, b, 7, 14, T31); + SET(b, c, d, a, 12, 20, T32); #undef SET - /* Round 3. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ +/* Round 3. */ +/* Let [abcd k s t] denote the operation + a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ #define H(x, y, z) ((x) ^ (y) ^ (z)) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + H(b,c,d) + X[k] + Ti;\ +#define SET(a, b, c, d, k, s, Ti) \ + t = a + H(b, c, d) + X[k] + (Ti); \ a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 5, 4, T33); - SET(d, a, b, c, 8, 11, T34); - SET(c, d, a, b, 11, 16, T35); - SET(b, c, d, a, 14, 23, T36); - SET(a, b, c, d, 1, 4, T37); - SET(d, a, b, c, 4, 11, T38); - SET(c, d, a, b, 7, 16, T39); - SET(b, c, d, a, 10, 23, T40); - SET(a, b, c, d, 13, 4, T41); - SET(d, a, b, c, 0, 11, T42); - SET(c, d, a, b, 3, 16, T43); - SET(b, c, d, a, 6, 23, T44); - SET(a, b, c, d, 9, 4, T45); - SET(d, a, b, c, 12, 11, T46); - SET(c, d, a, b, 15, 16, T47); - SET(b, c, d, a, 2, 23, T48); + /* Do the following 16 operations. */ + SET(a, b, c, d, 5, 4, T33); + SET(d, a, b, c, 8, 11, T34); + SET(c, d, a, b, 11, 16, T35); + SET(b, c, d, a, 14, 23, T36); + SET(a, b, c, d, 1, 4, T37); + SET(d, a, b, c, 4, 11, T38); + SET(c, d, a, b, 7, 16, T39); + SET(b, c, d, a, 10, 23, T40); + SET(a, b, c, d, 13, 4, T41); + SET(d, a, b, c, 0, 11, T42); + SET(c, d, a, b, 3, 16, T43); + SET(b, c, d, a, 6, 23, T44); + SET(a, b, c, d, 9, 4, T45); + SET(d, a, b, c, 12, 11, T46); + SET(c, d, a, b, 15, 16, T47); + SET(b, c, d, a, 2, 23, T48); #undef SET - /* Round 4. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ +/* Round 4. */ +/* Let [abcd k s t] denote the operation + a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ #define I(x, y, z) ((y) ^ ((x) | ~(z))) -#define SET(a, b, c, d, k, s, Ti)\ - t = a + I(b,c,d) + X[k] + Ti;\ +#define SET(a, b, c, d, k, s, Ti) \ + t = a + I(b, c, d) + X[k] + (Ti); \ a = ROTATE_LEFT(t, s) + b - /* Do the following 16 operations. */ - SET(a, b, c, d, 0, 6, T49); - SET(d, a, b, c, 7, 10, T50); - SET(c, d, a, b, 14, 15, T51); - SET(b, c, d, a, 5, 21, T52); - SET(a, b, c, d, 12, 6, T53); - SET(d, a, b, c, 3, 10, T54); - SET(c, d, a, b, 10, 15, T55); - SET(b, c, d, a, 1, 21, T56); - SET(a, b, c, d, 8, 6, T57); - SET(d, a, b, c, 15, 10, T58); - SET(c, d, a, b, 6, 15, T59); - SET(b, c, d, a, 13, 21, T60); - SET(a, b, c, d, 4, 6, T61); - SET(d, a, b, c, 11, 10, T62); - SET(c, d, a, b, 2, 15, T63); - SET(b, c, d, a, 9, 21, T64); + /* Do the following 16 operations. */ + SET(a, b, c, d, 0, 6, T49); + SET(d, a, b, c, 7, 10, T50); + SET(c, d, a, b, 14, 15, T51); + SET(b, c, d, a, 5, 21, T52); + SET(a, b, c, d, 12, 6, T53); + SET(d, a, b, c, 3, 10, T54); + SET(c, d, a, b, 10, 15, T55); + SET(b, c, d, a, 1, 21, T56); + SET(a, b, c, d, 8, 6, T57); + SET(d, a, b, c, 15, 10, T58); + SET(c, d, a, b, 6, 15, T59); + SET(b, c, d, a, 13, 21, T60); + SET(a, b, c, d, 4, 6, T61); + SET(d, a, b, c, 11, 10, T62); + SET(c, d, a, b, 2, 15, T63); + SET(b, c, d, a, 9, 21, T64); #undef SET - /* Then perform the following additions. (That is increment each - of the four registers by the value it had before this block - was started.) */ - pms->abcd[0] += a; - pms->abcd[1] += b; - pms->abcd[2] += c; - pms->abcd[3] += d; + /* Then perform the following additions. (That is increment each + of the four registers by the value it had before this block + was started.) */ + pms->abcd[0] += a; + pms->abcd[1] += b; + pms->abcd[2] += c; + pms->abcd[3] += d; } -void -md5_init(md5_state_t *pms) +/* Initialize the algorithm. */ +void md5_init(md5_state_t* pms) { - pms->count[0] = pms->count[1] = 0; - pms->abcd[0] = 0x67452301; - pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; - pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; - pms->abcd[3] = 0x10325476; + pms->count[0] = pms->count[1] = 0; + pms->abcd[0] = 0x67452301; + pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476; + pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301; + pms->abcd[3] = 0x10325476; } -void -md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes) +/* Append a string to the message. */ +void md5_append(md5_state_t* pms, const md5_byte_t* data, size_t nbytes) { - const md5_byte_t *p = data; - int left = nbytes; - int offset = (pms->count[0] >> 3) & 63; - md5_word_t nbits = (md5_word_t)(nbytes << 3); - - if (nbytes <= 0) - return; - - /* Update the message length. */ - pms->count[1] += nbytes >> 29; - pms->count[0] += nbits; - if (pms->count[0] < nbits) - pms->count[1]++; - - /* Process an initial partial block. */ - if (offset) { - int copy = (offset + nbytes > 64 ? 64 - offset : nbytes); - - memcpy(pms->buf + offset, p, copy); - if (offset + copy < 64) - return; - p += copy; - left -= copy; - md5_process(pms, pms->buf); + const md5_byte_t* p = data; + size_t left = nbytes; + size_t offset = (pms->count[0] >> 3) & 63; + md5_word_t nbits = (md5_word_t)(nbytes << 3); + + if (nbytes <= 0) { + return; + } + + /* Update the message length. */ + pms->count[1] += (md5_word_t)(nbytes >> 29); + pms->count[0] += nbits; + if (pms->count[0] < nbits) { + pms->count[1]++; + } + + /* Process an initial partial block. */ + if (offset) { + size_t copy = (offset + nbytes > 64 ? 64 - offset : nbytes); + + memcpy(pms->buf + offset, p, copy); + if (offset + copy < 64) { + return; } - - /* Process full blocks. */ - for (; left >= 64; p += 64, left -= 64) - md5_process(pms, p); - - /* Process a final partial block. */ - if (left) - memcpy(pms->buf, p, left); + p += copy; + left -= copy; + md5_process(pms, pms->buf); + } + + /* Process full blocks. */ + for (; left >= 64; p += 64, left -= 64) { + md5_process(pms, p); + } + + /* Process a final partial block. */ + if (left) { + memcpy(pms->buf, p, left); + } } -void -md5_finish(md5_state_t *pms, md5_byte_t digest[16]) +/* Finish the message and return the digest. */ +void md5_finish(md5_state_t* pms, md5_byte_t digest[16]) { - static const md5_byte_t pad[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 - }; - md5_byte_t data[8]; - int i; - - /* Save the length before padding. */ - for (i = 0; i < 8; ++i) - data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); - /* Pad to 56 bytes mod 64. */ - md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); - /* Append the length. */ - md5_append(pms, data, 8); - for (i = 0; i < 16; ++i) - digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); + static const md5_byte_t pad[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + md5_byte_t data[8]; + int i; + + /* Save the length before padding. */ + for (i = 0; i < 8; ++i) { + data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3)); + } + /* Pad to 56 bytes mod 64. */ + md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1); + /* Append the length. */ + md5_append(pms, data, 8); + for (i = 0; i < 16; ++i) { + digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3)); + } } + +#if defined(__clang__) && !defined(__INTEL_COMPILER) +# pragma clang diagnostic pop +#endif diff -Nru gdcm-3.0.10/Utilities/gdcmmd5/md5.h gdcm-3.0.14/Utilities/gdcmmd5/md5.h --- gdcm-3.0.10/Utilities/gdcmmd5/md5.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/gdcmmd5/md5.h 2022-06-24 07:37:44.000000000 +0000 @@ -96,7 +96,7 @@ void MD5_EXPORT md5_init(md5_state_t *pms); /* Append a string to the message. */ -void MD5_EXPORT md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes); +void MD5_EXPORT md5_append(md5_state_t *pms, const md5_byte_t *data, size_t nbytes); /* Finish the message and return the digest. */ void MD5_EXPORT md5_finish(md5_state_t *pms, md5_byte_t digest[16]); diff -Nru gdcm-3.0.10/Utilities/gdcmutfcpp/README.GDCM.txt gdcm-3.0.14/Utilities/gdcmutfcpp/README.GDCM.txt --- gdcm-3.0.10/Utilities/gdcmutfcpp/README.GDCM.txt 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/gdcmutfcpp/README.GDCM.txt 2022-06-24 07:37:44.000000000 +0000 @@ -11,3 +11,7 @@ SHA 256 checksum: 3373cebb25d88c662a2b960c4d585daf9ae7b396031ecd786e7bb31b15d010ef + +New location is: + +* https://github.com/nemtrif/utfcpp diff -Nru gdcm-3.0.10/Utilities/socketxx/socket++/sockstream.cpp gdcm-3.0.14/Utilities/socketxx/socket++/sockstream.cpp --- gdcm-3.0.10/Utilities/socketxx/socket++/sockstream.cpp 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/socketxx/socket++/sockstream.cpp 2022-06-24 07:37:44.000000000 +0000 @@ -272,7 +272,7 @@ case EHOSTDOWN: case EHOSTUNREACH: case ENOTEMPTY: -# if !defined(__linux__) && !defined(__sun) && !defined(__hpux) && !defined(__EMSCRIPTEN__) // LN +# if !defined(__linux__) && !defined(__sun) && !defined(__hpux) && !defined(__EMSCRIPTEN__) && !defined(__wasi__) // LN case EPROCLIM: # endif case EUSERS: diff -Nru gdcm-3.0.10/Utilities/VTK/Examples/Cxx/GenerateRTSTRUCT.cxx gdcm-3.0.14/Utilities/VTK/Examples/Cxx/GenerateRTSTRUCT.cxx --- gdcm-3.0.10/Utilities/VTK/Examples/Cxx/GenerateRTSTRUCT.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/VTK/Examples/Cxx/GenerateRTSTRUCT.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -127,7 +127,7 @@ while (std::find(theFileNames.begin(), theFileNames.end(), thePotentialName) != theFileNames.end()) { char buff[255]; - sprintf(buff,"%d",count); + snprintf(buff,sizeof(buff),"%d",count); thePotentialName = theDirName + "/" + "GDCMTestRTStruct." + buff + "." + theRTSeries[q] + ".dcm"; } writer->SetFileName( thePotentialName.c_str()); diff -Nru gdcm-3.0.10/Utilities/VTK/Examples/Cxx/reslicesphere.cxx gdcm-3.0.14/Utilities/VTK/Examples/Cxx/reslicesphere.cxx --- gdcm-3.0.10/Utilities/VTK/Examples/Cxx/reslicesphere.cxx 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/VTK/Examples/Cxx/reslicesphere.cxx 2022-06-24 07:37:44.000000000 +0000 @@ -26,7 +26,6 @@ to VTK /vtkusers vtk.org/ date Tue, May 11, 2010 at 7:01 PM */ -#include #include #include @@ -194,6 +193,9 @@ _reader->SetFileNames( vtkfiles ); _reader->Update(); +#ifndef vtkFloatingPointType +#define vtkFloatingPointType double +#endif const vtkFloatingPointType *spacing = _reader->GetOutput()->GetSpacing(); vtkImageChangeInformation *v16 = vtkImageChangeInformation::New(); @@ -360,7 +362,7 @@ // Set the current slice of the current view. void SetSlice(int slice) { - std::strstream posString; + std::stringstream posString; double center[3]; double spacing[3]; @@ -414,7 +416,7 @@ // Annotate the image. posString << "Position: (" << newPoint[0] << ", " << newPoint[1] << ", " << newPoint[2] << ") Slice: " << newSlice; - _annotation->SetInput(posString.str()); + _annotation->SetInput(posString.str().c_str()); _imageViewer->Render(); } diff -Nru gdcm-3.0.10/Utilities/VTK/vtkGDCMImageReader2.h gdcm-3.0.14/Utilities/VTK/vtkGDCMImageReader2.h --- gdcm-3.0.10/Utilities/VTK/vtkGDCMImageReader2.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/VTK/vtkGDCMImageReader2.h 2022-06-24 07:37:44.000000000 +0000 @@ -34,7 +34,7 @@ // 0,0 the overlay will have an offset... // Only the very first overlay is loaded at the VTK level, for now (even if there are more than one in the file) // .SECTION DataOrigin -// When the reader is instanciated with FileLowerLeftOn the DataOrigin and Image Position (Patient) are +// When the reader is instantiated with FileLowerLeftOn the DataOrigin and Image Position (Patient) are // identical. But when FileLowerLeft is Off, we have to reorder the Y-line of the image, and thus the DataOrigin // is then translated to the other side of the image. // .SECTION Spacing @@ -203,7 +203,7 @@ // Description: // \DEPRECATED: // Modality LUT - // Value returned by GetShift/GetScale might be innacurate since Shift/Scale could be + // Value returned by GetShift/GetScale might be inacurate since Shift/Scale could be // varying along the Series read. Therefore user are advices not to use those functions // anymore vtkGetMacro(Shift,double); diff -Nru gdcm-3.0.10/Utilities/VTK/vtkGDCMImageReader.h gdcm-3.0.14/Utilities/VTK/vtkGDCMImageReader.h --- gdcm-3.0.10/Utilities/VTK/vtkGDCMImageReader.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/VTK/vtkGDCMImageReader.h 2022-06-24 07:37:44.000000000 +0000 @@ -34,7 +34,7 @@ // 0,0 the overlay will have an offset... // Only the very first overlay is loaded at the VTK level, for now (even if there are more than one in the file) // .SECTION DataOrigin -// When the reader is instanciated with FileLowerLeftOn the DataOrigin and Image Position (Patient) are +// When the reader is instantiated with FileLowerLeftOn the DataOrigin and Image Position (Patient) are // identical. But when FileLowerLeft is Off, we have to reorder the Y-line of the image, and thus the DataOrigin // is then translated to the other side of the image. // .SECTION Spacing @@ -229,7 +229,7 @@ // Description: // \DEPRECATED: // Modality LUT - // Value returned by GetShift/GetScale might be innacurate since Shift/Scale could be + // Value returned by GetShift/GetScale might be inaccurate since Shift/Scale could be // varying along the Series read. Therefore user are advices not to use those functions // anymore vtkGetMacro(Shift,double); diff -Nru gdcm-3.0.10/Utilities/VTK/vtkGDCMThreadedImageReader2.h gdcm-3.0.14/Utilities/VTK/vtkGDCMThreadedImageReader2.h --- gdcm-3.0.10/Utilities/VTK/vtkGDCMThreadedImageReader2.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/VTK/vtkGDCMThreadedImageReader2.h 2022-06-24 07:37:44.000000000 +0000 @@ -20,7 +20,7 @@ // If looking for a single threaded class see: vtkGDCMImageReader // // .SECTION Warning: Advanced users only. Do not use this class in the general case, -// you have to understand how physicaly medium works first (sequential reading for +// you have to understand how physically medium works first (sequential reading for // instance) before playing with this class // // .SECTION Implementation note: when FileLowerLeft is set to on the image is not flipped @@ -35,7 +35,7 @@ // subtle trick down in the threading mechanism in VTK were the main thread (talking to the // python interpreter) is also part of the execution process (and the N-1 other thread // are just there to execute the remaining of ThreadedRequestData), this separation into -// two types of thread is necessary to acheive a working implementation of UpdateProgress +// two types of thread is necessary to achieve a working implementation of UpdateProgress // .SECTION See Also // vtkMedicalImageReader2 vtkMedicalImageProperties vtkGDCMImageReader diff -Nru gdcm-3.0.10/Utilities/VTK/vtkGDCMThreadedImageReader.h gdcm-3.0.14/Utilities/VTK/vtkGDCMThreadedImageReader.h --- gdcm-3.0.10/Utilities/VTK/vtkGDCMThreadedImageReader.h 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Utilities/VTK/vtkGDCMThreadedImageReader.h 2022-06-24 07:37:44.000000000 +0000 @@ -18,7 +18,7 @@ // read approx N times faster than when reading in a single thread. // // .SECTION Warning: Advanced users only. Do not use this class in the general case, -// you have to understand how physicaly medium works first (sequential reading for +// you have to understand how physically medium works first (sequential reading for // instance) before playing with this class // // .SECTION Implementation note: when FileLowerLeft is set to on the image is not flipped diff -Nru gdcm-3.0.10/Wrapping/Csharp/gdcm.i gdcm-3.0.14/Wrapping/Csharp/gdcm.i --- gdcm-3.0.10/Wrapping/Csharp/gdcm.i 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Wrapping/Csharp/gdcm.i 2022-06-24 07:37:44.000000000 +0000 @@ -117,6 +117,7 @@ #include "gdcmBasicOffsetTable.h" //#include "gdcmLO.h" #include "gdcmCSAElement.h" +#include "gdcmMrProtocol.h" #include "gdcmPDBElement.h" #include "gdcmFileSet.h" @@ -142,6 +143,8 @@ #include "gdcmSubject.h" #include "gdcmCommand.h" #include "gdcmAnonymizer.h" +#include "gdcmDPath.h" +#include "gdcmCleaner.h" #include "gdcmFileAnonymizer.h" #include "gdcmFileStreamer.h" #include "gdcmSystem.h" @@ -240,6 +243,8 @@ #include "gdcmImageRegionReader.h" #include "gdcmJSON.h" #include "gdcmFileDecompressLookupTable.h" +#include "gdcmEmptyMaskGenerator.h" +#include "gdcmEquipmentManufacturer.h" using namespace gdcm; %} @@ -645,6 +650,8 @@ EXTEND_CLASS_PRINT(gdcm::PDBElement) %include "gdcmPDBHeader.h" EXTEND_CLASS_PRINT(gdcm::PDBHeader) +%include "gdcmMrProtocol.h" +EXTEND_CLASS_PRINT(gdcm::MrProtocol) %include "gdcmCSAElement.h" EXTEND_CLASS_PRINT(gdcm::CSAElement) %include "gdcmCSAHeader.h" @@ -709,6 +716,7 @@ EXTEND_CLASS_PRINT(gdcm::StrictScanner) %template(SmartPtrAno) gdcm::SmartPointer; +%template(SmartPtrCleaner) gdcm::SmartPointer; //%ignore gdcm::Anonymizer::Anonymizer; @@ -718,6 +726,8 @@ //%feature("unref") Anonymizer "coucou $this->Delete();" // http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus%5Fnn34 %include "gdcmAnonymizer.h" +%include "gdcmDPath.h" +%include "gdcmCleaner.h" %apply char[] { char* value_data } %include "gdcmFileAnonymizer.h" %clear char* value_data; @@ -970,3 +980,5 @@ %clear char* inreadbuffer; %include "gdcmJSON.h" %include "gdcmFileDecompressLookupTable.h" +%include "gdcmEmptyMaskGenerator.h" +%include "gdcmEquipmentManufacturer.h" diff -Nru gdcm-3.0.10/Wrapping/Java/gdcm.i gdcm-3.0.14/Wrapping/Java/gdcm.i --- gdcm-3.0.10/Wrapping/Java/gdcm.i 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Wrapping/Java/gdcm.i 2022-06-24 07:37:44.000000000 +0000 @@ -70,6 +70,7 @@ #include "gdcmBasicOffsetTable.h" //#include "gdcmLO.h" #include "gdcmCSAElement.h" +#include "gdcmMrProtocol.h" #include "gdcmPDBElement.h" #include "gdcmFileSet.h" @@ -95,6 +96,8 @@ #include "gdcmSubject.h" #include "gdcmCommand.h" #include "gdcmAnonymizer.h" +#include "gdcmDPath.h" +#include "gdcmCleaner.h" #include "gdcmFileAnonymizer.h" #include "gdcmFileStreamer.h" #include "gdcmSystem.h" @@ -193,6 +196,8 @@ #include "gdcmImageRegionReader.h" #include "gdcmJSON.h" #include "gdcmFileDecompressLookupTable.h" +#include "gdcmEmptyMaskGenerator.h" +#include "gdcmEquipmentManufacturer.h" using namespace gdcm; %} @@ -644,6 +649,8 @@ EXTEND_CLASS_PRINT(gdcm::PDBElement) %include "gdcmPDBHeader.h" EXTEND_CLASS_PRINT(gdcm::PDBHeader) +%include "gdcmMrProtocol.h" +EXTEND_CLASS_PRINT(gdcm::MrProtocol) %include "gdcmCSAElement.h" EXTEND_CLASS_PRINT(gdcm::CSAElement) %include "gdcmCSAHeader.h" @@ -817,6 +824,7 @@ %clear MappingType; %template(SmartPtrAno) gdcm::SmartPointer; +%template(SmartPtrCleaner) gdcm::SmartPointer; //%ignore gdcm::Anonymizer::Anonymizer; @@ -826,6 +834,8 @@ //%feature("unref") Anonymizer "coucou $this->Delete();" // http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus%5Fnn34 %include "gdcmAnonymizer.h" +%include "gdcmDPath.h" +%include "gdcmCleaner.h" %include "gdcmFileAnonymizer.h" %apply char[] { char* array } %template(SmartPtrFStreamer) gdcm::SmartPointer; @@ -1017,3 +1027,5 @@ %clear signed char* inreadbuffer; %include "gdcmJSON.h" %include "gdcmFileDecompressLookupTable.h" +%include "gdcmEmptyMaskGenerator.h" +%include "gdcmEquipmentManufacturer.h" diff -Nru gdcm-3.0.10/Wrapping/Python/docstrings.i gdcm-3.0.14/Wrapping/Python/docstrings.i --- gdcm-3.0.10/Wrapping/Python/docstrings.i 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Wrapping/Python/docstrings.i 2022-06-24 07:37:44.000000000 +0000 @@ -273,10 +273,10 @@ C++ includes: gdcmAnonymizeEvent.h "; -%feature("docstring") gdcm::AnonymizeEvent::AnonymizeEvent "gdcm::AnonymizeEvent::AnonymizeEvent(Tag const &tag=0) "; - %feature("docstring") gdcm::AnonymizeEvent::AnonymizeEvent "gdcm::AnonymizeEvent::AnonymizeEvent(const Self &s) "; +%feature("docstring") gdcm::AnonymizeEvent::AnonymizeEvent "gdcm::AnonymizeEvent::AnonymizeEvent(Tag const &tag=0) "; + %feature("docstring") gdcm::AnonymizeEvent::~AnonymizeEvent "gdcm::AnonymizeEvent::~AnonymizeEvent() override=default "; %feature("docstring") gdcm::AnonymizeEvent::CheckEvent "bool @@ -675,16 +675,16 @@ C++ includes: gdcmAttribute.h "; %feature("docstring") gdcm::Attribute::GDCM_STATIC_ASSERT "gdcm::Attribute< Group, Element, TVR, TVM ->::GDCM_STATIC_ASSERT(((VR::VRType) TVR &(VR::VRType)(TagToType< -Group, Element >::VRType))) "; +>::GDCM_STATIC_ASSERT(((((VR::VRType) TVR &VR::VR_VM1) &&((VM::VMType) +TVM==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1))) "; %feature("docstring") gdcm::Attribute::GDCM_STATIC_ASSERT "gdcm::Attribute< Group, Element, TVR, TVM >::GDCM_STATIC_ASSERT(((VM::VMType) TVM &(VM::VMType)(TagToType< Group, Element >::VMType))) "; %feature("docstring") gdcm::Attribute::GDCM_STATIC_ASSERT "gdcm::Attribute< Group, Element, TVR, TVM ->::GDCM_STATIC_ASSERT(((((VR::VRType) TVR &VR::VR_VM1) &&((VM::VMType) -TVM==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1))) "; +>::GDCM_STATIC_ASSERT(((VR::VRType) TVR &(VR::VRType)(TagToType< +Group, Element >::VRType))) "; %feature("docstring") gdcm::Attribute::GetAsDataElement "DataElement gdcm::Attribute< Group, Element, TVR, TVM >::GetAsDataElement() const @@ -734,22 +734,22 @@ %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1 >::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, VM::VM1 ->::GDCM_STATIC_ASSERT(VMToLength< VM::VM1 >::Length==1) "; +>::GDCM_STATIC_ASSERT(((((VR::VRType) TVR &VR::VR_VM1) &&((VM::VMType) +VM::VM1==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1))) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1 >::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, VM::VM1 ->::GDCM_STATIC_ASSERT(((VR::VRType) TVR &(VR::VRType)(TagToType< -Group, Element >::VRType))) "; +>::GDCM_STATIC_ASSERT(((VM::VMType) VM::VM1 &(VM::VMType)(TagToType< +Group, Element >::VMType))) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1 >::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, VM::VM1 ->::GDCM_STATIC_ASSERT(((VM::VMType) VM::VM1 &(VM::VMType)(TagToType< -Group, Element >::VMType))) "; +>::GDCM_STATIC_ASSERT(((VR::VRType) TVR &(VR::VRType)(TagToType< +Group, Element >::VRType))) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1 >::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, VM::VM1 ->::GDCM_STATIC_ASSERT(((((VR::VRType) TVR &VR::VR_VM1) &&((VM::VMType) -VM::VM1==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1))) "; +>::GDCM_STATIC_ASSERT(VMToLength< VM::VM1 >::Length==1) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1 >::GetAsDataElement " DataElement gdcm::Attribute< Group, Element, @@ -824,6 +824,12 @@ %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, +VM::VM1_n >::GDCM_STATIC_ASSERT(((((VR::VRType) TVR &VR::VR_VM1) +&&((VM::VMType) TagToType< Group, Element +>::VMType==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1))) "; + +%feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n +>::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::GDCM_STATIC_ASSERT(((VR::VRType) TVR &(VR::VRType)(TagToType< Group, Element >::VRType))) "; @@ -833,12 +839,6 @@ Group, Element >::VMType))) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n ->::GDCM_STATIC_ASSERT " gdcm::Attribute< Group, Element, TVR, -VM::VM1_n >::GDCM_STATIC_ASSERT(((((VR::VRType) TVR &VR::VR_VM1) -&&((VM::VMType) TagToType< Group, Element ->::VMType==VM::VM1))||!((VR::VRType) TVR &VR::VR_VM1))) "; - -%feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::GetAsDataElement " DataElement gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::GetAsDataElement() const "; @@ -880,11 +880,11 @@ %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::SetValue " void gdcm::Attribute< Group, Element, TVR, VM::VM1_n ->::SetValue(unsigned int idx, ArrayType v) "; +>::SetValue(ArrayType v) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::SetValue " void gdcm::Attribute< Group, Element, TVR, VM::VM1_n ->::SetValue(ArrayType v) "; +>::SetValue(unsigned int idx, ArrayType v) "; %feature("docstring") gdcm::Attribute< Group, Element, TVR, VM::VM1_n >::SetValues " void gdcm::Attribute< Group, Element, TVR, VM::VM1_n @@ -1100,27 +1100,27 @@ %feature("docstring") gdcm::BaseQuery::GetAbstractSyntaxUID "virtual UIDs::TSName gdcm::BaseQuery::GetAbstractSyntaxUID() const =0 "; +%feature("docstring") gdcm::BaseQuery::GetQueryDataSet "DataSet& +gdcm::BaseQuery::GetQueryDataSet() "; + %feature("docstring") gdcm::BaseQuery::GetQueryDataSet "DataSet const& gdcm::BaseQuery::GetQueryDataSet() const Set/Get the internal representation of the query as a DataSet. "; -%feature("docstring") gdcm::BaseQuery::GetQueryDataSet "DataSet& -gdcm::BaseQuery::GetQueryDataSet() "; - %feature("docstring") gdcm::BaseQuery::GetSOPInstanceUID "std::string gdcm::BaseQuery::GetSOPInstanceUID() const "; %feature("docstring") gdcm::BaseQuery::Print "void gdcm::BaseQuery::Print(std::ostream &os) const override "; %feature("docstring") gdcm::BaseQuery::SetSearchParameter "void -gdcm::BaseQuery::SetSearchParameter(const Tag &inTag, const -std::string &inValue) "; - -%feature("docstring") gdcm::BaseQuery::SetSearchParameter "void gdcm::BaseQuery::SetSearchParameter(const std::string &inKeyword, const std::string &inValue) "; +%feature("docstring") gdcm::BaseQuery::SetSearchParameter "void +gdcm::BaseQuery::SetSearchParameter(const Tag &inTag, const +std::string &inValue) "; + %feature("docstring") gdcm::BaseQuery::SetSOPInstanceUID "void gdcm::BaseQuery::SetSOPInstanceUID(const std::string &iSopInstanceUID) "; @@ -1286,12 +1286,12 @@ %feature("docstring") gdcm::Bitmap::GetColumns "unsigned int gdcm::Bitmap::GetColumns() const "; -%feature("docstring") gdcm::Bitmap::GetDataElement "const -DataElement& gdcm::Bitmap::GetDataElement() const "; - %feature("docstring") gdcm::Bitmap::GetDataElement "DataElement& gdcm::Bitmap::GetDataElement() "; +%feature("docstring") gdcm::Bitmap::GetDataElement "const +DataElement& gdcm::Bitmap::GetDataElement() const "; + %feature("docstring") gdcm::Bitmap::GetDimension "unsigned int gdcm::Bitmap::GetDimension(unsigned int idx) const "; @@ -1301,12 +1301,12 @@ Return the dimension of the pixel data, first dimension (x), then 2nd (y), then 3rd (z)... "; -%feature("docstring") gdcm::Bitmap::GetLUT "const LookupTable& -gdcm::Bitmap::GetLUT() const "; - %feature("docstring") gdcm::Bitmap::GetLUT "LookupTable& gdcm::Bitmap::GetLUT() "; +%feature("docstring") gdcm::Bitmap::GetLUT "const LookupTable& +gdcm::Bitmap::GetLUT() const "; + %feature("docstring") gdcm::Bitmap::GetNeedByteSwap "bool gdcm::Bitmap::GetNeedByteSwap() const @@ -1323,14 +1323,14 @@ return the photometric interpretation "; +%feature("docstring") gdcm::Bitmap::GetPixelFormat "PixelFormat& +gdcm::Bitmap::GetPixelFormat() "; + %feature("docstring") gdcm::Bitmap::GetPixelFormat "const PixelFormat& gdcm::Bitmap::GetPixelFormat() const Get/Set PixelFormat. "; -%feature("docstring") gdcm::Bitmap::GetPixelFormat "PixelFormat& -gdcm::Bitmap::GetPixelFormat() "; - %feature("docstring") gdcm::Bitmap::GetPlanarConfiguration "unsigned int gdcm::Bitmap::GetPlanarConfiguration() const @@ -1560,10 +1560,10 @@ C++ includes: gdcmByteSwapFilter.h "; -%feature("docstring") gdcm::ByteSwapFilter::ByteSwapFilter "gdcm::ByteSwapFilter::ByteSwapFilter(DataSet &ds) "; - %feature("docstring") gdcm::ByteSwapFilter::ByteSwapFilter "gdcm::ByteSwapFilter::ByteSwapFilter(const ByteSwapFilter &)=delete "; +%feature("docstring") gdcm::ByteSwapFilter::ByteSwapFilter "gdcm::ByteSwapFilter::ByteSwapFilter(DataSet &ds) "; + %feature("docstring") gdcm::ByteSwapFilter::~ByteSwapFilter "gdcm::ByteSwapFilter::~ByteSwapFilter() "; %feature("docstring") gdcm::ByteSwapFilter::ByteSwap "bool @@ -1611,12 +1611,12 @@ %feature("docstring") gdcm::ByteValue::GetPointer "const char* gdcm::ByteValue::GetPointer() const "; -%feature("docstring") gdcm::ByteValue::GetVoidPointer "const void* -gdcm::ByteValue::GetVoidPointer() const "; - %feature("docstring") gdcm::ByteValue::GetVoidPointer "void* gdcm::ByteValue::GetVoidPointer() "; +%feature("docstring") gdcm::ByteValue::GetVoidPointer "const void* +gdcm::ByteValue::GetVoidPointer() const "; + %feature("docstring") gdcm::ByteValue::IsEmpty "bool gdcm::ByteValue::IsEmpty() const "; @@ -1649,10 +1649,10 @@ To Print Values in Native DICOM format "; %feature("docstring") gdcm::ByteValue::Read "std::istream& -gdcm::ByteValue::Read(std::istream &is, bool readvalues=true) "; +gdcm::ByteValue::Read(std::istream &is) "; %feature("docstring") gdcm::ByteValue::Read "std::istream& -gdcm::ByteValue::Read(std::istream &is) "; +gdcm::ByteValue::Read(std::istream &is, bool readvalues=true) "; %feature("docstring") gdcm::ByteValue::SetLength "void gdcm::ByteValue::SetLength(VL vl) override "; @@ -1898,13 +1898,13 @@ CodeString constructors. "; +%feature("docstring") gdcm::CodeString::CodeString "gdcm::CodeString::CodeString(const InternalClass &s, size_type pos=0, +size_type n=InternalClass::npos) "; + %feature("docstring") gdcm::CodeString::CodeString "gdcm::CodeString::CodeString(const value_type *s) "; %feature("docstring") gdcm::CodeString::CodeString "gdcm::CodeString::CodeString(const value_type *s, size_type n) "; -%feature("docstring") gdcm::CodeString::CodeString "gdcm::CodeString::CodeString(const InternalClass &s, size_type pos=0, -size_type n=InternalClass::npos) "; - %feature("docstring") gdcm::CodeString::GetAsString "std::string gdcm::CodeString::GetAsString() const @@ -1933,17 +1933,17 @@ %feature("docstring") gdcm::Command::Command "gdcm::Command::Command(const Command &)=delete "; %feature("docstring") gdcm::Command::Execute "virtual void -gdcm::Command::Execute(Subject *caller, const Event &event)=0 - -Abstract method that defines the action to be taken by the command. "; - -%feature("docstring") gdcm::Command::Execute "virtual void gdcm::Command::Execute(const Subject *caller, const Event &event)=0 Abstract method that defines the action to be taken by the command. This variant is expected to be used when requests comes from a const Object "; +%feature("docstring") gdcm::Command::Execute "virtual void +gdcm::Command::Execute(Subject *caller, const Event &event)=0 + +Abstract method that defines the action to be taken by the command. "; + // File: classgdcm_1_1CommandDataSet.xml %feature("docstring") gdcm::CommandDataSet " @@ -2131,10 +2131,10 @@ C++ includes: gdcmCSAElement.h "; -%feature("docstring") gdcm::CSAElement::CSAElement "gdcm::CSAElement::CSAElement(unsigned int kf=0) "; - %feature("docstring") gdcm::CSAElement::CSAElement "gdcm::CSAElement::CSAElement(const CSAElement &_val) "; +%feature("docstring") gdcm::CSAElement::CSAElement "gdcm::CSAElement::CSAElement(unsigned int kf=0) "; + %feature("docstring") gdcm::CSAElement::GetByteValue "const ByteValue* gdcm::CSAElement::GetByteValue() const @@ -2161,14 +2161,14 @@ Set/Get SyngoDT. "; +%feature("docstring") gdcm::CSAElement::GetValue "Value& +gdcm::CSAElement::GetValue() "; + %feature("docstring") gdcm::CSAElement::GetValue "Value const& gdcm::CSAElement::GetValue() const Set/Get Value (bytes array, SQ of items, SQ of fragments): "; -%feature("docstring") gdcm::CSAElement::GetValue "Value& -gdcm::CSAElement::GetValue() "; - %feature("docstring") gdcm::CSAElement::GetVM "const VM& gdcm::CSAElement::GetVM() const @@ -2512,11 +2512,11 @@ C++ includes: gdcmDataElement.h "; +%feature("docstring") gdcm::DataElement::DataElement "gdcm::DataElement::DataElement(const DataElement &_val) "; + %feature("docstring") gdcm::DataElement::DataElement "gdcm::DataElement::DataElement(const Tag &t=Tag(0), const VL &vl=0, const VR &vr=VR::INVALID) "; -%feature("docstring") gdcm::DataElement::DataElement "gdcm::DataElement::DataElement(const DataElement &_val) "; - %feature("docstring") gdcm::DataElement::Clear "void gdcm::DataElement::Clear() @@ -2536,30 +2536,30 @@ %feature("docstring") gdcm::DataElement::GetLength "VL gdcm::DataElement::GetLength() const "; +%feature("docstring") gdcm::DataElement::GetSequenceOfFragments "SequenceOfFragments* gdcm::DataElement::GetSequenceOfFragments() "; + %feature("docstring") gdcm::DataElement::GetSequenceOfFragments "const SequenceOfFragments* gdcm::DataElement::GetSequenceOfFragments() const Return the Value of DataElement as a Sequence Of Fragments (if possible) WARNING: : You need to check for NULL return value "; -%feature("docstring") gdcm::DataElement::GetSequenceOfFragments "SequenceOfFragments* gdcm::DataElement::GetSequenceOfFragments() "; +%feature("docstring") gdcm::DataElement::GetTag "Tag& +gdcm::DataElement::GetTag() "; %feature("docstring") gdcm::DataElement::GetTag "const Tag& gdcm::DataElement::GetTag() const Get Tag. "; -%feature("docstring") gdcm::DataElement::GetTag "Tag& -gdcm::DataElement::GetTag() "; +%feature("docstring") gdcm::DataElement::GetValue "Value& +gdcm::DataElement::GetValue() "; %feature("docstring") gdcm::DataElement::GetValue "Value const& gdcm::DataElement::GetValue() const Set/Get Value (bytes array, SQ of items, SQ of fragments): "; -%feature("docstring") gdcm::DataElement::GetValue "Value& -gdcm::DataElement::GetValue() "; - %feature("docstring") gdcm::DataElement::GetValueAsSQ "SmartPointer gdcm::DataElement::GetValueAsSQ() const Interpret the Value stored in the DataElement. This is more robust @@ -2571,14 +2571,14 @@ for instance: SmartPointer sqi = de.GetValueAsSQ(); "; +%feature("docstring") gdcm::DataElement::GetVL "VL& +gdcm::DataElement::GetVL() "; + %feature("docstring") gdcm::DataElement::GetVL "const VL& gdcm::DataElement::GetVL() const Get VL. "; -%feature("docstring") gdcm::DataElement::GetVL "VL& -gdcm::DataElement::GetVL() "; - %feature("docstring") gdcm::DataElement::GetVR "VR const& gdcm::DataElement::GetVR() const @@ -2719,24 +2719,24 @@ C++ includes: gdcmDataSet.h "; -%feature("docstring") gdcm::DataSet::Begin "ConstIterator -gdcm::DataSet::Begin() const "; - %feature("docstring") gdcm::DataSet::Begin "Iterator gdcm::DataSet::Begin() "; +%feature("docstring") gdcm::DataSet::Begin "ConstIterator +gdcm::DataSet::Begin() const "; + %feature("docstring") gdcm::DataSet::Clear "void gdcm::DataSet::Clear() "; %feature("docstring") gdcm::DataSet::ComputeGroupLength "unsigned int gdcm::DataSet::ComputeGroupLength(Tag const &tag) const "; -%feature("docstring") gdcm::DataSet::End "ConstIterator -gdcm::DataSet::End() const "; - %feature("docstring") gdcm::DataSet::End "Iterator gdcm::DataSet::End() "; +%feature("docstring") gdcm::DataSet::End "ConstIterator +gdcm::DataSet::End() const "; + %feature("docstring") gdcm::DataSet::FindDataElement "bool gdcm::DataSet::FindDataElement(const PrivateTag &t) const @@ -2749,22 +2749,22 @@ DataElement& gdcm::DataSet::FindNextDataElement(const Tag &t) const "; %feature("docstring") gdcm::DataSet::GetDataElement "const +DataElement& gdcm::DataSet::GetDataElement(const PrivateTag &t) const + +Return the dataelement. "; + +%feature("docstring") gdcm::DataSet::GetDataElement "const DataElement& gdcm::DataSet::GetDataElement(const Tag &t) const Return the DataElement with Tag 't' WARNING: : This only search at the 'root level' of the DataSet "; -%feature("docstring") gdcm::DataSet::GetDataElement "const -DataElement& gdcm::DataSet::GetDataElement(const PrivateTag &t) const - -Return the dataelement. "; +%feature("docstring") gdcm::DataSet::GetDES "DataElementSet& +gdcm::DataSet::GetDES() "; %feature("docstring") gdcm::DataSet::GetDES "const DataElementSet& gdcm::DataSet::GetDES() const "; -%feature("docstring") gdcm::DataSet::GetDES "DataElementSet& -gdcm::DataSet::GetDES() "; - %feature("docstring") gdcm::DataSet::GetLength "VL gdcm::DataSet::GetLength() const "; @@ -2856,10 +2856,10 @@ C++ includes: gdcmDataSetEvent.h "; -%feature("docstring") gdcm::DataSetEvent::DataSetEvent "gdcm::DataSetEvent::DataSetEvent(DataSet const *ds=nullptr) "; - %feature("docstring") gdcm::DataSetEvent::DataSetEvent "gdcm::DataSetEvent::DataSetEvent(const Self &s) "; +%feature("docstring") gdcm::DataSetEvent::DataSetEvent "gdcm::DataSetEvent::DataSetEvent(DataSet const *ds=nullptr) "; + %feature("docstring") gdcm::DataSetEvent::~DataSetEvent "gdcm::DataSetEvent::~DataSetEvent() override=default "; %feature("docstring") gdcm::DataSetEvent::CheckEvent "bool @@ -2951,11 +2951,14 @@ %feature("docstring") gdcm::Defs::GetIODFromFile "const IOD& gdcm::Defs::GetIODFromFile(const File &file) const "; +%feature("docstring") gdcm::Defs::GetIODs "IODs& +gdcm::Defs::GetIODs() "; + %feature("docstring") gdcm::Defs::GetIODs "const IODs& gdcm::Defs::GetIODs() const "; -%feature("docstring") gdcm::Defs::GetIODs "IODs& -gdcm::Defs::GetIODs() "; +%feature("docstring") gdcm::Defs::GetMacros "Macros& +gdcm::Defs::GetMacros() "; %feature("docstring") gdcm::Defs::GetMacros "const Macros& gdcm::Defs::GetMacros() const @@ -2964,15 +2967,12 @@ WG to re-use Tables. Macros are conviently wraped within Modules. See gdcm::Module API directly "; -%feature("docstring") gdcm::Defs::GetMacros "Macros& -gdcm::Defs::GetMacros() "; +%feature("docstring") gdcm::Defs::GetModules "Modules& +gdcm::Defs::GetModules() "; %feature("docstring") gdcm::Defs::GetModules "const Modules& gdcm::Defs::GetModules() const "; -%feature("docstring") gdcm::Defs::GetModules "Modules& -gdcm::Defs::GetModules() "; - %feature("docstring") gdcm::Defs::GetTypeFromTag "Type gdcm::Defs::GetTypeFromTag(const File &file, const Tag &tag) const "; @@ -2980,10 +2980,10 @@ gdcm::Defs::IsEmpty() const "; %feature("docstring") gdcm::Defs::Verify "bool -gdcm::Defs::Verify(const File &file) const "; +gdcm::Defs::Verify(const DataSet &ds) const "; %feature("docstring") gdcm::Defs::Verify "bool -gdcm::Defs::Verify(const DataSet &ds) const "; +gdcm::Defs::Verify(const File &file) const "; // File: classgdcm_1_1DeltaEncodingCodec.xml @@ -3130,7 +3130,7 @@ const Inefficient way of looking up tag by name. Technically DICOM does not -garantee uniqueness (and Curve / Overlay are there to prove it). But +guarantee uniqueness (and Curve / Overlay are there to prove it). But most of the time name is in fact uniq and can be uniquely link to a tag "; @@ -3148,7 +3148,7 @@ Class to convert a .dic file into something else: -CXX code : embeded dict into shared lib (DICT_DEFAULT) +CXX code : embed dict into shared lib (DICT_DEFAULT) Debug mode (DICT_DEBUG) @@ -3301,24 +3301,24 @@ CSAHeaderDict& gdcm::Dicts::GetCSAHeaderDict() const "; %feature("docstring") gdcm::Dicts::GetDictEntry "const DictEntry& +gdcm::Dicts::GetDictEntry(const PrivateTag &tag) const "; + +%feature("docstring") gdcm::Dicts::GetDictEntry "const DictEntry& gdcm::Dicts::GetDictEntry(const Tag &tag, const char *owner=nullptr) const -NOT THREAD SAFE. +THREAD SAFE. works for both public and private dicts: owner is null for public dict WARNING: owner need to be set to appropriate owner for call to work. see "; -%feature("docstring") gdcm::Dicts::GetDictEntry "const DictEntry& -gdcm::Dicts::GetDictEntry(const PrivateTag &tag) const "; +%feature("docstring") gdcm::Dicts::GetPrivateDict "PrivateDict& +gdcm::Dicts::GetPrivateDict() "; %feature("docstring") gdcm::Dicts::GetPrivateDict "const PrivateDict& gdcm::Dicts::GetPrivateDict() const "; -%feature("docstring") gdcm::Dicts::GetPrivateDict "PrivateDict& -gdcm::Dicts::GetPrivateDict() "; - %feature("docstring") gdcm::Dicts::GetPublicDict "const Dict& gdcm::Dicts::GetPublicDict() const "; @@ -3501,13 +3501,13 @@ %feature("docstring") gdcm::Element::GetLength "unsigned long gdcm::Element< TVR, TVM >::GetLength() const "; +%feature("docstring") gdcm::Element::GetValue "VRToType::Type& +gdcm::Element< TVR, TVM >::GetValue(unsigned int idx=0) "; + %feature("docstring") gdcm::Element::GetValue "const VRToType::Type& gdcm::Element< TVR, TVM >::GetValue(unsigned int idx=0) const "; -%feature("docstring") gdcm::Element::GetValue "VRToType::Type& -gdcm::Element< TVR, TVM >::GetValue(unsigned int idx=0) "; - %feature("docstring") gdcm::Element::GetValues "const VRToType::Type* gdcm::Element< TVR, TVM >::GetValues() const "; @@ -3561,13 +3561,13 @@ unsigned long gdcm::Element< TVR, VM::VM1_n >::GetLength() const "; %feature("docstring") gdcm::Element< TVR, VM::VM1_n >::GetValue " -const VRToType::Type& gdcm::Element< TVR, VM::VM1_n ->::GetValue(unsigned int idx=0) const "; - -%feature("docstring") gdcm::Element< TVR, VM::VM1_n >::GetValue " VRToType::Type& gdcm::Element< TVR, VM::VM1_n >::GetValue(unsigned int idx=0) "; +%feature("docstring") gdcm::Element< TVR, VM::VM1_n >::GetValue " +const VRToType::Type& gdcm::Element< TVR, VM::VM1_n +>::GetValue(unsigned int idx=0) const "; + %feature("docstring") gdcm::Element< TVR, VM::VM1_n >::Print " void gdcm::Element< TVR, VM::VM1_n >::Print(std::ostream &_os) const "; @@ -3624,6 +3624,14 @@ void gdcm::Element< TVR, VM::VM3_3n >::SetLength(int len) "; +// File: classgdcm_1_1Element_3_01TVR_00_01VM_1_1VM3__4_01_4.xml +%feature("docstring") gdcm::Element< TVR, VM::VM3_4 > " C++ includes: +gdcmElement.h "; + +%feature("docstring") gdcm::Element< TVR, VM::VM3_4 >::SetLength " +void gdcm::Element< TVR, VM::VM3_4 >::SetLength(int len) "; + + // File: classgdcm_1_1Element_3_01TVR_00_01VM_1_1VM3__n_01_4.xml %feature("docstring") gdcm::Element< TVR, VM::VM3_n > " C++ includes: gdcmElement.h "; @@ -3751,9 +3759,7 @@ EncodingImplementation. -TODO - -C++ includes: gdcmElement.h "; +TODO "; // File: classgdcm_1_1EncodingImplementation_3_01VR_1_1VRASCII_01_4.xml @@ -3799,8 +3805,9 @@ // File: classgdcm_1_1EquipmentManufacturer.xml -%feature("docstring") gdcm::EquipmentManufacturer "C++ includes: -gdcmEquipmentManufacturer.h "; +%feature("docstring") gdcm::EquipmentManufacturer " + +C++ includes: gdcmEquipmentManufacturer.h "; // File: classgdcm_1_1Event.xml @@ -3967,26 +3974,26 @@ %feature("docstring") gdcm::File::~File "gdcm::File::~File() override "; -%feature("docstring") gdcm::File::GetDataSet "const DataSet& -gdcm::File::GetDataSet() const - -Get Data Set. "; - %feature("docstring") gdcm::File::GetDataSet "DataSet& gdcm::File::GetDataSet() Get Data Set. "; -%feature("docstring") gdcm::File::GetHeader "const -FileMetaInformation& gdcm::File::GetHeader() const +%feature("docstring") gdcm::File::GetDataSet "const DataSet& +gdcm::File::GetDataSet() const -Get File Meta Information. "; +Get Data Set. "; %feature("docstring") gdcm::File::GetHeader "FileMetaInformation& gdcm::File::GetHeader() Get File Meta Information. "; +%feature("docstring") gdcm::File::GetHeader "const +FileMetaInformation& gdcm::File::GetHeader() const + +Get File Meta Information. "; + %feature("docstring") gdcm::File::Read "std::istream& gdcm::File::Read(std::istream &is) @@ -4050,19 +4057,19 @@ remove a tag (even a SQ can be removed) "; %feature("docstring") gdcm::FileAnonymizer::Replace "void -gdcm::FileAnonymizer::Replace(Tag const &t, const char *value_str) - -Replace tag with another value, if tag is not found it will be -created: WARNING: this function can only execute if tag is a VRASCII -WARNING: Do not ever try to write a value in a SQ Data Element ! "; - -%feature("docstring") gdcm::FileAnonymizer::Replace "void gdcm::FileAnonymizer::Replace(Tag const &t, const char *value_data, VL const &vl) when the value contains \\\\0, it is a good idea to specify the length. This function is required when dealing with VRBINARY tag "; +%feature("docstring") gdcm::FileAnonymizer::Replace "void +gdcm::FileAnonymizer::Replace(Tag const &t, const char *value_str) + +Replace tag with another value, if tag is not found it will be +created: WARNING: this function can only execute if tag is a VRASCII +WARNING: Do not ever try to write a value in a SQ Data Element ! "; + %feature("docstring") gdcm::FileAnonymizer::SetInputFileName "void gdcm::FileAnonymizer::SetInputFileName(const char *filename_native) @@ -4162,10 +4169,10 @@ %feature("docstring") gdcm::FileDecompressLookupTable::GetFile "File& gdcm::FileDecompressLookupTable::GetFile() "; -%feature("docstring") gdcm::FileDecompressLookupTable::GetPixmap "const Pixmap& gdcm::FileDecompressLookupTable::GetPixmap() const "; - %feature("docstring") gdcm::FileDecompressLookupTable::GetPixmap "Pixmap& gdcm::FileDecompressLookupTable::GetPixmap() "; +%feature("docstring") gdcm::FileDecompressLookupTable::GetPixmap "const Pixmap& gdcm::FileDecompressLookupTable::GetPixmap() const "; + %feature("docstring") gdcm::FileDecompressLookupTable::SetFile "void gdcm::FileDecompressLookupTable::SetFile(const File &f) @@ -4369,13 +4376,13 @@ "TransferSyntax::NegociatedType gdcm::FileMetaInformation::GetMetaInformationTS() const "; +%feature("docstring") gdcm::FileMetaInformation::GetPreamble "Preamble& gdcm::FileMetaInformation::GetPreamble() "; + %feature("docstring") gdcm::FileMetaInformation::GetPreamble "const Preamble& gdcm::FileMetaInformation::GetPreamble() const Get Preamble. "; -%feature("docstring") gdcm::FileMetaInformation::GetPreamble "Preamble& gdcm::FileMetaInformation::GetPreamble() "; - %feature("docstring") gdcm::FileMetaInformation::Insert "void gdcm::FileMetaInformation::Insert(const DataElement &de) "; @@ -4568,17 +4575,17 @@ %feature("docstring") gdcm::FileSet::FileSet "gdcm::FileSet::FileSet() "; -%feature("docstring") gdcm::FileSet::AddFile "void -gdcm::FileSet::AddFile(File const &) - -Deprecated . Does nothing "; - %feature("docstring") gdcm::FileSet::AddFile "bool gdcm::FileSet::AddFile(const char *filename) Add a file 'filename' to the list of files. Return true on success, false in case filename could not be found on system. "; +%feature("docstring") gdcm::FileSet::AddFile "void +gdcm::FileSet::AddFile(File const &) + +Deprecated . Does nothing "; + %feature("docstring") gdcm::FileSet::GetFiles "FilesType const& gdcm::FileSet::GetFiles() const "; @@ -4679,7 +4686,10 @@ allowed by DICOM (= 2^32). startoffset can be used to specify the very first element you want to start with (instead of the first possible). Value should be in [0x0, 0xff] This will find the first available -private creator. "; +private creator. + +Bug maxsizede should be a value lower than the actual total size of +the buffer to be copied "; %feature("docstring") gdcm::FileStreamer::StopDataElement "bool gdcm::FileStreamer::StopDataElement(const Tag &t) @@ -4857,15 +4867,15 @@ retrieve the default/internal (Part 3) You need to explicitly call LoadResourcesFiles before "; +%feature("docstring") gdcm::Global::GetDicts "Dicts& +gdcm::Global::GetDicts() "; + %feature("docstring") gdcm::Global::GetDicts "Dicts const& gdcm::Global::GetDicts() const retrieve the default/internal dicts (Part 6) This dict is filled up at load time "; -%feature("docstring") gdcm::Global::GetDicts "Dicts& -gdcm::Global::GetDicts() "; - %feature("docstring") gdcm::Global::LoadResourcesFiles "bool gdcm::Global::LoadResourcesFiles() @@ -5130,10 +5140,10 @@ print "; %feature("docstring") gdcm::Image::SetDirectionCosines "void -gdcm::Image::SetDirectionCosines(const float dircos[6]) "; +gdcm::Image::SetDirectionCosines(const double dircos[6]) "; %feature("docstring") gdcm::Image::SetDirectionCosines "void -gdcm::Image::SetDirectionCosines(const double dircos[6]) "; +gdcm::Image::SetDirectionCosines(const float dircos[6]) "; %feature("docstring") gdcm::Image::SetDirectionCosines "void gdcm::Image::SetDirectionCosines(unsigned int idx, double dircos) "; @@ -5144,10 +5154,10 @@ intercept "; %feature("docstring") gdcm::Image::SetOrigin "void -gdcm::Image::SetOrigin(const float origin[3]) "; +gdcm::Image::SetOrigin(const double origin[3]) "; %feature("docstring") gdcm::Image::SetOrigin "void -gdcm::Image::SetOrigin(const double origin[3]) "; +gdcm::Image::SetOrigin(const float origin[3]) "; %feature("docstring") gdcm::Image::SetOrigin "void gdcm::Image::SetOrigin(unsigned int idx, double ori) "; @@ -5408,12 +5418,12 @@ gdcm::ImageCodec::IsLossy() const "; %feature("docstring") gdcm::ImageCodec::SetDimensions "void -gdcm::ImageCodec::SetDimensions(const unsigned int d[3]) "; - -%feature("docstring") gdcm::ImageCodec::SetDimensions "void gdcm::ImageCodec::SetDimensions(const std::vector< unsigned int > &d) "; +%feature("docstring") gdcm::ImageCodec::SetDimensions "void +gdcm::ImageCodec::SetDimensions(const unsigned int d[3]) "; + %feature("docstring") gdcm::ImageCodec::SetLossyFlag "void gdcm::ImageCodec::SetLossyFlag(bool l) "; @@ -5544,14 +5554,14 @@ %feature("docstring") gdcm::ImageReader::~ImageReader "gdcm::ImageReader::~ImageReader() override "; +%feature("docstring") gdcm::ImageReader::GetImage "Image& +gdcm::ImageReader::GetImage() "; + %feature("docstring") gdcm::ImageReader::GetImage "const Image& gdcm::ImageReader::GetImage() const Return the read image. "; -%feature("docstring") gdcm::ImageReader::GetImage "Image& -gdcm::ImageReader::GetImage() "; - %feature("docstring") gdcm::ImageReader::Read "bool gdcm::ImageReader::Read() override @@ -6040,12 +6050,12 @@ %feature("docstring") gdcm::Item::GetLength "VL gdcm::Item::GetLength() const "; -%feature("docstring") gdcm::Item::GetNestedDataSet "const DataSet& -gdcm::Item::GetNestedDataSet() const "; - %feature("docstring") gdcm::Item::GetNestedDataSet "DataSet& gdcm::Item::GetNestedDataSet() "; +%feature("docstring") gdcm::Item::GetNestedDataSet "const DataSet& +gdcm::Item::GetNestedDataSet() const "; + %feature("docstring") gdcm::Item::InsertDataElement "void gdcm::Item::InsertDataElement(const DataElement &de) "; @@ -6169,6 +6179,9 @@ %feature("docstring") gdcm::JPEG2000Codec::GetRate "double gdcm::JPEG2000Codec::GetRate(unsigned int idx=0) const "; +%feature("docstring") gdcm::JPEG2000Codec::SetMCT "void +gdcm::JPEG2000Codec::SetMCT(unsigned int mct) "; + %feature("docstring") gdcm::JPEG2000Codec::SetNumberOfResolutions "void gdcm::JPEG2000Codec::SetNumberOfResolutions(unsigned int nres) "; %feature("docstring") @@ -6344,16 +6357,16 @@ Code. "; %feature("docstring") gdcm::JPEGLSCodec::Decode "bool +gdcm::JPEGLSCodec::Decode(DataElement const &in, char *outBuffer, +size_t inBufferLength, uint32_t inXMin, uint32_t inXMax, uint32_t +inYMin, uint32_t inYMax, uint32_t inZMin, uint32_t inZMax) "; + +%feature("docstring") gdcm::JPEGLSCodec::Decode "bool gdcm::JPEGLSCodec::Decode(DataElement const &is, DataElement &os) override Decode. "; -%feature("docstring") gdcm::JPEGLSCodec::Decode "bool -gdcm::JPEGLSCodec::Decode(DataElement const &in, char *outBuffer, -size_t inBufferLength, uint32_t inXMin, uint32_t inXMax, uint32_t -inYMin, uint32_t inYMax, uint32_t inZMin, uint32_t inZMax) "; - %feature("docstring") gdcm::JPEGLSCodec::GetBufferLength "unsigned long gdcm::JPEGLSCodec::GetBufferLength() const "; @@ -6452,15 +6465,15 @@ %feature("docstring") gdcm::LO::LO "gdcm::LO::LO() "; +%feature("docstring") gdcm::LO::LO "gdcm::LO::LO(const Superclass +&s, size_type pos=0, size_type n=npos) "; + %feature("docstring") gdcm::LO::LO "gdcm::LO::LO(const value_type *s) "; %feature("docstring") gdcm::LO::LO "gdcm::LO::LO(const value_type *s, size_type n) "; -%feature("docstring") gdcm::LO::LO "gdcm::LO::LO(const Superclass -&s, size_type pos=0, size_type n=npos) "; - %feature("docstring") gdcm::LO::IsValid "bool gdcm::LO::IsValid() const "; @@ -6488,11 +6501,6 @@ Clear the LUT. "; -%feature("docstring") gdcm::LookupTable::Decode "void -gdcm::LookupTable::Decode(std::istream &is, std::ostream &os) const - -Decode the LUT. "; - %feature("docstring") gdcm::LookupTable::Decode "bool gdcm::LookupTable::Decode(char *outputbuffer, size_t outlen, const char *inputbuffer, size_t inlen) const @@ -6501,6 +6509,11 @@ COLOR input image of size inlen the outputbuffer should be at least 3 times the size of inlen "; +%feature("docstring") gdcm::LookupTable::Decode "void +gdcm::LookupTable::Decode(std::istream &is, std::ostream &os) const + +Decode the LUT. "; + %feature("docstring") gdcm::LookupTable::Decode8 "bool gdcm::LookupTable::Decode8(char *outputbuffer, size_t outlen, const char *inputbuffer, size_t inlen) const @@ -6790,16 +6803,20 @@ %feature("docstring") gdcm::MemberCommand::MemberCommand "gdcm::MemberCommand< T >::MemberCommand(const Self &)=delete "; %feature("docstring") gdcm::MemberCommand::Execute "void +gdcm::MemberCommand< T >::Execute(const Subject *caller, const Event +&event) override + +Invoke the member function with a const object. "; + +%feature("docstring") gdcm::MemberCommand::Execute "void gdcm::MemberCommand< T >::Execute(Subject *caller, const Event &event) override Invoke the member function. "; -%feature("docstring") gdcm::MemberCommand::Execute "void -gdcm::MemberCommand< T >::Execute(const Subject *caller, const Event -&event) override - -Invoke the member function with a const object. "; +%feature("docstring") gdcm::MemberCommand::SetCallbackFunction "void +gdcm::MemberCommand< T >::SetCallbackFunction(T *object, +TConstMemberFunctionPointer memberFunction) "; %feature("docstring") gdcm::MemberCommand::SetCallbackFunction "void gdcm::MemberCommand< T >::SetCallbackFunction(T *object, @@ -6808,10 +6825,6 @@ Run-time type information (and related methods). Set the callback function along with the object that it will be invoked on. "; -%feature("docstring") gdcm::MemberCommand::SetCallbackFunction "void -gdcm::MemberCommand< T >::SetCallbackFunction(T *object, -TConstMemberFunctionPointer memberFunction) "; - // File: classgdcm_1_1MeshPrimitive.xml %feature("docstring") gdcm::MeshPrimitive " @@ -6835,33 +6848,33 @@ "unsigned int gdcm::MeshPrimitive::GetNumberOfPrimitivesData() const "; +%feature("docstring") gdcm::MeshPrimitive::GetPrimitiveData "DataElement& gdcm::MeshPrimitive::GetPrimitiveData() "; + %feature("docstring") gdcm::MeshPrimitive::GetPrimitiveData "const DataElement& gdcm::MeshPrimitive::GetPrimitiveData() const "; -%feature("docstring") gdcm::MeshPrimitive::GetPrimitiveData "DataElement& gdcm::MeshPrimitive::GetPrimitiveData() "; +%feature("docstring") gdcm::MeshPrimitive::GetPrimitiveData "DataElement& gdcm::MeshPrimitive::GetPrimitiveData(const unsigned int +idx) "; %feature("docstring") gdcm::MeshPrimitive::GetPrimitiveData "const DataElement& gdcm::MeshPrimitive::GetPrimitiveData(const unsigned int idx) const "; -%feature("docstring") gdcm::MeshPrimitive::GetPrimitiveData "DataElement& gdcm::MeshPrimitive::GetPrimitiveData(const unsigned int -idx) "; +%feature("docstring") gdcm::MeshPrimitive::GetPrimitivesData "PrimitivesData& gdcm::MeshPrimitive::GetPrimitivesData() "; %feature("docstring") gdcm::MeshPrimitive::GetPrimitivesData "const PrimitivesData& gdcm::MeshPrimitive::GetPrimitivesData() const "; -%feature("docstring") gdcm::MeshPrimitive::GetPrimitivesData "PrimitivesData& gdcm::MeshPrimitive::GetPrimitivesData() "; - %feature("docstring") gdcm::MeshPrimitive::GetPrimitiveType "MPType gdcm::MeshPrimitive::GetPrimitiveType() const "; %feature("docstring") gdcm::MeshPrimitive::SetPrimitiveData "void -gdcm::MeshPrimitive::SetPrimitiveData(DataElement const &de) "; - -%feature("docstring") gdcm::MeshPrimitive::SetPrimitiveData "void gdcm::MeshPrimitive::SetPrimitiveData(const unsigned int idx, DataElement const &de) "; +%feature("docstring") gdcm::MeshPrimitive::SetPrimitiveData "void +gdcm::MeshPrimitive::SetPrimitiveData(DataElement const &de) "; + %feature("docstring") gdcm::MeshPrimitive::SetPrimitivesData "void gdcm::MeshPrimitive::SetPrimitivesData(PrimitivesData const &DEs) "; @@ -7278,12 +7291,12 @@ %feature("docstring") gdcm::NestedModuleEntries::AddModuleEntry "void gdcm::NestedModuleEntries::AddModuleEntry(const ModuleEntry &me) "; -%feature("docstring") gdcm::NestedModuleEntries::GetModuleEntry "const ModuleEntry& gdcm::NestedModuleEntries::GetModuleEntry(SizeType -idx) const "; - %feature("docstring") gdcm::NestedModuleEntries::GetModuleEntry "ModuleEntry& gdcm::NestedModuleEntries::GetModuleEntry(SizeType idx) "; +%feature("docstring") gdcm::NestedModuleEntries::GetModuleEntry "const ModuleEntry& gdcm::NestedModuleEntries::GetModuleEntry(SizeType +idx) const "; + %feature("docstring") gdcm::NestedModuleEntries::GetNumberOfModuleEntries "SizeType gdcm::NestedModuleEntries::GetNumberOfModuleEntries() "; @@ -7779,6 +7792,8 @@ %feature("docstring") gdcm::ParseException::ParseException "gdcm::ParseException::ParseException()=default "; +%feature("docstring") gdcm::ParseException::ParseException "gdcm::ParseException::ParseException(const ParseException &orig) "; + %feature("docstring") gdcm::ParseException::~ParseException "gdcm::ParseException::~ParseException() override throw ()"; %feature("docstring") gdcm::ParseException::GetLastElement "const @@ -8118,12 +8133,12 @@ %feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat() "; +%feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat(ScalarType st) "; + %feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat(unsigned short samplesperpixel, unsigned short bitsallocated=8, unsigned short bitsstored=8, unsigned short highbit=7, unsigned short pixelrepresentation=0) "; -%feature("docstring") gdcm::PixelFormat::PixelFormat "gdcm::PixelFormat::PixelFormat(ScalarType st) "; - %feature("docstring") gdcm::PixelFormat::GetBitsAllocated "unsigned short gdcm::PixelFormat::GetBitsAllocated() const @@ -8244,14 +8259,14 @@ %feature("docstring") gdcm::Pixmap::GetCurve "const Curve& gdcm::Pixmap::GetCurve(size_t i=0) const "; +%feature("docstring") gdcm::Pixmap::GetIconImage "IconImage& +gdcm::Pixmap::GetIconImage() "; + %feature("docstring") gdcm::Pixmap::GetIconImage "const IconImage& gdcm::Pixmap::GetIconImage() const Set/Get Icon Image. "; -%feature("docstring") gdcm::Pixmap::GetIconImage "IconImage& -gdcm::Pixmap::GetIconImage() "; - %feature("docstring") gdcm::Pixmap::GetNumberOfCurves "size_t gdcm::Pixmap::GetNumberOfCurves() const "; @@ -8307,14 +8322,14 @@ %feature("docstring") gdcm::PixmapReader::~PixmapReader "gdcm::PixmapReader::~PixmapReader() override "; +%feature("docstring") gdcm::PixmapReader::GetPixmap "Pixmap& +gdcm::PixmapReader::GetPixmap() "; + %feature("docstring") gdcm::PixmapReader::GetPixmap "const Pixmap& gdcm::PixmapReader::GetPixmap() const Return the read image (need to call Read() first) "; -%feature("docstring") gdcm::PixmapReader::GetPixmap "Pixmap& -gdcm::PixmapReader::GetPixmap() "; - %feature("docstring") gdcm::PixmapReader::Read "bool gdcm::PixmapReader::Read() override @@ -8371,21 +8386,21 @@ %feature("docstring") gdcm::PixmapWriter::~PixmapWriter "gdcm::PixmapWriter::~PixmapWriter() override "; +%feature("docstring") gdcm::PixmapWriter::GetImage "virtual Pixmap& +gdcm::PixmapWriter::GetImage() "; + %feature("docstring") gdcm::PixmapWriter::GetImage "virtual const Pixmap& gdcm::PixmapWriter::GetImage() const Set/Get Pixmap to be written It will overwrite anything Pixmap infos found in DataSet (see parent class to see how to pass dataset) "; -%feature("docstring") gdcm::PixmapWriter::GetImage "virtual Pixmap& -gdcm::PixmapWriter::GetImage() "; +%feature("docstring") gdcm::PixmapWriter::GetPixmap "Pixmap& +gdcm::PixmapWriter::GetPixmap() "; %feature("docstring") gdcm::PixmapWriter::GetPixmap "const Pixmap& gdcm::PixmapWriter::GetPixmap() const "; -%feature("docstring") gdcm::PixmapWriter::GetPixmap "Pixmap& -gdcm::PixmapWriter::GetPixmap() "; - %feature("docstring") gdcm::PixmapWriter::SetImage "virtual void gdcm::PixmapWriter::SetImage(Pixmap const &img) "; @@ -8698,6 +8713,10 @@ gdcm::network::PresentationContextRQ::PresentationContextRQ "gdcm::network::PresentationContextRQ::PresentationContextRQ() "; %feature("docstring") +gdcm::network::PresentationContextRQ::PresentationContextRQ "gdcm::network::PresentationContextRQ::PresentationContextRQ(const +PresentationContext &pc) "; + +%feature("docstring") gdcm::network::PresentationContextRQ::PresentationContextRQ "gdcm::network::PresentationContextRQ::PresentationContextRQ(UIDs::TSName asname, UIDs::TSName tsname=UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM) @@ -8707,23 +8726,19 @@ LittleEndian when not specified ). "; %feature("docstring") -gdcm::network::PresentationContextRQ::PresentationContextRQ "gdcm::network::PresentationContextRQ::PresentationContextRQ(const -PresentationContext &pc) "; - -%feature("docstring") gdcm::network::PresentationContextRQ::AddTransferSyntax "void gdcm::network::PresentationContextRQ::AddTransferSyntax(TransferSyntaxSub const &ts) "; %feature("docstring") -gdcm::network::PresentationContextRQ::GetAbstractSyntax "AbstractSyntax const& -gdcm::network::PresentationContextRQ::GetAbstractSyntax() const "; - -%feature("docstring") gdcm::network::PresentationContextRQ::GetAbstractSyntax "AbstractSyntax& gdcm::network::PresentationContextRQ::GetAbstractSyntax() "; %feature("docstring") +gdcm::network::PresentationContextRQ::GetAbstractSyntax "AbstractSyntax const& +gdcm::network::PresentationContextRQ::GetAbstractSyntax() const "; + +%feature("docstring") gdcm::network::PresentationContextRQ::GetNumberOfTransferSyntaxes "SizeType gdcm::network::PresentationContextRQ::GetNumberOfTransferSyntaxes() const "; @@ -8734,15 +8749,15 @@ "; %feature("docstring") +gdcm::network::PresentationContextRQ::GetTransferSyntax "TransferSyntaxSub& +gdcm::network::PresentationContextRQ::GetTransferSyntax(SizeType i) "; + +%feature("docstring") gdcm::network::PresentationContextRQ::GetTransferSyntax "TransferSyntaxSub const& gdcm::network::PresentationContextRQ::GetTransferSyntax(SizeType i) const "; %feature("docstring") -gdcm::network::PresentationContextRQ::GetTransferSyntax "TransferSyntaxSub& -gdcm::network::PresentationContextRQ::GetTransferSyntax(SizeType i) "; - -%feature("docstring") gdcm::network::PresentationContextRQ::GetTransferSyntaxes "std::vector const& gdcm::network::PresentationContextRQ::GetTransferSyntaxes() const "; @@ -8934,11 +8949,11 @@ C++ includes: gdcmPrivateTag.h "; +%feature("docstring") gdcm::PrivateTag::PrivateTag "gdcm::PrivateTag::PrivateTag(Tag const &t, const char *owner=\"\") "; + %feature("docstring") gdcm::PrivateTag::PrivateTag "gdcm::PrivateTag::PrivateTag(uint16_t group=0, uint16_t element=0, const char *owner=\"\") "; -%feature("docstring") gdcm::PrivateTag::PrivateTag "gdcm::PrivateTag::PrivateTag(Tag const &t, const char *owner=\"\") "; - %feature("docstring") gdcm::PrivateTag::GetAsDataElement "DataElement gdcm::PrivateTag::GetAsDataElement() const "; %feature("docstring") gdcm::PrivateTag::GetOwner "const char* @@ -8965,10 +8980,10 @@ C++ includes: gdcmProgressEvent.h "; -%feature("docstring") gdcm::ProgressEvent::ProgressEvent "gdcm::ProgressEvent::ProgressEvent(double p=0) "; - %feature("docstring") gdcm::ProgressEvent::ProgressEvent "gdcm::ProgressEvent::ProgressEvent(const Self &s) "; +%feature("docstring") gdcm::ProgressEvent::ProgressEvent "gdcm::ProgressEvent::ProgressEvent(double p=0) "; + %feature("docstring") gdcm::ProgressEvent::~ProgressEvent "gdcm::ProgressEvent::~ProgressEvent() override=default "; %feature("docstring") gdcm::ProgressEvent::CheckEvent "bool @@ -9387,13 +9402,13 @@ Test whether this is a DICOM file WARNING: need to call either SetFileName or SetStream first "; -%feature("docstring") gdcm::Reader::GetFile "const File& -gdcm::Reader::GetFile() const +%feature("docstring") gdcm::Reader::GetFile "File& +gdcm::Reader::GetFile() Set/Get File. "; -%feature("docstring") gdcm::Reader::GetFile "File& -gdcm::Reader::GetFile() +%feature("docstring") gdcm::Reader::GetFile "const File& +gdcm::Reader::GetFile() const Set/Get File. "; @@ -9851,32 +9866,32 @@ %feature("docstring") gdcm::Segment::AddSurface "void gdcm::Segment::AddSurface(SmartPointer< Surface > surface) "; +%feature("docstring") gdcm::Segment::GetAnatomicRegion "SegmentHelper::BasicCodedEntry& gdcm::Segment::GetAnatomicRegion() "; + %feature("docstring") gdcm::Segment::GetAnatomicRegion "SegmentHelper::BasicCodedEntry const& gdcm::Segment::GetAnatomicRegion() const "; -%feature("docstring") gdcm::Segment::GetAnatomicRegion "SegmentHelper::BasicCodedEntry& gdcm::Segment::GetAnatomicRegion() "; +%feature("docstring") gdcm::Segment::GetAnatomicRegionModifiers "BasicCodedEntryVector& gdcm::Segment::GetAnatomicRegionModifiers() "; %feature("docstring") gdcm::Segment::GetAnatomicRegionModifiers "BasicCodedEntryVector const& gdcm::Segment::GetAnatomicRegionModifiers() const "; -%feature("docstring") gdcm::Segment::GetAnatomicRegionModifiers "BasicCodedEntryVector& gdcm::Segment::GetAnatomicRegionModifiers() "; +%feature("docstring") gdcm::Segment::GetPropertyCategory "SegmentHelper::BasicCodedEntry& gdcm::Segment::GetPropertyCategory() +"; %feature("docstring") gdcm::Segment::GetPropertyCategory "SegmentHelper::BasicCodedEntry const& gdcm::Segment::GetPropertyCategory() const "; -%feature("docstring") gdcm::Segment::GetPropertyCategory "SegmentHelper::BasicCodedEntry& gdcm::Segment::GetPropertyCategory() -"; +%feature("docstring") gdcm::Segment::GetPropertyType "SegmentHelper::BasicCodedEntry& gdcm::Segment::GetPropertyType() "; %feature("docstring") gdcm::Segment::GetPropertyType "SegmentHelper::BasicCodedEntry const& gdcm::Segment::GetPropertyType() const "; -%feature("docstring") gdcm::Segment::GetPropertyType "SegmentHelper::BasicCodedEntry& gdcm::Segment::GetPropertyType() "; +%feature("docstring") gdcm::Segment::GetPropertyTypeModifiers "BasicCodedEntryVector& gdcm::Segment::GetPropertyTypeModifiers() "; %feature("docstring") gdcm::Segment::GetPropertyTypeModifiers "BasicCodedEntryVector const& gdcm::Segment::GetPropertyTypeModifiers() const "; -%feature("docstring") gdcm::Segment::GetPropertyTypeModifiers "BasicCodedEntryVector& gdcm::Segment::GetPropertyTypeModifiers() "; - %feature("docstring") gdcm::Segment::GetSegmentAlgorithmName "const char* gdcm::Segment::GetSegmentAlgorithmName() const "; @@ -9897,12 +9912,12 @@ %feature("docstring") gdcm::Segment::GetSurfaceCount "unsigned long gdcm::Segment::GetSurfaceCount() "; -%feature("docstring") gdcm::Segment::GetSurfaces "SurfaceVector -const& gdcm::Segment::GetSurfaces() const "; - %feature("docstring") gdcm::Segment::GetSurfaces "SurfaceVector& gdcm::Segment::GetSurfaces() "; +%feature("docstring") gdcm::Segment::GetSurfaces "SurfaceVector +const& gdcm::Segment::GetSurfaces() const "; + %feature("docstring") gdcm::Segment::SetAnatomicRegion "void gdcm::Segment::SetAnatomicRegion(SegmentHelper::BasicCodedEntry const &BSE) "; @@ -9986,11 +10001,11 @@ %feature("docstring") gdcm::SegmentReader::~SegmentReader "gdcm::SegmentReader::~SegmentReader() override "; +%feature("docstring") gdcm::SegmentReader::GetSegments "SegmentVector gdcm::SegmentReader::GetSegments() "; + %feature("docstring") gdcm::SegmentReader::GetSegments "const SegmentVector gdcm::SegmentReader::GetSegments() const "; -%feature("docstring") gdcm::SegmentReader::GetSegments "SegmentVector gdcm::SegmentReader::GetSegments() "; - %feature("docstring") gdcm::SegmentReader::Read "bool gdcm::SegmentReader::Read() override @@ -10021,11 +10036,11 @@ Segment > gdcm::SegmentWriter::GetSegment(const unsigned int idx=0) const "; +%feature("docstring") gdcm::SegmentWriter::GetSegments "SegmentVector& gdcm::SegmentWriter::GetSegments() "; + %feature("docstring") gdcm::SegmentWriter::GetSegments "const SegmentVector& gdcm::SegmentWriter::GetSegments() const "; -%feature("docstring") gdcm::SegmentWriter::GetSegments "SegmentVector& gdcm::SegmentWriter::GetSegments() "; - %feature("docstring") gdcm::SegmentWriter::SetNumberOfSegments "void gdcm::SegmentWriter::SetNumberOfSegments(const unsigned int size) "; @@ -10099,11 +10114,11 @@ %feature("docstring") gdcm::SequenceOfFragments::GetNumberOfFragments "SizeType gdcm::SequenceOfFragments::GetNumberOfFragments() const "; +%feature("docstring") gdcm::SequenceOfFragments::GetTable "BasicOffsetTable& gdcm::SequenceOfFragments::GetTable() "; + %feature("docstring") gdcm::SequenceOfFragments::GetTable "const BasicOffsetTable& gdcm::SequenceOfFragments::GetTable() const "; -%feature("docstring") gdcm::SequenceOfFragments::GetTable "BasicOffsetTable& gdcm::SequenceOfFragments::GetTable() "; - %feature("docstring") gdcm::SequenceOfFragments::Print "void gdcm::SequenceOfFragments::Print(std::ostream &os) const override "; @@ -10184,12 +10199,12 @@ %feature("docstring") gdcm::SequenceOfItems::FindDataElement "bool gdcm::SequenceOfItems::FindDataElement(const Tag &t) const "; -%feature("docstring") gdcm::SequenceOfItems::GetItem "const Item& -gdcm::SequenceOfItems::GetItem(SizeType position) const "; - %feature("docstring") gdcm::SequenceOfItems::GetItem "Item& gdcm::SequenceOfItems::GetItem(SizeType position) "; +%feature("docstring") gdcm::SequenceOfItems::GetItem "const Item& +gdcm::SequenceOfItems::GetItem(SizeType position) const "; + %feature("docstring") gdcm::SequenceOfItems::GetLength "VL gdcm::SequenceOfItems::GetLength() const override @@ -10413,17 +10428,17 @@ Execute a C-STORE on file on disk, named filename. "; %feature("docstring") gdcm::ServiceClassUser::SendStore "bool -gdcm::ServiceClassUser::SendStore(File const &file) - -Execute a C-STORE on a File, the transfer syntax used for the query is -based on the file. "; - -%feature("docstring") gdcm::ServiceClassUser::SendStore "bool gdcm::ServiceClassUser::SendStore(DataSet const &ds) Execute a C-STORE on a DataSet, the transfer syntax used will be Implicit. "; +%feature("docstring") gdcm::ServiceClassUser::SendStore "bool +gdcm::ServiceClassUser::SendStore(File const &file) + +Execute a C-STORE on a File, the transfer syntax used for the query is +based on the file. "; + %feature("docstring") gdcm::ServiceClassUser::SetAETitle "void gdcm::ServiceClassUser::SetAETitle(const char *aetitle) @@ -10508,12 +10523,6 @@ &)=delete "; %feature("docstring") gdcm::SimpleMemberCommand::Execute "void -gdcm::SimpleMemberCommand< T >::Execute(Subject *, const Event &) -override - -Invoke the callback function. "; - -%feature("docstring") gdcm::SimpleMemberCommand::Execute "void gdcm::SimpleMemberCommand< T >::Execute(const Subject *, const Event &) override @@ -10521,6 +10530,12 @@ This variant is expected to be used when requests comes from a const Object "; +%feature("docstring") gdcm::SimpleMemberCommand::Execute "void +gdcm::SimpleMemberCommand< T >::Execute(Subject *, const Event &) +override + +Invoke the callback function. "; + %feature("docstring") gdcm::SimpleMemberCommand::SetCallbackFunction "void gdcm::SimpleMemberCommand< T >::SetCallbackFunction(T *object, TMemberFunctionPointer memberFunction) @@ -10538,14 +10553,14 @@ C++ includes: gdcmSimpleSubjectWatcher.h "; %feature("docstring") -gdcm::SimpleSubjectWatcher::SimpleSubjectWatcher "gdcm::SimpleSubjectWatcher::SimpleSubjectWatcher(Subject *s, const -char *comment=\"\") "; - -%feature("docstring") gdcm::SimpleSubjectWatcher::SimpleSubjectWatcher "gdcm::SimpleSubjectWatcher::SimpleSubjectWatcher(const SimpleSubjectWatcher &)=delete "; %feature("docstring") +gdcm::SimpleSubjectWatcher::SimpleSubjectWatcher "gdcm::SimpleSubjectWatcher::SimpleSubjectWatcher(Subject *s, const +char *comment=\"\") "; + +%feature("docstring") gdcm::SimpleSubjectWatcher::~SimpleSubjectWatcher "virtual gdcm::SimpleSubjectWatcher::~SimpleSubjectWatcher() "; @@ -10573,7 +10588,7 @@ See: http://www.davethehat.com/articles/smartp.htm and itk::SmartPointer -C++ includes: gdcmObject.h "; +C++ includes: gdcmSmartPointer.h "; %feature("docstring") gdcm::SmartPointer::SmartPointer "gdcm::SmartPointer< ObjectType >::SmartPointer() "; @@ -10822,12 +10837,12 @@ %feature("docstring") gdcm::SplitMosaicFilter::GetFile "const File& gdcm::SplitMosaicFilter::GetFile() const "; -%feature("docstring") gdcm::SplitMosaicFilter::GetImage "const -Image& gdcm::SplitMosaicFilter::GetImage() const "; - %feature("docstring") gdcm::SplitMosaicFilter::GetImage "Image& gdcm::SplitMosaicFilter::GetImage() "; +%feature("docstring") gdcm::SplitMosaicFilter::GetImage "const +Image& gdcm::SplitMosaicFilter::GetImage() const "; + %feature("docstring") gdcm::SplitMosaicFilter::SetFile "void gdcm::SplitMosaicFilter::SetFile(const File &f) "; @@ -10850,8 +10865,7 @@ // File: structgdcm_1_1STATIC__ASSERTION__FAILURE.xml -%feature("docstring") gdcm::STATIC_ASSERTION_FAILURE "C++ includes: -gdcmStaticAssert.h "; +%feature("docstring") gdcm::STATIC_ASSERTION_FAILURE ""; // File: structgdcm_1_1STATIC__ASSERTION__FAILURE_3_01true_01_4.xml @@ -11212,15 +11226,15 @@ String constructors. "; %feature("docstring") gdcm::String::String "gdcm::String< -TDelimiter, TMaxLength, TPadChar >::String(const value_type *s) "; +TDelimiter, TMaxLength, TPadChar >::String(const std::string &s, +size_type pos=0, size_type n=npos) "; %feature("docstring") gdcm::String::String "gdcm::String< -TDelimiter, TMaxLength, TPadChar >::String(const value_type *s, -size_type n) "; +TDelimiter, TMaxLength, TPadChar >::String(const value_type *s) "; %feature("docstring") gdcm::String::String "gdcm::String< -TDelimiter, TMaxLength, TPadChar >::String(const std::string &s, -size_type pos=0, size_type n=npos) "; +TDelimiter, TMaxLength, TPadChar >::String(const value_type *s, +size_type n) "; %feature("docstring") gdcm::String::IsValid "bool gdcm::String< TDelimiter, TMaxLength, TPadChar >::IsValid() const @@ -11291,13 +11305,13 @@ File (see SetFile). "; %feature("docstring") gdcm::StringFilter::ToString "std::string +gdcm::StringFilter::ToString(const PrivateTag &t) const "; + +%feature("docstring") gdcm::StringFilter::ToString "std::string gdcm::StringFilter::ToString(const Tag &t) const Directly from a Tag: "; -%feature("docstring") gdcm::StringFilter::ToString "std::string -gdcm::StringFilter::ToString(const PrivateTag &t) const "; - %feature("docstring") gdcm::StringFilter::ToStringPair "std::pair gdcm::StringFilter::ToStringPair(const DataElement &de) const @@ -11403,11 +11417,11 @@ %feature("docstring") gdcm::Surface::~Surface "gdcm::Surface::~Surface() override "; +%feature("docstring") gdcm::Surface::GetAlgorithmFamily "SegmentHelper::BasicCodedEntry& gdcm::Surface::GetAlgorithmFamily() "; + %feature("docstring") gdcm::Surface::GetAlgorithmFamily "SegmentHelper::BasicCodedEntry const& gdcm::Surface::GetAlgorithmFamily() const "; -%feature("docstring") gdcm::Surface::GetAlgorithmFamily "SegmentHelper::BasicCodedEntry& gdcm::Surface::GetAlgorithmFamily() "; - %feature("docstring") gdcm::Surface::GetAlgorithmName "const char* gdcm::Surface::GetAlgorithmName() const "; @@ -11436,21 +11450,21 @@ %feature("docstring") gdcm::Surface::GetMeanPointDistance "float gdcm::Surface::GetMeanPointDistance() const "; +%feature("docstring") gdcm::Surface::GetMeshPrimitive "MeshPrimitive& gdcm::Surface::GetMeshPrimitive() "; + %feature("docstring") gdcm::Surface::GetMeshPrimitive "MeshPrimitive const& gdcm::Surface::GetMeshPrimitive() const "; -%feature("docstring") gdcm::Surface::GetMeshPrimitive "MeshPrimitive& gdcm::Surface::GetMeshPrimitive() "; - %feature("docstring") gdcm::Surface::GetNumberOfSurfacePoints "unsigned long gdcm::Surface::GetNumberOfSurfacePoints() const "; %feature("docstring") gdcm::Surface::GetNumberOfVectors "unsigned long gdcm::Surface::GetNumberOfVectors() const "; +%feature("docstring") gdcm::Surface::GetPointCoordinatesData "DataElement& gdcm::Surface::GetPointCoordinatesData() "; + %feature("docstring") gdcm::Surface::GetPointCoordinatesData "const DataElement& gdcm::Surface::GetPointCoordinatesData() const "; -%feature("docstring") gdcm::Surface::GetPointCoordinatesData "DataElement& gdcm::Surface::GetPointCoordinatesData() "; - %feature("docstring") gdcm::Surface::GetPointPositionAccuracy "const float* gdcm::Surface::GetPointPositionAccuracy() const @@ -11461,12 +11475,12 @@ Pointer is null if undefined "; -%feature("docstring") gdcm::Surface::GetProcessingAlgorithm "SegmentHelper::BasicCodedEntry const& -gdcm::Surface::GetProcessingAlgorithm() const "; - %feature("docstring") gdcm::Surface::GetProcessingAlgorithm "SegmentHelper::BasicCodedEntry& gdcm::Surface::GetProcessingAlgorithm() "; +%feature("docstring") gdcm::Surface::GetProcessingAlgorithm "SegmentHelper::BasicCodedEntry const& +gdcm::Surface::GetProcessingAlgorithm() const "; + %feature("docstring") gdcm::Surface::GetRecommendedDisplayCIELabValue "const unsigned short* gdcm::Surface::GetRecommendedDisplayCIELabValue() const "; @@ -11503,11 +11517,11 @@ %feature("docstring") gdcm::Surface::GetVectorAccuracy "const float* gdcm::Surface::GetVectorAccuracy() const "; +%feature("docstring") gdcm::Surface::GetVectorCoordinateData "DataElement& gdcm::Surface::GetVectorCoordinateData() "; + %feature("docstring") gdcm::Surface::GetVectorCoordinateData "const DataElement& gdcm::Surface::GetVectorCoordinateData() const "; -%feature("docstring") gdcm::Surface::GetVectorCoordinateData "DataElement& gdcm::Surface::GetVectorCoordinateData() "; - %feature("docstring") gdcm::Surface::GetVectorDimensionality "unsigned short gdcm::Surface::GetVectorDimensionality() const "; %feature("docstring") gdcm::Surface::SetAlgorithmFamily "void @@ -11562,16 +11576,16 @@ const &BSE) "; %feature("docstring") gdcm::Surface::SetRecommendedDisplayCIELabValue -"void gdcm::Surface::SetRecommendedDisplayCIELabValue(const unsigned -short vl[3]) "; +"void gdcm::Surface::SetRecommendedDisplayCIELabValue(const +std::vector< unsigned short > &vl) "; %feature("docstring") gdcm::Surface::SetRecommendedDisplayCIELabValue "void gdcm::Surface::SetRecommendedDisplayCIELabValue(const unsigned short vl, const unsigned int idx=0) "; %feature("docstring") gdcm::Surface::SetRecommendedDisplayCIELabValue -"void gdcm::Surface::SetRecommendedDisplayCIELabValue(const -std::vector< unsigned short > &vl) "; +"void gdcm::Surface::SetRecommendedDisplayCIELabValue(const unsigned +short vl[3]) "; %feature("docstring") gdcm::Surface::SetRecommendedDisplayGrayscaleValue "void @@ -11825,6 +11839,9 @@ C++ includes: gdcmTag.h "; +%feature("docstring") gdcm::Tag::Tag "gdcm::Tag::Tag(const Tag +&_val) "; + %feature("docstring") gdcm::Tag::Tag "gdcm::Tag::Tag(uint16_t group, uint16_t element) @@ -11835,9 +11852,6 @@ Constructor with 1*uint32_t Prefer the cstor that takes two uint16_t. "; -%feature("docstring") gdcm::Tag::Tag "gdcm::Tag::Tag(const Tag -&_val) "; - %feature("docstring") gdcm::Tag::GetElement "uint16_t gdcm::Tag::GetElement() const @@ -12617,12 +12631,12 @@ C++ includes: gdcmULConnection.h "; -%feature("docstring") gdcm::network::ULConnection::ULConnection "gdcm::network::ULConnection::ULConnection(const ULConnectionInfo -&inUserInformation) "; - %feature("docstring") gdcm::network::ULConnection::ULConnection "gdcm::network::ULConnection::ULConnection(const ULConnection &)=delete "; +%feature("docstring") gdcm::network::ULConnection::ULConnection "gdcm::network::ULConnection::ULConnection(const ULConnectionInfo +&inUserInformation) "; + %feature("docstring") gdcm::network::ULConnection::~ULConnection "virtual gdcm::network::ULConnection::~ULConnection() "; %feature("docstring") @@ -12634,14 +12648,14 @@ DataElement &de) const "; %feature("docstring") +gdcm::network::ULConnection::GetAcceptedPresentationContexts "std::vector& +gdcm::network::ULConnection::GetAcceptedPresentationContexts() "; + +%feature("docstring") gdcm::network::ULConnection::GetAcceptedPresentationContexts "std::vector const& gdcm::network::ULConnection::GetAcceptedPresentationContexts() const "; -%feature("docstring") -gdcm::network::ULConnection::GetAcceptedPresentationContexts "std::vector& -gdcm::network::ULConnection::GetAcceptedPresentationContexts() "; - %feature("docstring") gdcm::network::ULConnection::GetConnectionInfo "const ULConnectionInfo& gdcm::network::ULConnection::GetConnectionInfo() const "; @@ -12695,12 +12709,12 @@ %feature("docstring") gdcm::network::ULConnection::SetPresentationContexts "void gdcm::network::ULConnection::SetPresentationContexts(const -std::vector< PresentationContextRQ > &inContexts) "; +std::vector< PresentationContext > &inContexts) "; %feature("docstring") gdcm::network::ULConnection::SetPresentationContexts "void gdcm::network::ULConnection::SetPresentationContexts(const -std::vector< PresentationContext > &inContexts) "; +std::vector< PresentationContextRQ > &inContexts) "; %feature("docstring") gdcm::network::ULConnection::SetState "void gdcm::network::ULConnection::SetState(const EStateID &inState) "; @@ -12959,14 +12973,14 @@ C++ includes: gdcmULEvent.h "; -%feature("docstring") gdcm::network::ULEvent::ULEvent "gdcm::network::ULEvent::ULEvent(const EEventID &inEventID, -std::vector< BasePDU *> inBasePDU, std::istream *iStream=nullptr, -std::streampos posDataSet=0) "; - %feature("docstring") gdcm::network::ULEvent::ULEvent "gdcm::network::ULEvent::ULEvent(const EEventID &inEventID, BasePDU *inBasePDU, std::istream *iStream=nullptr, std::streampos posDataSet=0) "; +%feature("docstring") gdcm::network::ULEvent::ULEvent "gdcm::network::ULEvent::ULEvent(const EEventID &inEventID, +std::vector< BasePDU * > inBasePDU, std::istream *iStream=nullptr, +std::streampos posDataSet=0) "; + %feature("docstring") gdcm::network::ULEvent::~ULEvent "gdcm::network::ULEvent::~ULEvent() "; %feature("docstring") gdcm::network::ULEvent::GetDataSetPos "std::streampos gdcm::network::ULEvent::GetDataSetPos() const "; @@ -12983,7 +12997,7 @@ gdcm::network::ULEvent::SetEvent(const EEventID &inEvent) "; %feature("docstring") gdcm::network::ULEvent::SetPDU "void -gdcm::network::ULEvent::SetPDU(std::vector< BasePDU *> const &inPDU) +gdcm::network::ULEvent::SetPDU(std::vector< BasePDU * > const &inPDU) "; @@ -13193,14 +13207,14 @@ const &s) "; %feature("docstring") +gdcm::network::UserInformation::GetMaximumLengthSub "MaximumLengthSub& +gdcm::network::UserInformation::GetMaximumLengthSub() "; + +%feature("docstring") gdcm::network::UserInformation::GetMaximumLengthSub "const MaximumLengthSub& gdcm::network::UserInformation::GetMaximumLengthSub() const "; -%feature("docstring") -gdcm::network::UserInformation::GetMaximumLengthSub "MaximumLengthSub& -gdcm::network::UserInformation::GetMaximumLengthSub() "; - %feature("docstring") gdcm::network::UserInformation::Print "void gdcm::network::UserInformation::Print(std::ostream &os) const "; @@ -13373,7 +13387,7 @@ // File: structgdcm_1_1VMToLength.xml -%feature("docstring") gdcm::VMToLength "C++ includes: gdcmVM.h "; +%feature("docstring") gdcm::VMToLength ""; // File: classgdcm_1_1VR.xml @@ -13447,16 +13461,15 @@ // File: structgdcm_1_1VRToEncoding.xml -%feature("docstring") gdcm::VRToEncoding "C++ includes: gdcmVR.h "; +%feature("docstring") gdcm::VRToEncoding ""; // File: structgdcm_1_1VRToType.xml -%feature("docstring") gdcm::VRToType "C++ includes: gdcmVR.h "; +%feature("docstring") gdcm::VRToType ""; // File: classgdcm_1_1VRVLSize.xml -%feature("docstring") gdcm::VRVLSize "C++ includes: gdcmAttribute.h -"; +%feature("docstring") gdcm::VRVLSize ""; // File: classgdcm_1_1VRVLSize_3_010_01_4.xml @@ -13499,26 +13512,16 @@ vtkGDCMImageReader::SetMedicalImageProperties(vtkMedicalImageProperties *pd) "; -%feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(LoadOverlays, int) "; - -%feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(LoadIconImage, int) "; - -%feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(LossyFlag, int) "; - %feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(ApplyLookupTable, int) "; %feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "int vtkGDCMImageReader::vtkBooleanMacro(ApplyYBRToRGB, int) "; -%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(LoadOverlays, int) "; - -%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(LoadIconImage, int) "; - -%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(LossyFlag, int) "; +%feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(LoadIconImage, int) "; -%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(NumberOfOverlays, int) "; +%feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(LoadOverlays, int) "; -%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(NumberOfIconImages, int) "; +%feature("docstring") vtkGDCMImageReader::vtkBooleanMacro "vtkGDCMImageReader::vtkBooleanMacro(LossyFlag, int) "; %feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(ApplyLookupTable, int) "; @@ -13527,21 +13530,31 @@ %feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(ImageFormat, int) "; +%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(LoadIconImage, int) "; + +%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(LoadOverlays, int) "; + +%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(LossyFlag, int) "; + +%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(NumberOfIconImages, int) "; + +%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(NumberOfOverlays, int) "; + %feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(PlanarConfiguration, int) "; +%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(Scale, double) "; + %feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(Shift, double) "; -%feature("docstring") vtkGDCMImageReader::vtkGetMacro "vtkGDCMImageReader::vtkGetMacro(Scale, double) "; +%feature("docstring") vtkGDCMImageReader::vtkGetObjectMacro "vtkGDCMImageReader::vtkGetObjectMacro(Curve, vtkPolyData) "; %feature("docstring") vtkGDCMImageReader::vtkGetObjectMacro "vtkGDCMImageReader::vtkGetObjectMacro(DirectionCosines, vtkMatrix4x4) "; -%feature("docstring") vtkGDCMImageReader::vtkGetObjectMacro "vtkGDCMImageReader::vtkGetObjectMacro(MedicalImageProperties, -vtkMedicalImageProperties) "; - %feature("docstring") vtkGDCMImageReader::vtkGetObjectMacro "vtkGDCMImageReader::vtkGetObjectMacro(FileNames, vtkStringArray) "; -%feature("docstring") vtkGDCMImageReader::vtkGetObjectMacro "vtkGDCMImageReader::vtkGetObjectMacro(Curve, vtkPolyData) "; +%feature("docstring") vtkGDCMImageReader::vtkGetObjectMacro "vtkGDCMImageReader::vtkGetObjectMacro(MedicalImageProperties, +vtkMedicalImageProperties) "; %feature("docstring") vtkGDCMImageReader::vtkGetVector3Macro "vtkGDCMImageReader::vtkGetVector3Macro(ImagePositionPatient, double) "; @@ -13549,13 +13562,13 @@ %feature("docstring") vtkGDCMImageReader::vtkGetVector6Macro "vtkGDCMImageReader::vtkGetVector6Macro(ImageOrientationPatient, double) "; -%feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(LoadOverlays, int) "; +%feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(ApplyLookupTable, int) "; %feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(LoadIconImage, int) "; -%feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(LossyFlag, int) "; +%feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(LoadOverlays, int) "; -%feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(ApplyLookupTable, int) "; +%feature("docstring") vtkGDCMImageReader::vtkSetMacro "vtkGDCMImageReader::vtkSetMacro(LossyFlag, int) "; %feature("docstring") vtkGDCMImageReader::vtkTypeMacro "vtkGDCMImageReader::vtkTypeMacro(vtkGDCMImageReader, vtkMedicalImageReader2) "; @@ -13592,26 +13605,16 @@ vtkGDCMImageReader2::SetMedicalImageProperties(vtkMedicalImageProperties *pd) "; -%feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(LoadOverlays, int) "; - -%feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(LoadIconImage, int) "; - -%feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(LossyFlag, int) "; - %feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(ApplyLookupTable, int) "; %feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "int vtkGDCMImageReader2::vtkBooleanMacro(ApplyYBRToRGB, int) "; -%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(LoadOverlays, int) "; - -%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(LoadIconImage, int) "; - -%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(LossyFlag, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(LoadIconImage, int) "; -%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(NumberOfOverlays, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(LoadOverlays, int) "; -%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(NumberOfIconImages, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkBooleanMacro "vtkGDCMImageReader2::vtkBooleanMacro(LossyFlag, int) "; %feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(ApplyLookupTable, int) "; @@ -13620,30 +13623,40 @@ %feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(ImageFormat, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(LoadIconImage, int) "; + +%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(LoadOverlays, int) "; + +%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(LossyFlag, int) "; + +%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(NumberOfIconImages, int) "; + +%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(NumberOfOverlays, int) "; + %feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(PlanarConfiguration, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(Scale, double) "; + %feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(Shift, double) "; -%feature("docstring") vtkGDCMImageReader2::vtkGetMacro "vtkGDCMImageReader2::vtkGetMacro(Scale, double) "; +%feature("docstring") vtkGDCMImageReader2::vtkGetObjectMacro "vtkGDCMImageReader2::vtkGetObjectMacro(Curve, vtkPolyData) "; %feature("docstring") vtkGDCMImageReader2::vtkGetObjectMacro "vtkGDCMImageReader2::vtkGetObjectMacro(DirectionCosines, vtkMatrix4x4) "; -%feature("docstring") vtkGDCMImageReader2::vtkGetObjectMacro "vtkGDCMImageReader2::vtkGetObjectMacro(Curve, vtkPolyData) "; - %feature("docstring") vtkGDCMImageReader2::vtkGetVector3Macro "vtkGDCMImageReader2::vtkGetVector3Macro(ImagePositionPatient, double) "; %feature("docstring") vtkGDCMImageReader2::vtkGetVector6Macro "vtkGDCMImageReader2::vtkGetVector6Macro(ImageOrientationPatient, double) "; -%feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(LoadOverlays, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(ApplyLookupTable, int) "; %feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(LoadIconImage, int) "; -%feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(LossyFlag, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(LoadOverlays, int) "; -%feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(ApplyLookupTable, int) "; +%feature("docstring") vtkGDCMImageReader2::vtkSetMacro "vtkGDCMImageReader2::vtkSetMacro(LossyFlag, int) "; %feature("docstring") vtkGDCMImageReader2::vtkTypeMacro "vtkGDCMImageReader2::vtkTypeMacro(vtkGDCMImageReader2, vtkMedicalImageReader2) "; @@ -13676,54 +13689,54 @@ vtkGDCMImageWriter::SetMedicalImageProperties(vtkMedicalImageProperties *) "; -%feature("docstring") vtkGDCMImageWriter::vtkBooleanMacro "vtkGDCMImageWriter::vtkBooleanMacro(LossyFlag, int) "; - %feature("docstring") vtkGDCMImageWriter::vtkBooleanMacro "vtkGDCMImageWriter::vtkBooleanMacro(FileLowerLeft, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(LossyFlag, int) "; +%feature("docstring") vtkGDCMImageWriter::vtkBooleanMacro "vtkGDCMImageWriter::vtkBooleanMacro(LossyFlag, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(Shift, double) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(CompressionType, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(Scale, double) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(FileLowerLeft, int) "; %feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(ImageFormat, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(FileLowerLeft, int) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(LossyFlag, int) "; %feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(PlanarConfiguration, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(CompressionType, int) "; - -%feature("docstring") vtkGDCMImageWriter::vtkGetObjectMacro "vtkGDCMImageWriter::vtkGetObjectMacro(MedicalImageProperties, -vtkMedicalImageProperties) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(Scale, double) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetObjectMacro "vtkGDCMImageWriter::vtkGetObjectMacro(FileNames, vtkStringArray) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetMacro "vtkGDCMImageWriter::vtkGetMacro(Shift, double) "; %feature("docstring") vtkGDCMImageWriter::vtkGetObjectMacro "vtkGDCMImageWriter::vtkGetObjectMacro(DirectionCosines, vtkMatrix4x4) "; -%feature("docstring") vtkGDCMImageWriter::vtkGetStringMacro "vtkGDCMImageWriter::vtkGetStringMacro(StudyUID) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetObjectMacro "vtkGDCMImageWriter::vtkGetObjectMacro(FileNames, vtkStringArray) "; + +%feature("docstring") vtkGDCMImageWriter::vtkGetObjectMacro "vtkGDCMImageWriter::vtkGetObjectMacro(MedicalImageProperties, +vtkMedicalImageProperties) "; %feature("docstring") vtkGDCMImageWriter::vtkGetStringMacro "vtkGDCMImageWriter::vtkGetStringMacro(SeriesUID) "; -%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(LossyFlag, int) "; +%feature("docstring") vtkGDCMImageWriter::vtkGetStringMacro "vtkGDCMImageWriter::vtkGetStringMacro(StudyUID) "; -%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(Shift, double) "; +%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(CompressionType, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(Scale, double) "; +%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(FileLowerLeft, int) "; %feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(ImageFormat, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(FileLowerLeft, int) "; +%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(LossyFlag, int) "; %feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(PlanarConfiguration, int) "; -%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(CompressionType, int) "; +%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(Scale, double) "; -%feature("docstring") vtkGDCMImageWriter::vtkSetStringMacro "vtkGDCMImageWriter::vtkSetStringMacro(StudyUID) "; +%feature("docstring") vtkGDCMImageWriter::vtkSetMacro "vtkGDCMImageWriter::vtkSetMacro(Shift, double) "; %feature("docstring") vtkGDCMImageWriter::vtkSetStringMacro "vtkGDCMImageWriter::vtkSetStringMacro(SeriesUID) "; +%feature("docstring") vtkGDCMImageWriter::vtkSetStringMacro "vtkGDCMImageWriter::vtkSetStringMacro(StudyUID) "; + %feature("docstring") vtkGDCMImageWriter::vtkTypeMacro "vtkGDCMImageWriter::vtkTypeMacro(vtkGDCMImageWriter, vtkImageWriter) "; @@ -13817,10 +13830,10 @@ %feature("docstring") vtkGDCMThreadedImageReader::vtkGetMacro "vtkGDCMThreadedImageReader::vtkGetMacro(UseShiftScale, int) "; -%feature("docstring") vtkGDCMThreadedImageReader::vtkSetMacro "vtkGDCMThreadedImageReader::vtkSetMacro(Shift, double) "; - %feature("docstring") vtkGDCMThreadedImageReader::vtkSetMacro "vtkGDCMThreadedImageReader::vtkSetMacro(Scale, double) "; +%feature("docstring") vtkGDCMThreadedImageReader::vtkSetMacro "vtkGDCMThreadedImageReader::vtkSetMacro(Shift, double) "; + %feature("docstring") vtkGDCMThreadedImageReader::vtkSetMacro "vtkGDCMThreadedImageReader::vtkSetMacro(UseShiftScale, int) "; %feature("docstring") vtkGDCMThreadedImageReader::vtkTypeMacro "vtkGDCMThreadedImageReader::vtkTypeMacro(vtkGDCMThreadedImageReader, @@ -13853,21 +13866,21 @@ %feature("docstring") vtkGDCMThreadedImageReader2::vtkBooleanMacro "vtkGDCMThreadedImageReader2::vtkBooleanMacro(UseShiftScale, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(DataScalarType, int) "; + %feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(FileLowerLeft, int) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(NumberOfOverlays, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(LoadOverlays, int) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(DataScalarType, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(NumberOfOverlays, int) "; %feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(NumberOfScalarComponents, int) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(LoadOverlays, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(Scale, double) "; %feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(Shift, double) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(Scale, double) "; - %feature("docstring") vtkGDCMThreadedImageReader2::vtkGetMacro "vtkGDCMThreadedImageReader2::vtkGetMacro(UseShiftScale, int) "; %feature("docstring") vtkGDCMThreadedImageReader2::vtkGetObjectMacro @@ -13885,19 +13898,19 @@ %feature("docstring") vtkGDCMThreadedImageReader2::vtkGetVector6Macro "vtkGDCMThreadedImageReader2::vtkGetVector6Macro(DataExtent, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(DataScalarType, int) "; + %feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(FileLowerLeft, int) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(DataScalarType, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(LoadOverlays, int) "; %feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(NumberOfScalarComponents, int) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(LoadOverlays, int) "; +%feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(Scale, double) "; %feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(Shift, double) "; -%feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(Scale, double) "; - %feature("docstring") vtkGDCMThreadedImageReader2::vtkSetMacro "vtkGDCMThreadedImageReader2::vtkSetMacro(UseShiftScale, int) "; %feature("docstring") vtkGDCMThreadedImageReader2::vtkSetVector3Macro @@ -13939,17 +13952,17 @@ %feature("docstring") vtkGDCMThreadedImageReader3::vtkBooleanMacro "vtkGDCMThreadedImageReader3::vtkBooleanMacro(LoadOverlays, int) "; +%feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(DataScalarType, int) "; + %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(FileLowerLeft, int) "; -%feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(NumberOfOverlays, int) "; +%feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(LoadOverlays, int) "; -%feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(DataScalarType, int) "; +%feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(NumberOfOverlays, int) "; %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(NumberOfScalarComponents, int) "; -%feature("docstring") vtkGDCMThreadedImageReader3::vtkGetMacro "vtkGDCMThreadedImageReader3::vtkGetMacro(LoadOverlays, int) "; - %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetObjectMacro "vtkGDCMThreadedImageReader3::vtkGetObjectMacro(FileNames, vtkStringArray) "; @@ -13965,15 +13978,15 @@ %feature("docstring") vtkGDCMThreadedImageReader3::vtkGetVector6Macro "vtkGDCMThreadedImageReader3::vtkGetVector6Macro(DataExtent, int) "; +%feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(DataScalarType, int) "; + %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(FileLowerLeft, int) "; -%feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(DataScalarType, int) "; +%feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(LoadOverlays, int) "; %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(NumberOfScalarComponents, int) "; -%feature("docstring") vtkGDCMThreadedImageReader3::vtkSetMacro "vtkGDCMThreadedImageReader3::vtkSetMacro(LoadOverlays, int) "; - %feature("docstring") vtkGDCMThreadedImageReader3::vtkSetVector3Macro "vtkGDCMThreadedImageReader3::vtkSetVector3Macro(DataOrigin, double) "; @@ -14026,13 +14039,13 @@ vtkImageColorViewer::GetSliceMin() "; %feature("docstring") vtkImageColorViewer::GetSliceRange "virtual -void vtkImageColorViewer::GetSliceRange(int range[2]) "; +int* vtkImageColorViewer::GetSliceRange() "; %feature("docstring") vtkImageColorViewer::GetSliceRange "virtual void vtkImageColorViewer::GetSliceRange(int &min, int &max) "; %feature("docstring") vtkImageColorViewer::GetSliceRange "virtual -int* vtkImageColorViewer::GetSliceRange() "; +void vtkImageColorViewer::GetSliceRange(int range[2]) "; %feature("docstring") vtkImageColorViewer::GetWindowName "virtual const char* vtkImageColorViewer::GetWindowName() "; @@ -14104,33 +14117,33 @@ %feature("docstring") vtkImageColorViewer::UpdateDisplayExtent "virtual void vtkImageColorViewer::UpdateDisplayExtent() "; -%feature("docstring") vtkImageColorViewer::VTK_LEGACY "vtkImageColorViewer::VTK_LEGACY(int GetWholeZMin()) "; - %feature("docstring") vtkImageColorViewer::VTK_LEGACY "vtkImageColorViewer::VTK_LEGACY(int GetWholeZMax()) "; +%feature("docstring") vtkImageColorViewer::VTK_LEGACY "vtkImageColorViewer::VTK_LEGACY(int GetWholeZMin()) "; + %feature("docstring") vtkImageColorViewer::VTK_LEGACY "vtkImageColorViewer::VTK_LEGACY(int GetZSlice()) "; %feature("docstring") vtkImageColorViewer::VTK_LEGACY "vtkImageColorViewer::VTK_LEGACY(void SetZSlice(int)) "; %feature("docstring") vtkImageColorViewer::vtkBooleanMacro "vtkImageColorViewer::vtkBooleanMacro(OffScreenRendering, int) "; +%feature("docstring") vtkImageColorViewer::vtkGetMacro "vtkImageColorViewer::vtkGetMacro(Slice, int) "; + %feature("docstring") vtkImageColorViewer::vtkGetMacro "vtkImageColorViewer::vtkGetMacro(SliceOrientation, int) "; -%feature("docstring") vtkImageColorViewer::vtkGetMacro "vtkImageColorViewer::vtkGetMacro(Slice, int) "; +%feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(ImageActor, vtkImageActor) "; -%feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(RenderWindow, vtkRenderWindow) -"; +%feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(InteractorStyle, +vtkInteractorStyleImage) "; %feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(Renderer, vtkRenderer) "; -%feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(ImageActor, vtkImageActor) "; +%feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(RenderWindow, vtkRenderWindow) +"; %feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(WindowLevel, vtkImageMapToWindowLevelColors2) "; -%feature("docstring") vtkImageColorViewer::vtkGetObjectMacro "vtkImageColorViewer::vtkGetObjectMacro(InteractorStyle, -vtkInteractorStyleImage) "; - %feature("docstring") vtkImageColorViewer::vtkTypeMacro "vtkImageColorViewer::vtkTypeMacro(vtkImageColorViewer, vtkObject) "; @@ -14161,19 +14174,19 @@ %feature("docstring") vtkImageMapToColors16::vtkBooleanMacro "vtkImageMapToColors16::vtkBooleanMacro(PassAlphaToOutput, int) "; -%feature("docstring") vtkImageMapToColors16::vtkGetMacro "vtkImageMapToColors16::vtkGetMacro(OutputFormat, int) "; - %feature("docstring") vtkImageMapToColors16::vtkGetMacro "vtkImageMapToColors16::vtkGetMacro(ActiveComponent, int) "; +%feature("docstring") vtkImageMapToColors16::vtkGetMacro "vtkImageMapToColors16::vtkGetMacro(OutputFormat, int) "; + %feature("docstring") vtkImageMapToColors16::vtkGetMacro "vtkImageMapToColors16::vtkGetMacro(PassAlphaToOutput, int) "; %feature("docstring") vtkImageMapToColors16::vtkGetObjectMacro "vtkImageMapToColors16::vtkGetObjectMacro(LookupTable, vtkScalarsToColors) "; -%feature("docstring") vtkImageMapToColors16::vtkSetMacro "vtkImageMapToColors16::vtkSetMacro(OutputFormat, int) "; - %feature("docstring") vtkImageMapToColors16::vtkSetMacro "vtkImageMapToColors16::vtkSetMacro(ActiveComponent, int) "; +%feature("docstring") vtkImageMapToColors16::vtkSetMacro "vtkImageMapToColors16::vtkSetMacro(OutputFormat, int) "; + %feature("docstring") vtkImageMapToColors16::vtkSetMacro "vtkImageMapToColors16::vtkSetMacro(PassAlphaToOutput, int) "; %feature("docstring") vtkImageMapToColors16::vtkTypeMacro "vtkImageMapToColors16::vtkTypeMacro(vtkImageMapToColors16, @@ -14187,14 +14200,14 @@ %feature("docstring") vtkImageMapToWindowLevelColors2::PrintSelf "void vtkImageMapToWindowLevelColors2::PrintSelf(ostream &os, vtkIndent indent) "; -%feature("docstring") vtkImageMapToWindowLevelColors2::vtkGetMacro "vtkImageMapToWindowLevelColors2::vtkGetMacro(Window, double) "; - %feature("docstring") vtkImageMapToWindowLevelColors2::vtkGetMacro "vtkImageMapToWindowLevelColors2::vtkGetMacro(Level, double) "; -%feature("docstring") vtkImageMapToWindowLevelColors2::vtkSetMacro "vtkImageMapToWindowLevelColors2::vtkSetMacro(Window, double) "; +%feature("docstring") vtkImageMapToWindowLevelColors2::vtkGetMacro "vtkImageMapToWindowLevelColors2::vtkGetMacro(Window, double) "; %feature("docstring") vtkImageMapToWindowLevelColors2::vtkSetMacro "vtkImageMapToWindowLevelColors2::vtkSetMacro(Level, double) "; +%feature("docstring") vtkImageMapToWindowLevelColors2::vtkSetMacro "vtkImageMapToWindowLevelColors2::vtkSetMacro(Window, double) "; + %feature("docstring") vtkImageMapToWindowLevelColors2::vtkTypeMacro "vtkImageMapToWindowLevelColors2::vtkTypeMacro(vtkImageMapToWindowLevelColors2, vtkImageMapToColors) "; @@ -14374,45 +14387,45 @@ %feature("docstring") vtkRTStructSetProperties::PrintSelf "void vtkRTStructSetProperties::PrintSelf(ostream &os, vtkIndent indent) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetLabel) "; +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(ReferenceFrameOfReferenceUID) +"; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetName) "; +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(ReferenceSeriesInstanceUID) +"; + +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(SeriesInstanceUID) "; + +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(SOPInstanceUID) "; %feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetDate) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetTime) "; +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetLabel) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(SOPInstanceUID) "; +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetName) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StudyInstanceUID) "; +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StructureSetTime) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(SeriesInstanceUID) "; +%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(StudyInstanceUID) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(ReferenceSeriesInstanceUID) +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(ReferenceFrameOfReferenceUID) "; -%feature("docstring") vtkRTStructSetProperties::vtkGetStringMacro "vtkRTStructSetProperties::vtkGetStringMacro(ReferenceFrameOfReferenceUID) +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(ReferenceSeriesInstanceUID) "; -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetLabel) "; +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(SeriesInstanceUID) "; -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetName) "; +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(SOPInstanceUID) "; %feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetDate) "; -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetTime) "; - -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(SOPInstanceUID) "; - -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StudyInstanceUID) "; +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetLabel) "; -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(SeriesInstanceUID) "; +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetName) "; -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(ReferenceSeriesInstanceUID) -"; +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StructureSetTime) "; -%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(ReferenceFrameOfReferenceUID) -"; +%feature("docstring") vtkRTStructSetProperties::vtkSetStringMacro "vtkRTStructSetProperties::vtkSetStringMacro(StudyInstanceUID) "; %feature("docstring") vtkRTStructSetProperties::vtkTypeMacro "vtkRTStructSetProperties::vtkTypeMacro(vtkRTStructSetProperties, vtkObject) "; @@ -15689,127 +15702,148 @@ // File: dir_6285418b2babf39982c6f35dbd05cbb5.xml -// File: AddPrivateAttribute_8py-example.xml +// File: TestByteSwap_8cxx-example.xml -// File: AWTMedical3_8java-example.xml +// File: PatchFile_8cxx-example.xml -// File: BasicAnonymizer_8cs-example.xml +// File: SimplePrint_8cs-example.xml -// File: BasicImageAnonymizer_8cs-example.xml +// File: TestReader_8cxx-example.xml -// File: CastConvertPhilips_8py-example.xml +// File: TestReader_8py-example.xml -// File: ChangePrivateTags_8cxx-example.xml +// File: DecompressJPEGFile_8cs-example.xml -// File: ChangeSequenceUltrasound_8cxx-example.xml +// File: ManipulateFile_8cs-example.xml -// File: CheckBigEndianBug_8cxx-example.xml +// File: ClinicalTrialIdentificationWorkflow_8cs-example.xml -// File: ClinicalTrialAnnotate_8cxx-example.xml +// File: GenerateDICOMDIR_8cs-example.xml -// File: ClinicalTrialIdentificationWorkflow_8cs-example.xml +// File: GenFakeImage_8cxx-example.xml -// File: CompressImage_8cxx-example.xml +// File: ReformatFile_8cs-example.xml + + +// File: DecompressImage_8cs-example.xml + + +// File: StandardizeFiles_8cs-example.xml + + +// File: ScanDirectory_8cs-example.xml + + +// File: BasicAnonymizer_8cs-example.xml + + +// File: BasicImageAnonymizer_8cs-example.xml // File: CompressLossyJPEG_8cs-example.xml -// File: Compute3DSpacing_8cxx-example.xml +// File: DecompressImageMultiframe_8cs-example.xml -// File: Convert16BitsTo8Bits_8cxx-example.xml +// File: DumpCSA_8cs-example.xml -// File: ConvertMPL_8py-example.xml +// File: ExtractEncapsulatedFile_8cs-example.xml -// File: ConvertMultiFrameToSingleFrame_8cxx-example.xml +// File: ExtractImageRegion_8cs-example.xml -// File: ConvertNumpy_8py-example.xml +// File: ExtractImageRegionWithLUT_8cs-example.xml -// File: ConvertPIL_8py-example.xml +// File: ExtractOneFrame_8cs-example.xml -// File: ConvertRGBToLuminance_8cxx-example.xml +// File: FileAnonymize_8cs-example.xml -// File: ConvertSingleBitTo8Bits_8cxx-example.xml +// File: FileChangeTS_8cs-example.xml -// File: ConvertToQImage_8cxx-example.xml +// File: FileChangeTSLossy_8cs-example.xml -// File: CreateARGBImage_8cxx-example.xml +// File: FileStreaming_8cs-example.xml -// File: CreateCMYKImage_8cxx-example.xml +// File: GetArray_8cs-example.xml -// File: CreateFakePET_8cxx-example.xml +// File: MpegVideoInfo_8cs-example.xml -// File: CreateFakeRTDOSE_8cxx-example.xml +// File: NewSequence_8cs-example.xml -// File: CreateJPIPDataSet_8cxx-example.xml +// File: RescaleImage_8cs-example.xml -// File: CreateRAWStorage_8py-example.xml +// File: SendFileSCU_8cs-example.xml -// File: csa2img_8cxx-example.xml +// File: SimplePrintPatientName_8cs-example.xml + + +// File: SortImage2_8cs-example.xml // File: CStoreQtProgress_8cxx-example.xml -// File: DecompressImage_8cs-example.xml +// File: ChangePrivateTags_8cxx-example.xml -// File: DecompressImage_8java-example.xml +// File: ChangeSequenceUltrasound_8cxx-example.xml -// File: DecompressImage_8py-example.xml +// File: CheckBigEndianBug_8cxx-example.xml -// File: DecompressImageMultiframe_8cs-example.xml +// File: ClinicalTrialAnnotate_8cxx-example.xml -// File: DecompressJPEGFile_8cs-example.xml +// File: CompressImage_8cxx-example.xml -// File: DecompressPixmap_8java-example.xml +// File: ConvertToQImage_8cxx-example.xml -// File: DeriveSeries_8cxx-example.xml +// File: CreateARGBImage_8cxx-example.xml -// File: DiffFile_8cxx-example.xml +// File: CreateCMYKImage_8cxx-example.xml -// File: DiscriminateVolume_8cxx-example.xml +// File: CreateJPIPDataSet_8cxx-example.xml -// File: DumbAnonymizer_8py-example.xml +// File: DeriveSeries_8cxx-example.xml -// File: DumpADAC_8cxx-example.xml +// File: DiffFile_8cxx-example.xml -// File: DumpCSA_8cs-example.xml +// File: DiscriminateVolume_8cxx-example.xml + + +// File: DumpADAC_8cxx-example.xml // File: DumpExamCard_8cxx-example.xml @@ -15827,10 +15861,10 @@ // File: DumpSiemensBase64_8cxx-example.xml -// File: DumpToshibaDTI_8cxx-example.xml +// File: DumpToSQLITE3_8cxx-example.xml -// File: DumpToSQLITE3_8cxx-example.xml +// File: DumpToshibaDTI_8cxx-example.xml // File: DumpVisusChange_8cxx-example.xml @@ -15848,361 +15882,349 @@ // File: EncapsulateFileInRawData_8cxx-example.xml -// File: ExtractEncapsulatedFile_8cs-example.xml - - // File: ExtractEncryptedContent_8cxx-example.xml // File: ExtractIconFromFile_8cxx-example.xml -// File: ExtractImageRegion_8cs-example.xml +// File: Extracting_All_Resolution_8cxx-example.xml -// File: ExtractImageRegion_8java-example.xml +// File: Fake_Image_Using_Stream_Image_Writer_8cxx-example.xml -// File: ExtractImageRegion_8py-example.xml +// File: FixBrokenJ2K_8cxx-example.xml -// File: ExtractImageRegionWithLUT_8cs-example.xml +// File: FixJAIBugJPEGLS_8cxx-example.xml -// File: Extracting_All_Resolution_8cxx-example.xml +// File: FixOrientation_8cxx-example.xml -// File: ExtractOneFrame_8cs-example.xml +// File: GenAllVR_8cxx-example.xml -// File: Fake_Image_Using_Stream_Image_Writer_8cxx-example.xml +// File: GenFakeIdentifyFile_8cxx-example.xml -// File: FileAnonymize_8cs-example.xml +// File: GenLongSeqs_8cxx-example.xml -// File: FileAnonymize_8java-example.xml +// File: GenSeqs_8cxx-example.xml -// File: FileChangeTS_8cs-example.xml +// File: GenerateStandardSOPClasses_8cxx-example.xml -// File: FileChangeTSLossy_8cs-example.xml +// File: GetJPEGSamplePrecision_8cxx-example.xml -// File: FileStreaming_8cs-example.xml +// File: GetSequenceUltrasound_8cxx-example.xml -// File: FindAllPatientName_8py-example.xml +// File: GetSubSequenceData_8cxx-example.xml -// File: FixBrokenJ2K_8cxx-example.xml +// File: HelloVizWorld_8cxx-example.xml -// File: FixCommaBug_8py-example.xml +// File: HelloWorld_8cxx-example.xml -// File: FixJAIBugJPEGLS_8cxx-example.xml +// File: LargeVRDSExplicit_8cxx-example.xml -// File: FixOrientation_8cxx-example.xml +// File: MakeTemplate_8cxx-example.xml -// File: gdcmorthoplanes_8cxx-example.xml +// File: MergeTwoFiles_8cxx-example.xml -// File: gdcmreslice_8cxx-example.xml +// File: MrProtocol_8cxx-example.xml -// File: gdcmrtionplan_8cxx-example.xml +// File: PrintLUT_8cxx-example.xml -// File: gdcmrtplan_8cxx-example.xml +// File: PublicDict_8cxx-example.xml -// File: gdcmscene_8cxx-example.xml +// File: QIDO-RS_8cxx-example.xml -// File: gdcmtexture_8cxx-example.xml +// File: ReadAndDumpDICOMDIR_8cxx-example.xml -// File: gdcmvolume_8cxx-example.xml +// File: ReadAndDumpDICOMDIR2_8cxx-example.xml -// File: GenAllVR_8cxx-example.xml +// File: ReadAndPrintAttributes_8cxx-example.xml -// File: GenerateDICOMDIR_8cs-example.xml +// File: ReadExplicitLengthSQIVR_8cxx-example.xml -// File: GenerateRTSTRUCT_8cxx-example.xml +// File: ReadGEMSSDO_8cxx-example.xml -// File: GenerateStandardSOPClasses_8cxx-example.xml +// File: ReadMultiTimesException_8cxx-example.xml -// File: GenFakeIdentifyFile_8cxx-example.xml +// File: ReadUTF8QtDir_8cxx-example.xml -// File: GenFakeImage_8cxx-example.xml +// File: Rescale_8cxx-example.xml -// File: GenLongSeqs_8cxx-example.xml +// File: SimpleScanner_8cxx-example.xml -// File: GenSeqs_8cxx-example.xml +// File: SortImage_8cxx-example.xml -// File: GetArray_8cs-example.xml +// File: StreamImageReaderTest_8cxx-example.xml -// File: GetJPEGSamplePrecision_8cxx-example.xml +// File: TemplateEmptyImage_8cxx-example.xml -// File: GetPortionCSAHeader_8py-example.xml +// File: TraverseModules_8cxx-example.xml -// File: GetSequenceUltrasound_8cxx-example.xml +// File: VolumeSorter_8cxx-example.xml -// File: GetSubSequenceData_8cxx-example.xml +// File: WrapCustomStorage_8cxx-example.xml -// File: headsq2dcm_8py-example.xml +// File: csa2img_8cxx-example.xml -// File: HelloActiviz_8cs-example.xml +// File: iU22tomultisc_8cxx-example.xml -// File: HelloActiviz2_8cs-example.xml +// File: pmsct_rgb1_8cxx-example.xml -// File: HelloActiviz3_8cs-example.xml +// File: rle2img_8cxx-example.xml -// File: HelloActiviz4_8cs-example.xml +// File: sample_8cxx-example.xml -// File: HelloActiviz5_8cs-example.xml +// File: uid_unique_8cxx-example.xml -// File: HelloSimple_8java-example.xml +// File: DecompressImage_8java-example.xml -// File: HelloVizWorld_8cxx-example.xml +// File: DecompressPixmap_8java-example.xml -// File: HelloVTKWorld_8cs-example.xml +// File: ExtractImageRegion_8java-example.xml -// File: HelloVTKWorld_8java-example.xml +// File: FileAnonymize_8java-example.xml -// File: HelloVTKWorld2_8cs-example.xml +// File: HelloSimple_8java-example.xml -// File: HelloWorld_8cxx-example.xml +// File: ReadFiles_8java-example.xml -// File: HelloWorld_8py-example.xml +// File: ScanDirectory_8java-example.xml -// File: iU22tomultisc_8cxx-example.xml +// File: SimplePrint_8java-example.xml -// File: LargeVRDSExplicit_8cxx-example.xml +// File: AddPrivateAttribute_8py-example.xml -// File: MagnifyFile_8cxx-example.xml +// File: ConvertMPL_8py-example.xml -// File: MakeTemplate_8cxx-example.xml +// File: ConvertNumpy_8py-example.xml -// File: ManipulateFile_8cs-example.xml +// File: ConvertPIL_8py-example.xml -// File: ManipulateFile_8py-example.xml +// File: CreateRAWStorage_8py-example.xml -// File: ManipulateSequence_8py-example.xml +// File: DecompressImage_8py-example.xml -// File: MergeFile_8py-example.xml +// File: DumbAnonymizer_8py-example.xml -// File: MergeTwoFiles_8cxx-example.xml +// File: ExtractImageRegion_8py-example.xml -// File: MetaImageMD5Activiz_8cs-example.xml +// File: FindAllPatientName_8py-example.xml -// File: MIPViewer_8java-example.xml +// File: FixCommaBug_8py-example.xml -// File: MpegVideoInfo_8cs-example.xml +// File: GetPortionCSAHeader_8py-example.xml -// File: MPRViewer_8java-example.xml +// File: HelloWorld_8py-example.xml -// File: MPRViewer2_8java-example.xml +// File: ManipulateFile_8py-example.xml -// File: MrProtocol_8cxx-example.xml +// File: ManipulateSequence_8py-example.xml -// File: NewSequence_8cs-example.xml +// File: MergeFile_8py-example.xml // File: NewSequence_8py-example.xml -// File: offscreenimage_8cxx-example.xml - - -// File: PatchFile_8cxx-example.xml - - // File: PhilipsPrivateRescaleInterceptSlope_8py-example.xml // File: PlaySound_8py-example.xml -// File: pmsct_rgb1_8cxx-example.xml +// File: PrivateDict_8py-example.xml -// File: PrintLUT_8cxx-example.xml +// File: ReWriteSCAsMR_8py-example.xml -// File: PrivateDict_8py-example.xml +// File: ReadAndDumpDICOMDIR_8py-example.xml -// File: PublicDict_8cxx-example.xml +// File: RemovePrivateTags_8py-example.xml -// File: QIDO-RS_8cxx-example.xml +// File: ScanDirectory_8py-example.xml -// File: ReadAndDumpDICOMDIR_8cxx-example.xml +// File: SortImage_8py-example.xml -// File: ReadAndDumpDICOMDIR_8py-example.xml +// File: WriteBuffer_8py-example.xml -// File: ReadAndDumpDICOMDIR2_8cxx-example.xml +// File: HelloActiviz_8cs-example.xml -// File: ReadAndPrintAttributes_8cxx-example.xml +// File: HelloActiviz2_8cs-example.xml -// File: ReadExplicitLengthSQIVR_8cxx-example.xml +// File: HelloActiviz3_8cs-example.xml -// File: ReadFiles_8java-example.xml +// File: HelloActiviz4_8cs-example.xml -// File: ReadGEMSSDO_8cxx-example.xml +// File: HelloActiviz5_8cs-example.xml -// File: ReadMultiTimesException_8cxx-example.xml +// File: HelloVTKWorld_8cs-example.xml -// File: ReadSeriesIntoVTK_8java-example.xml +// File: HelloVTKWorld2_8cs-example.xml -// File: ReadUTF8QtDir_8cxx-example.xml +// File: MetaImageMD5Activiz_8cs-example.xml // File: RefCounting_8cs-example.xml -// File: ReformatFile_8cs-example.xml - - -// File: RemovePrivateTags_8py-example.xml +// File: Compute3DSpacing_8cxx-example.xml -// File: RescaleImage_8cs-example.xml +// File: Convert16BitsTo8Bits_8cxx-example.xml -// File: reslicesphere_8cxx-example.xml +// File: ConvertMultiFrameToSingleFrame_8cxx-example.xml -// File: ReWriteSCAsMR_8py-example.xml +// File: ConvertRGBToLuminance_8cxx-example.xml -// File: rle2img_8cxx-example.xml +// File: ConvertSingleBitTo8Bits_8cxx-example.xml -// File: rtstructapp_8cxx-example.xml +// File: CreateFakePET_8cxx-example.xml -// File: ScanDirectory_8cs-example.xml +// File: CreateFakeRTDOSE_8cxx-example.xml -// File: ScanDirectory_8java-example.xml +// File: GenerateRTSTRUCT_8cxx-example.xml -// File: ScanDirectory_8py-example.xml +// File: MagnifyFile_8cxx-example.xml -// File: SendFileSCU_8cs-example.xml +// File: gdcmorthoplanes_8cxx-example.xml -// File: SimplePrint_8cs-example.xml +// File: gdcmreslice_8cxx-example.xml -// File: SimplePrint_8java-example.xml +// File: gdcmrtionplan_8cxx-example.xml -// File: SimplePrintPatientName_8cs-example.xml +// File: gdcmrtplan_8cxx-example.xml -// File: SimpleScanner_8cxx-example.xml +// File: gdcmscene_8cxx-example.xml -// File: SortImage_8cxx-example.xml +// File: gdcmtexture_8cxx-example.xml -// File: SortImage_8py-example.xml +// File: gdcmvolume_8cxx-example.xml -// File: SortImage2_8cs-example.xml +// File: offscreenimage_8cxx-example.xml -// File: StandardizeFiles_8cs-example.xml +// File: reslicesphere_8cxx-example.xml -// File: StreamImageReaderTest_8cxx-example.xml +// File: rtstructapp_8cxx-example.xml -// File: TemplateEmptyImage_8cxx-example.xml +// File: threadgdcm_8cxx-example.xml -// File: TestByteSwap_8cxx-example.xml +// File: AWTMedical3_8java-example.xml -// File: TestReader_8cxx-example.xml +// File: HelloVTKWorld_8java-example.xml -// File: TestReader_8py-example.xml +// File: MIPViewer_8java-example.xml -// File: threadgdcm_8cxx-example.xml +// File: MPRViewer_8java-example.xml -// File: TraverseModules_8cxx-example.xml +// File: MPRViewer2_8java-example.xml -// File: uid_unique_8cxx-example.xml +// File: ReadSeriesIntoVTK_8java-example.xml -// File: VolumeSorter_8cxx-example.xml +// File: CastConvertPhilips_8py-example.xml -// File: WriteBuffer_8py-example.xml +// File: headsq2dcm_8py-example.xml // File: indexpage.xml diff -Nru gdcm-3.0.10/Wrapping/Python/gdcmswig.i gdcm-3.0.14/Wrapping/Python/gdcmswig.i --- gdcm-3.0.10/Wrapping/Python/gdcmswig.i 2021-10-06 13:16:36.000000000 +0000 +++ gdcm-3.0.14/Wrapping/Python/gdcmswig.i 2022-06-24 07:37:44.000000000 +0000 @@ -96,6 +96,8 @@ #include "gdcmSubject.h" #include "gdcmCommand.h" #include "gdcmAnonymizer.h" +#include "gdcmDPath.h" +#include "gdcmCleaner.h" #include "gdcmFileAnonymizer.h" #include "gdcmFileStreamer.h" #include "gdcmSystem.h" @@ -581,6 +583,7 @@ EXTEND_CLASS_PRINT(gdcm::StrictScanner) %template(SmartPtrAno) gdcm::SmartPointer; +%template(SmartPtrCleaner) gdcm::SmartPointer; //%ignore gdcm::Anonymizer::Anonymizer; @@ -590,6 +593,8 @@ //%feature("unref") Anonymizer "coucou $this->Delete();" // http://www.swig.org/Doc1.3/SWIGPlus.html#SWIGPlus%5Fnn34 %include "gdcmAnonymizer.h" +%include "gdcmDPath.h" +%include "gdcmCleaner.h" %apply char[] { char* value_data } %include "gdcmFileAnonymizer.h" %clear char* value_data; @@ -766,7 +771,22 @@ //%feature("director") Codec; //%include "gdcmCodec.h" %feature("director") ImageCodec; +%typemap(in) const unsigned int d[3] (unsigned int temp[3]) { + int i; + if (PyTuple_Check($input)) { + if (!PyArg_ParseTuple($input,"iii",temp,temp+1,temp+2)) { + PyErr_SetString(PyExc_TypeError,"tuple must have 3 elements"); + return NULL; + } + $1 = &temp[0]; + } else { + PyErr_SetString(PyExc_TypeError,"expected a tuple."); + return NULL; + } +} +%ignore gdcm::ImageCodec::SetDimensions(const std::vector &); %include "gdcmImageCodec.h" +%clear const unsigned int d[3]; %include "gdcmRLECodec.h" %include "gdcmJPEGCodec.h" %include "gdcmJPEGLSCodec.h"