]> Creatis software - gdcm.git/blob - Example/TestDcm2Acr.cxx
ENH: Add license to examples since they belong to gdcm
[gdcm.git] / Example / TestDcm2Acr.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: TestDcm2Acr.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/11/16 04:26:18 $
7   Version:   $Revision: 1.4 $
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 <iostream>
19 #include "gdcm.h"
20 #include <stdio.h>
21
22 int main(int argc, char* argv[])
23 {  
24    std::string toto;
25    char zozo[100];
26
27    gdcm::File  * f1;
28
29    printf (" Before gdcmFile() \n");
30    printf ("\n\n---------------------------------------\n\n");
31
32    if (argc > 1) {
33       toto = argv[1];
34       f1 = new gdcm::File(toto);
35    } else {
36       std::string filename = GDCM_DATA_ROOT;
37       filename += "/test.acr";
38       f1 = new gdcm::File(filename.c_str());
39    }
40    printf (" Sortie gdcmFile() \n");
41
42    //e1.PrintPubDict(std::cout);
43    f1->GetHeader()->Print();
44
45    //cle = gdcmDictEntry::TranslateToKey(0x0028,0x0008);
46
47    int dataSize = f1->GetImageDataSize();
48    printf ("dataSize %d\n",dataSize);
49
50    // void* imageData= f1->GetHeader()->GetImageData();
51
52    // Ecriture d'un Raw File, a afficher avec affim filein= dim= nbit= signe=
53    //f1->WriteRawData("image.raw");
54
55    // ecriture d'un fichier DICOM à partir d'un dcmHeader correct.
56
57    //f1->WriteDcmImplVR("image.dcm");
58
59    // ecriture d'un fichier ACR à partir d'un dcmHeader correct.
60
61    sprintf(zozo, "%s.nema", toto.c_str());
62    f1->WriteAcr(zozo);
63    printf ("\n\n---------------------------------------\n\n");
64
65    f1->GetHeader()->Print();
66    
67    return 0;
68 }