-#include <iostream>
-#include "gdcm.h"
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: BuildUpDicomDir.cxx,v $
+ Language: C++
+ Date: $Date: 2005/02/02 10:06:31 $
+ Version: $Revision: 1.14 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
#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
-#ifdef _MSC_VER
- #include <windows.h>
- #include <direct.h>
-#else
- #include <dirent.h>
- #include <unistd.h>
-#endif
-
-#include <vector>
-#include <algorithm>
+#include "gdcmDicomDirStudy.h"
+#include "gdcmDicomDirSerie.h"
+#include "gdcmDicomDirImage.h"
// ===============================================================
/**
* and writes a file named NewDICOMDIR.
*/
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
{
std::string dirName = "NewDICOMDIR";
dirName = argv[1];
}
- gdcmDicomDir *dcmdir;
- dcmdir=new gdcmDicomDir();
+ gdcm::DicomDir *dcmdir;
+ dcmdir = new gdcm::DicomDir();
- printf( "\n------- BuildUpDicomDir: Test Print Meta only -----\n");
- ((gdcmDocument *)dcmdir)->Print();
+ std::cout << "\n------- BuildUpDicomDir: Test Print Meta only -----" << std::endl;
+ ((gdcm::Document *)dcmdir)->Print();
- gdcmDicomDirPatient *p1=dcmdir->NewPatient();
- p1->SetEntryByNumber("patientONE",0x0010, 0x0010);
+ gdcm::DicomDirPatient *p1=dcmdir->NewPatient();
+ p1->SetValEntry("patientONE",0x0010, 0x0010);
- gdcmDicomDirPatient *p2=dcmdir->NewPatient();
- p2->SetEntryByNumber("patientTWO",0x0010, 0x0010);
- gdcmDicomDirStudy *s21=p2->NewStudy();
- s21->SetEntryByNumber("StudyDescrTwo.One",0x0008, 0x1030);
- gdcmDicomDirSerie *s211=s21->NewSerie();
- gdcmDicomDirImage *s2111=s211->NewImage();
+ gdcm::DicomDirPatient *p2=dcmdir->NewPatient();
+ p2->SetValEntry("patientTWO",0x0010, 0x0010);
+ gdcm::DicomDirStudy *s21=p2->NewStudy();
+ s21->SetValEntry("StudyDescrTwo.One",0x0008, 0x1030);
+ gdcm::DicomDirSerie *s211=s21->NewSerie();
+ gdcm::DicomDirImage *s2111=s211->NewImage();
(void)s2111; //not used
- gdcmDicomDirStudy *s11=p1->NewStudy();
- s11->SetEntryByNumber("StudyDescrOne.One",0x0008, 0x1030);
+ gdcm::DicomDirStudy *s11=p1->NewStudy();
+ s11->SetValEntry("StudyDescrOne.One",0x0008, 0x1030);
// Name of the physician reading study
// Header Entry to be created
- s11->SetEntryByNumber("Dr Mabuse",0x0008, 0x1060);
+ s11->SetValEntry("Dr Mabuse",0x0008, 0x1060);
- gdcmDicomDirPatient *p3 = dcmdir->NewPatient();
- p3->SetEntryByNumber("patientTHREE",0x0010, 0x0010);
+ gdcm::DicomDirPatient *p3 = dcmdir->NewPatient();
+ p3->SetValEntry("patientTHREE",0x0010, 0x0010);
std::cout << "\n------- BuildUpDicomDir: Test Print of Patient ONE -----\n";
p1->Print();