]> Creatis software - gdcm.git/blob - Testing/TestTS.cxx
Some normalizations :
[gdcm.git] / Testing / TestTS.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: TestTS.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/23 10:12:32 $
7   Version:   $Revision: 1.8 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18 #include "gdcmTS.h"
19 #include "gdcmGlobal.h"
20
21 int TestTS(int , char *[])
22 {
23    gdcm::TS ts;
24    // There should be ~150 entries
25    ts.Print( std::cout );
26
27    // Implicit VR Little Endian
28    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2" ) << std::endl;
29    // Implicit VR Big Endian DLX (G.E Private)
30    std::cout << ts.IsTransferSyntax( "1.2.840.113619.5.2" ) << std::endl;
31    // Explicit VR Little Endian
32    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.1" ) << std::endl;
33    // Deflated Explicit VR Little Endian
34    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.1.99" ) << std::endl;
35    // Explicit VR Big Endian
36    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.2" ) << std::endl;
37    // JPEG Baseline (Process 1)
38    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.50" ) << std::endl;
39    // JPEG Extended (Process 2 & 4)
40    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.51" ) << std::endl;
41    // JPEG Extended (Process 3 & 5)
42    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.52" ) << std::endl;
43    // JPEG Spectral Selection, Non-Hierarchical (Process 6 & 8)
44    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.53" ) << std::endl;
45    // JPEG Full Progression, Non-Hierarchical (Process 10 & 12)
46    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.55" ) << std::endl;
47    // JPEG Lossless, Non-Hierarchical (Process 14)
48    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.57" ) << std::endl;
49    // JPEG Lossless, Hierarchical, First-Order Prediction (Process 14, [Selection Value 1])
50    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.70" ) << std::endl;
51    // JPEG 2000 Lossless
52    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.90" ) << std::endl;
53    // JPEG 2000
54    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.4.91" ) << std::endl;
55    // RLE Lossless
56    std::cout << ts.IsTransferSyntax( "1.2.840.10008.1.2.5" ) << std::endl;
57    // Unknown
58    std::cout << ts.IsTransferSyntax( "Unknown Transfer Syntax" ) << std::endl;
59
60    // Test JPEG test:
61    std::cout << "Test TS:" << std::endl;
62    std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.4.55") << std::endl;
63 //if ( key == "1.2.840.10008.1.2.4.55"
64 //        || key == "1.2.840.10008.1.2.4.57"
65 //        || key == "1.2.840.10008.1.2.4.70" )
66    std::cout << ts.IsRLELossless( "1.2.840.10008.1.2.5") << std::endl;
67    std::cout << ts.IsJPEGLossless( "1.2.840.10008.1.2.5") << std::endl;
68    std::cout << ts.IsJPEG2000( "1.2.840.10008.1.2.5") << std::endl;
69    std::cout << ts.IsJPEG( "1.2.840.10008.1.2.5") << std::endl;
70    std::cout << ts.GetSpecialTransferSyntax( ts.GetSpecialTransferSyntax( "1.2.840.10008.1.2.5")) << std::endl;
71    std::cout << gdcm::Global::GetTS()->IsRLELossless( "1.2.840.10008.1.2.5" )  << std::endl;
72
73    return ts.GetValue( "" ) != gdcm::GDCM_UNFOUND;
74 }