Mercurial > hg > orthanc
diff UnitTestsSources/FromDcmtkTests.cpp @ 3894:8f7ad4989fec transcoding
transcoding to uncompressed transfer syntaxes over DICOM protocol is implemented
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 07 May 2020 11:13:29 +0200 |
parents | 7a5fa8f307e9 |
children | 6762a97deabc |
line wrap: on
line diff
--- a/UnitTestsSources/FromDcmtkTests.cpp Wed May 06 12:48:28 2020 +0200 +++ b/UnitTestsSources/FromDcmtkTests.cpp Thu May 07 11:13:29 2020 +0200 @@ -1955,7 +1955,7 @@ std::string c, i; try { - scu.Transcode(c, i, transcoder, source.c_str(), source.size()); + scu.Transcode(c, i, transcoder, source.c_str(), source.size(), false, "", 0); } catch (OrthancException& e) { @@ -1991,15 +1991,29 @@ s.insert(a); std::string t; - - if (!transcoder.TranscodeToBuffer(t, source.c_str(), source.size(), s, true)) + + bool hasSopInstanceUidChanged; + + if (!transcoder.TranscodeToBuffer(t, hasSopInstanceUidChanged, source.c_str(), source.size(), s, true)) { printf("**************** CANNOT: [%s] => [%s]\n", GetTransferSyntaxUid(sourceSyntax), GetTransferSyntaxUid(a)); } else { + bool lossy = (a == DicomTransferSyntax_JPEGProcess1 || + a == DicomTransferSyntax_JPEGProcess2_4 || + a == DicomTransferSyntax_JPEGLSLossy); + printf("SIZE: %lu\n", t.size()); + if (hasSopInstanceUidChanged) + { + ASSERT_TRUE(lossy); + } + else + { + ASSERT_FALSE(lossy); + } } } }