Mercurial > hg > orthanc
diff UnitTestsSources/FromDcmtkTests.cpp @ 3945:0b3256c3ee14 transcoding
simplified IDicomTranscoder
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 19 May 2020 11:24:00 +0200 |
parents | 7dc5e7e0045d |
children | ef696db8426f |
line wrap: on
line diff
--- a/UnitTestsSources/FromDcmtkTests.cpp Tue May 19 10:17:06 2020 +0200 +++ b/UnitTestsSources/FromDcmtkTests.cpp Tue May 19 11:24:00 2020 +0200 @@ -1987,13 +1987,18 @@ for (int i = 0; i <= DicomTransferSyntax_XML; i++) { DicomTransferSyntax a = (DicomTransferSyntax) i; + + std::set<DicomTransferSyntax> s; + s.insert(a); std::string t; bool hasSopInstanceUidChanged; - std::unique_ptr<DcmFileFormat> cloned(dynamic_cast<DcmFileFormat*>(toto->clone())); - if (!transcoder.TranscodeParsedToBuffer(t, hasSopInstanceUidChanged, *cloned, a, true)) + IDicomTranscoder::DicomImage source, target; + source.AcquireParsed(dynamic_cast<DcmFileFormat*>(toto->clone())); + + if (!transcoder.Transcode(target, hasSopInstanceUidChanged, source, s, true)) { printf("**************** CANNOT: [%s] => [%s]\n", GetTransferSyntaxUid(sourceSyntax), GetTransferSyntaxUid(a)); @@ -2001,7 +2006,7 @@ else { DicomTransferSyntax targetSyntax; - ASSERT_TRUE(FromDcmtkBridge::LookupOrthancTransferSyntax(targetSyntax, *cloned)); + ASSERT_TRUE(FromDcmtkBridge::LookupOrthancTransferSyntax(targetSyntax, target.GetParsed())); ASSERT_EQ(targetSyntax, a); bool lossy = (a == DicomTransferSyntax_JPEGProcess1 ||