X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestTS.cxx;h=9c608cd78de4eae5c01bbab43c4279426d4195f1;hb=9d461db5c5d954548cd07d1fa095e9bad43a0cac;hp=582264393a94d3d4c8a504c548410898d72b33b7;hpb=6578460d701eb48ccdac0a8ca316360fc6dd3944;p=gdcm.git diff --git a/Testing/TestTS.cxx b/Testing/TestTS.cxx index 58226439..9c608cd7 100644 --- a/Testing/TestTS.cxx +++ b/Testing/TestTS.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: TestTS.cxx,v $ Language: C++ - Date: $Date: 2005/01/11 17:19:38 $ - Version: $Revision: 1.7 $ + Date: $Date: 2007/05/23 14:18:06 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,56 +20,62 @@ int TestTS(int , char *[]) { - gdcm::TS ts; + GDCM_NAME_SPACE::TS *ts = GDCM_NAME_SPACE::TS::New(); // There should be ~150 entries - ts.Print( std::cout ); + ts->Print( std::cout ); // Implicit VR Little Endian - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2" ) << std::endl; // Implicit VR Big Endian DLX (G.E Private) - std::cout << ts.IsTransferSyntax( "1.2.840.113619.5.2" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.113619.5.2" ) << std::endl; // Explicit VR Little Endian - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.1" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.1" ) << std::endl; // Deflated Explicit VR Little Endian - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.1.99" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.1.99" ) << std::endl; // Explicit VR Big Endian - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.2" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.2" ) << std::endl; // JPEG Baseline (Process 1) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.50" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.50" ) << std::endl; // JPEG Extended (Process 2 & 4) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.51" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.51" ) << std::endl; // JPEG Extended (Process 3 & 5) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.52" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.52" ) << std::endl; // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.53" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.53" ) << std::endl; // JPEG Full Progression, Non-Hierarchical (Process 10 & 12) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.55" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.55" ) << std::endl; // JPEG Lossless, Non-Hierarchical (Process 14) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.57" ) << std::endl; - // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1]) - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.70" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.57" ) << std::endl; + // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, + // [Selection Value 1]) + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.70" ) << std::endl; // JPEG 2000 Lossless - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.90" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.90" ) << std::endl; // JPEG 2000 - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.91" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.4.91" ) << std::endl; // RLE Lossless - std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.5" ) << std::endl; + std::cout << ts->IsTransferSyntax( "1.2.840.10008.1.2.5" ) << std::endl; // Unknown - std::cout << ts.IsTransferSyntax( "Unknown Transfer Syntax" ) << std::endl; + std::cout << ts->IsTransferSyntax( "Unknown Transfer Syntax" ) << std::endl; // Test JPEG test: std::cout << "Test TS:" << std::endl; - std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.4.55") << std::endl; + std::cout << ts->IsJPEGLossless( "1.2.840.10008.1.2.4.55") << std::endl; //if ( key == "1.2.840.10008.1.2.4.55" -// || key == "1.2.840.10008.1.2.4.57" -// || key == "1.2.840.10008.1.2.4.70" ) - std::cout << ts.IsRLELossless( "1.2.840.10008.1.2.5") << std::endl; - std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl; - std::cout << ts.IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl; - std::cout << ts.IsJPEG( "1.2.840.10008.1.2.5") << std::endl; - std::cout << ts.IsEncapsulate( "1.2.840.10008.1.2.5") << std::endl; - std::cout << ts.GetSpecialTransferSyntax( ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl; - std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" ) << std::endl; +// || key == "1.2.840.10008.1.2.4.57" +// || key == "1.2.840.10008.1.2.4.70" ) + std::cout << ts->IsRLELossless( "1.2.840.10008.1.2.5") << std::endl; + std::cout << ts->IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl; + std::cout << ts->IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl; + std::cout << ts->IsJPEG( "1.2.840.10008.1.2.5") << std::endl; + std::cout << ts->GetSpecialTransferSyntax( + ts->GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl; + std::cout << GDCM_NAME_SPACE::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" ) + << std::endl; - return ts.GetValue( "" ) != gdcm::GDCM_UNFOUND; + bool ret = ts->GetValue( "" ) != GDCM_NAME_SPACE::GDCM_UNFOUND; + + ts->Delete(); + + return ret; }