comparison UnitTestsSources/FromDcmtkTests.cpp @ 3910:1f71c2f20e16 transcoding

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 08 May 2020 12:03:26 +0200
parents 6762a97deabc
children 7dc5e7e0045d
comparison
equal deleted inserted replaced
3909:6762a97deabc 3910:1f71c2f20e16
1985 DcmtkTranscoder transcoder; 1985 DcmtkTranscoder transcoder;
1986 1986
1987 for (int i = 0; i <= DicomTransferSyntax_XML; i++) 1987 for (int i = 0; i <= DicomTransferSyntax_XML; i++)
1988 { 1988 {
1989 DicomTransferSyntax a = (DicomTransferSyntax) i; 1989 DicomTransferSyntax a = (DicomTransferSyntax) i;
1990 std::set<DicomTransferSyntax> s;
1991 s.insert(a);
1992 1990
1993 std::string t; 1991 std::string t;
1994 1992
1995 bool hasSopInstanceUidChanged; 1993 bool hasSopInstanceUidChanged;
1996 DicomTransferSyntax sourceSyntax2, targetSyntax; 1994 DicomTransferSyntax sourceSyntax2;
1997 1995
1998 std::unique_ptr<DcmFileFormat> cloned(dynamic_cast<DcmFileFormat*>(toto->clone())); 1996 std::unique_ptr<DcmFileFormat> cloned(dynamic_cast<DcmFileFormat*>(toto->clone()));
1999 if (!transcoder.TranscodeParsedToBuffer(t, sourceSyntax2, targetSyntax, hasSopInstanceUidChanged, *cloned, s, true)) 1997 if (!transcoder.TranscodeParsedToBuffer(t, sourceSyntax2, hasSopInstanceUidChanged, *cloned, a, true))
2000 { 1998 {
2001 printf("**************** CANNOT: [%s] => [%s]\n", 1999 printf("**************** CANNOT: [%s] => [%s]\n",
2002 GetTransferSyntaxUid(sourceSyntax), GetTransferSyntaxUid(a)); 2000 GetTransferSyntaxUid(sourceSyntax), GetTransferSyntaxUid(a));
2003 } 2001 }
2004 else 2002 else
2005 { 2003 {
2004 DicomTransferSyntax targetSyntax;
2005 ASSERT_TRUE(FromDcmtkBridge::LookupOrthancTransferSyntax(targetSyntax, *cloned));
2006
2006 ASSERT_EQ(targetSyntax, a); 2007 ASSERT_EQ(targetSyntax, a);
2007 ASSERT_EQ(sourceSyntax, sourceSyntax2); 2008 ASSERT_EQ(sourceSyntax, sourceSyntax2);
2008 bool lossy = (a == DicomTransferSyntax_JPEGProcess1 || 2009 bool lossy = (a == DicomTransferSyntax_JPEGProcess1 ||
2009 a == DicomTransferSyntax_JPEGProcess2_4 || 2010 a == DicomTransferSyntax_JPEGProcess2_4 ||
2010 a == DicomTransferSyntax_JPEGLSLossy); 2011 a == DicomTransferSyntax_JPEGLSLossy);