]> Creatis software - gdcm.git/blobdiff - Example/BuildUpDicomDir.cxx
STYLE: Better approach to work around the timeval definition. Use type directly inste...
[gdcm.git] / Example / BuildUpDicomDir.cxx
index 5fd9b6ad915d42eceab626cd7dcc546b0979b72d..66df934f9988ce4ca09418175f0036397e92bbff 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: BuildUpDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/16 04:26:17 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/01/08 15:03:57 $
+  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
      PURPOSE.  See the above copyright notices for more information.
                                                                                 
 =========================================================================*/
-#include <iostream>
-#include "gdcm.h"
 #include "gdcmDocEntry.h"
 #include "gdcmDicomDir.h"
 #include "gdcmDicomDirPatient.h"
 #include "gdcmDirList.h"
 #include "gdcmDebug.h"
-
-#include <fstream>
-#ifdef GDCM_NO_ANSI_STRING_STREAM
-#  include <strstream>
-#  define  ostringstream ostrstream
-# else
-#  include <sstream>
-#endif
-
-#define  ostringstream ostrstream
-
-#include <sys/types.h>
-#include <errno.h>
-
-// for Directory pb
-#if defined(_MSC_VER) || defined(__BORLANDC__) 
-   #include <windows.h> 
-   #include <direct.h>
-   #include <stdio.h>
-#else
-   #include <dirent.h>   
-   #include <unistd.h>
-#endif
-
-#include <vector>
-#include <algorithm>
+#include "gdcmDicomDirStudy.h"
+#include "gdcmDicomDirSerie.h"
+#include "gdcmDicomDirImage.h"
 
 // ===============================================================
 /**
@@ -71,29 +46,29 @@ int main(int argc, char* argv[])
    gdcm::DicomDir *dcmdir;
    dcmdir = new gdcm::DicomDir();
 
-   printf( "\n------- BuildUpDicomDir: Test Print Meta only -----\n");
+   std::cout << "\n------- BuildUpDicomDir: Test Print Meta only -----" << std::endl;
    ((gdcm::Document *)dcmdir)->Print();
 
    gdcm::DicomDirPatient *p1=dcmdir->NewPatient();
-   p1->SetEntryByNumber("patientONE",0x0010, 0x0010);
+   p1->SetEntry("patientONE",0x0010, 0x0010);
 
      
    gdcm::DicomDirPatient *p2=dcmdir->NewPatient();
-   p2->SetEntryByNumber("patientTWO",0x0010, 0x0010);     
+   p2->SetEntry("patientTWO",0x0010, 0x0010);     
    gdcm::DicomDirStudy *s21=p2->NewStudy();  
-       s21->SetEntryByNumber("StudyDescrTwo.One",0x0008, 0x1030);        
+       s21->SetEntry("StudyDescrTwo.One",0x0008, 0x1030);        
    gdcm::DicomDirSerie *s211=s21->NewSerie();   
    gdcm::DicomDirImage *s2111=s211->NewImage();
    (void)s2111; //not used
 
    gdcm::DicomDirStudy *s11=p1->NewStudy();  
-   s11->SetEntryByNumber("StudyDescrOne.One",0x0008, 0x1030);
+   s11->SetEntry("StudyDescrOne.One",0x0008, 0x1030);
    // Name of the physician reading study
    // Header Entry to be created
-   s11->SetEntryByNumber("Dr Mabuse",0x0008, 0x1060);
+   s11->SetEntry("Dr Mabuse",0x0008, 0x1060);
 
    gdcm::DicomDirPatient *p3 = dcmdir->NewPatient();
-   p3->SetEntryByNumber("patientTHREE",0x0010, 0x0010);
+   p3->SetEntry("patientTHREE",0x0010, 0x0010);
 
    std::cout << "\n------- BuildUpDicomDir: Test Print of Patient ONE -----\n";
    p1->Print();