Program: gdcm
Module: $RCSfile: TestDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/02/01 10:52:09 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2005/08/31 09:29:11 $
+ Version: $Revision: 1.40 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return 0;
}
-int TestDicomDir(int argc, char* argv[])
+int TestDicomDir(int argc, char *argv[])
{
gdcm::DicomDir *dicomdir;
- gdcm::DicomDirPatient * pa1;
- gdcm::DicomDirStudy *st1;
- gdcm::DicomDirSerie *se1;
- gdcm::DicomDirImage *im1;
+ gdcm::DicomDirPatient *pa1;
+ gdcm::DicomDirStudy *st1;
+ gdcm::DicomDirSerie *se1;
+ gdcm::DicomDirImage *im1;
gdcm::TSKey v;
file += "/DICOMDIR";
}
- dicomdir = new gdcm::DicomDir(file);
+ dicomdir = new gdcm::DicomDir( );
+ dicomdir->SetFileName(file);
+ dicomdir->Load( );
if (argc > 2)
{
int level = atoi(argv[2]);
// ------------------------- second stage ---------------------------
// Write on disc what we read
- dicomdir->WriteDicomDir("NewDICOMDIR");
+ dicomdir->Write("NewDICOMDIR");
std::cout << std::endl << std::endl
<< "NewDICOMDIR written on disc ================================="
<< std::endl<< std::endl;
// Read what we wrote
- gdcm::DicomDir *d2 = new gdcm::DicomDir("NewDICOMDIR");
- if (!d2)
+ gdcm::DicomDir *d2 = new gdcm::DicomDir( );
+ d2->SetFileName("NewDICOMDIR");
+ d2->Load( );
+ if (!d2->IsReadable( ))
{
std::cout << std::endl << std::endl
<< "Read NewDicomDir from disc failed ========================"
<< std::endl<< std::endl;
gdcm::DicomDirPatient *pa2;
- gdcm::DicomDirStudy *st2;
- gdcm::DicomDirSerie *se2;
- gdcm::DicomDirImage *im2;
+ gdcm::DicomDirStudy *st2;
+ gdcm::DicomDirSerie *se2;
+ gdcm::DicomDirImage *im2;
pa1 = dicomdir->GetFirstPatient();
pa2 = d2->GetFirstPatient();