Program: gdcm
Module: $RCSfile: TestDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/10/18 08:35:46 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2005/10/25 14:52:30 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
file += "/DICOMDIR";
}
- dicomdir = new gdcm::DicomDir( );
+ dicomdir = gdcm::DicomDir::New();
dicomdir->SetFileName(file);
- dicomdir->Load( );
+ dicomdir->Load();
if (argc > 2)
{
int level = atoi(argv[2]);
<<"' is not readable"<<std::endl
<<" ...Failed"<<std::endl;
- delete dicomdir;
+ dicomdir->Delete();
return 1;
}
else
<<" has no patient"<<std::endl
<<" ...Failed"<<std::endl;
- delete dicomdir;
+ dicomdir->Delete();
return 1;
}
<< "NewDICOMDIR written on disc ================================="
<< std::endl<< std::endl;
// Read what we wrote
- gdcm::DicomDir *d2 = new gdcm::DicomDir( );
+ gdcm::DicomDir *d2 = gdcm::DicomDir::New();
d2->SetFileName("NewDICOMDIR");
- d2->Load( );
- if (!d2->IsReadable( ))
+ d2->Load();
+ if (!d2->IsReadable())
{
std::cout << std::endl << std::endl
<< "Read NewDicomDir from disc failed ========================"
if (!d2)
{
std::cout << "NewDICOMDIR contains no Patient ?!?" << std::endl;
- delete dicomdir;
- delete d2;
+ dicomdir->Delete();
+ d2->Delete();
return 1;
}
if ( CompareSQItem(pa2,pa1) == 1 )
{
- delete dicomdir;
- delete d2;
+ dicomdir->Delete();
+ d2->Delete();
return 1;
}
{
if ( CompareSQItem(st2,st1) == 1 )
{
- delete dicomdir;
- delete d2;
+ dicomdir->Delete();
+ d2->Delete();
return 1;
}
while ( se1 && se2 )
{ // we process all the SERIE of this study
if ( CompareSQItem(se2,se1) == 1 )
- return 1;
+ return 1;
+
std::cout << "--- --- " << se2->GetEntryString(0x0008, 0x103e); // Serie Description
std::cout << " Ser.nb:["<< se2->GetEntryString(0x0020, 0x0011); // Series number
std::cout << "] Mod.:[" << se2->GetEntryString(0x0008, 0x0060) << "]" << std::endl; // Modality
{
if ( CompareSQItem(im2,im1) == 1 )
{
- delete dicomdir;
- delete d2;
+ dicomdir->Delete();
+ d2->Delete();
return 1;
}
}
std::cout << std::flush;
- delete dicomdir;
- delete d2;
+ dicomdir->Delete();
+ d2->Delete();
return 0;
}