# HG changeset patch # User Sebastien Jodogne # Date 1507454036 -7200 # Node ID d0fe5ec7eb051b67d79f3e6007efb1311cb9381f # Parent 481cbda54e2126d37805159cf71eb0cbac434b71 playing with dicomdir diff -r 481cbda54e21 -r d0fe5ec7eb05 Core/DicomParsing/DicomDirWriter.cpp --- a/Core/DicomParsing/DicomDirWriter.cpp Fri Oct 06 17:26:34 2017 +0200 +++ b/Core/DicomParsing/DicomDirWriter.cpp Sun Oct 08 11:13:56 2017 +0200 @@ -211,6 +211,13 @@ std::string value; bool found = GetUtf8TagValue(value, source, encoding, key); + if (!found) + { + // We don't raise an exception if "!optional", even if this + // results in an invalid DICOM file + value.clear(); + } + SetTagValue(target, key, value); return found; } @@ -240,6 +247,14 @@ CopyString(target, source, encoding, key, false, true); } + static void CopyStringType3(DcmDirectoryRecord& target, + DcmDataset& source, + Encoding encoding, + const DcmTagKey& key) + { + CopyString(target, source, encoding, key, true, true); + } + public: PImpl() : fileSetId_("ORTHANC_MEDIA")